%I #18 Feb 01 2024 00:08:04
%S 3,3,56953,34225258495
%N a(n) is the least positive k, not a power of 2, such that the Hamming weight of k equals the Hamming weight of k^n, or 0 if no such k exists.
%C The Hamming weight of a number n is given by A000120(n).
%C Is this sequence positive for every positive integer?
%C a(2) = A292787(2).
%C a(3) = A292788(2).
%e For n = 2:
%e - 1 is a power of 2,
%e - 2 is a power of 2,
%e - A000120(3) = 2 and A000120(3^2) = 2,
%e - hence a(2) = 3.
%o (PARI) a(n) = forstep(k=3, oo, 2, if (hammingweight(k) == hammingweight(k^n), return (k)))
%Y Cf. A000120, A292787, A292788, A363836.
%K nonn,base,hard,more
%O 1,1
%A _Rémy Sigrist_, Sep 24 2017
|