cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A364606 Numbers k such that the average digit of 2^k is an integer.

This page as a plain text file.
%I A364606 #17 Jul 31 2023 10:43:14
%S A364606 0,1,2,3,6,13,16,26,46,51,56,73,122,141,166,313,383
%N A364606 Numbers k such that the average digit of 2^k is an integer.
%F A364606 { k : A001370(k) mod A034887(k) = 0 }.
%e A364606 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.
%p A364606 q:= n-> (l-> irem(add(i, i=l), nops(l))=0)(convert(2^n, base, 10)):
%p A364606 select(q, [$0..400])[];  # _Alois P. Heinz_, Jul 29 2023
%t A364606 Select[Range[0, 2^12], IntegerQ@ Mean@ IntegerDigits[2^#] &] (* _Michael De Vlieger_, Jul 29 2023 *)
%o A364606 (PARI) isok(k) = my(d=digits(2^k)); !(vecsum(d) % #d); \\ _Michel Marcus_, Jul 29 2023
%o A364606 (Python)
%o A364606 from itertools import count, islice
%o A364606 from gmpy2 import mpz, digits
%o A364606 def A364606_gen(startvalue=0): # generator of terms >= startvalue
%o A364606     m = mpz(1)<<max(startvalue,0)
%o A364606     for k in count(max(startvalue,0)):
%o A364606         s = digits(m)
%o A364606         if not sum(int(d) for d in s) % len(s):
%o A364606             yield k
%o A364606         m <<= 1
%o A364606 A364606_list = list(islice(A364606_gen(),10)) # _Chai Wah Wu_, Jul 31 2023
%Y A364606 Cf. A000079, A001370, A034887, A061383.
%K A364606 nonn,base
%O A364606 1,3
%A A364606 _Jon E. Schoenfield_, Jul 29 2023