login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A364606 Numbers k such that the average digit of 2^k is an integer. 1
0, 1, 2, 3, 6, 13, 16, 26, 46, 51, 56, 73, 122, 141, 166, 313, 383 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
{ k : A001370(k) mod A034887(k) = 0 }.
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
A364606_list = list(islice(A364606_gen(), 10)) # Chai Wah Wu, Jul 31 2023
CROSSREFS
Sequence in context: A054049 A276690 A175281 * A244790 A111503 A239326
KEYWORD
nonn,base
AUTHOR
Jon E. Schoenfield, Jul 29 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 13 06:34 EDT 2024. Contains 374267 sequences. (Running on oeis4.)