A028838 Numbers whose sum of digits is a power of 2.
1, 2, 4, 8, 10, 11, 13, 17, 20, 22, 26, 31, 35, 40, 44, 53, 62, 71, 79, 80, 88, 97, 100, 101, 103, 107, 110, 112, 116, 121, 125, 130, 134, 143, 152, 161, 169, 170, 178, 187, 196, 200, 202, 206, 211, 215, 220, 224, 233, 242, 251, 259, 260, 268, 277, 286, 295, 301, 305, 310, 314, 323, 332, 341
Offset: 1
Links
- Marius A. Burtea, Table of n, a(n) for n = 1..10535
Programs
-
Magma
[1] cat [k: k in [2..341] | PrimeDivisors(&+Intseq(k)) eq [2] or &+Intseq(k) eq 1]; // Marius A. Burtea, Jun 11 2019
-
Mathematica
Select[Range[400],IntegerQ[Log2[Total[IntegerDigits[#]]]]&] (* Harvey P. Dale, Jul 22 2023 *)
-
PARI
ispp(n) = (n==1) || (isprimepower(n, &p) && (p==2)); isok(n) = ispp(sumdigits(n)); \\ Michel Marcus, Jun 11 2019
Extensions
More terms from Scott Lindhurst (ScottL(AT)alumni.princeton.edu)
Checked by Neven Juric (neven.juric(AT)apis-it.hr), Feb 04 2008