OFFSET
1,1
COMMENTS
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
2 is in this sequence because 2 is 10 in binary representation, and it has as many 1s as its square 4, which is 100 in binary.
MATHEMATICA
bc[n_] := DigitCount[n, 2][[1]]; Select[Range[7151], PrimeQ[#] && bc[#] >= bc[#^2] &] (* Giovanni Resta, Jan 28 2014 *)
Select[Prime[Range[1000]], DigitCount[#, 2, 1] >= DigitCount[#^2, 2, 1] &] (* Alonso del Arte, Jan 28 2014 *)
PROG
(PARI) is(n)=hammingweight(n^2)<=hammingweight(n) && isprime(n) \\ Charles R Greathouse IV, Mar 18 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Irina Gerasimova, Jan 27 2014
STATUS
approved