login
Numbers whose sum of digits is a power of 2.
6

%I #17 Jul 22 2023 19:45:39

%S 1,2,4,8,10,11,13,17,20,22,26,31,35,40,44,53,62,71,79,80,88,97,100,

%T 101,103,107,110,112,116,121,125,130,134,143,152,161,169,170,178,187,

%U 196,200,202,206,211,215,220,224,233,242,251,259,260,268,277,286,295,301,305,310,314,323,332,341

%N Numbers whose sum of digits is a power of 2.

%H Marius A. Burtea, <a href="/A028838/b028838.txt">Table of n, a(n) for n = 1..10535</a>

%t Select[Range[400],IntegerQ[Log2[Total[IntegerDigits[#]]]]&] (* _Harvey P. Dale_, Jul 22 2023 *)

%o (Magma) [1] cat [k: k in [2..341] | PrimeDivisors(&+Intseq(k)) eq [2] or &+Intseq(k) eq 1]; // _Marius A. Burtea_, Jun 11 2019

%o (PARI) ispp(n) = (n==1) || (isprimepower(n, &p) && (p==2));

%o isok(n) = ispp(sumdigits(n)); \\ _Michel Marcus_, Jun 11 2019

%Y Cf. A007953, A028836, A028846.

%K nonn,base

%O 1,2

%A _N. J. A. Sloane_

%E More terms from Scott Lindhurst (ScottL(AT)alumni.princeton.edu)

%E Checked by Neven Juric (neven.juric(AT)apis-it.hr), Feb 04 2008