OFFSET
1,2
COMMENTS
Question is the sequence finite or infinite?
LINKS
Robert Israel, Table of n, a(n) for n = 1..13
EXAMPLE
512 = 2^9 and 5+1+2 = 8 = 2^3. 68719476736 = 2^36, sum of digits = 64 = 2^6.
MAPLE
with(numtheory): pow2 := [2^i$ i=1..2000]: for n from 1 to 1000 do L1 := convert(2^n, base, 10): if member(sum(L1[i], i=1..nops(L1)), pow2) then printf(`%d, `, 2^n) fi: od: # James A. Sellers, Apr 19 2001
MATHEMATICA
Select[Table[2^n, {n, 0, 250}], IntegerQ[Log[2, Total[IntegerDigits[#]]]] &] (* Jayanta Basu, May 19 2013 *)
Module[{nn=200, pw2}, pw2=2^Range[0, nn]; Select[pw2, MemberQ[pw2, Total[ IntegerDigits[ #]]]&]] (* Harvey P. Dale, Dec 01 2022 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Apr 19 2001
EXTENSIONS
More terms from James A. Sellers, Apr 19 2001
STATUS
approved