OFFSET
1,3
EXAMPLE
2^26 = 67108864 is an 8-digit number; its average digit is (6+7+1+0+8+8+6+4)/8 = 40/8 = 5, an integer, so 26 is a term.
MAPLE
q:= n-> (l-> irem(add(i, i=l), nops(l))=0)(convert(2^n, base, 10)):
select(q, [$0..400])[]; # Alois P. Heinz, Jul 29 2023
MATHEMATICA
Select[Range[0, 2^12], IntegerQ@ Mean@ IntegerDigits[2^#] &] (* Michael De Vlieger, Jul 29 2023 *)
PROG
(PARI) isok(k) = my(d=digits(2^k)); !(vecsum(d) % #d); \\ Michel Marcus, Jul 29 2023
(Python)
from itertools import count, islice
from gmpy2 import mpz, digits
def A364606_gen(startvalue=0): # generator of terms >= startvalue
m = mpz(1)<<max(startvalue, 0)
for k in count(max(startvalue, 0)):
s = digits(m)
if not sum(int(d) for d in s) % len(s):
yield k
m <<= 1
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jon E. Schoenfield, Jul 29 2023
STATUS
approved