A371807 Number of nonoverlapping 666 substrings contained in the decimal expansion of the n-th apocalyptic number.
1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2
Offset: 1
Examples
a(4) = 2 because the 4th apocalyptic number (2^220) contains two nonoverlapping 666 substrings in its decimal expansion: 2^220 = 168499(666)66969149871(666)88442938726917102321526408785780068975640576.
Links
- Paolo Xausa, Table of n, a(n) for n = 1..10000
- Brady Haran and Tony Padilla, Apocalyptic Numbers, YouTube Numberphile video, 2024.
- Eric Weisstein's World of Mathematics, Apocalyptic Number.
Programs
-
Mathematica
Select[StringCount[IntegerString[2^Range[1000]], "666"], # > 0 &]
-
Python
from itertools import islice def agen(): # generator of terms pow2 = 1 while True: s = str(pow2) if (c := s.count("666")) > 0: yield c pow2 <<= 1 print(list(islice(agen(), 88))) # Michael S. Branicky, Apr 07 2024
Formula
a(n) <= A371809(n).
Comments