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.

A371809 Number of 666 substrings contained in the decimal expansion of the n-th apocalyptic number, where overlapping substrings are counted as distinct.

Original entry on oeis.org

1, 1, 1, 4, 3, 1, 1, 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, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 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, 3, 3, 1, 2, 3
Offset: 1

Views

Author

Paolo Xausa, Apr 06 2024

Keywords

Comments

An apocalyptic number is a positive power of 2 containing 666 in its decimal expansion.
See A371807 for a variant counting only nonoverlapping substrings.

Examples

			a(8) = 2 because the 8th apocalyptic number (2^243) contains two (overlapping) 666 substrings in its decimal expansion:
                   ***
14134776518227074636666380005943348126619871175004951664972849610340958208.
                    ***
		

Crossrefs

Programs

  • Mathematica
    Select[StringCount[IntegerString[2^Range[1000]], "666", Overlaps->True], # > 0 &]
  • Python
    from itertools import islice
    def agen(): # generator of terms
        pow2 = 1
        while True:
            s = str(pow2)
            c = sum(1 for i in range(len(s)-2) if s[i:i+3] == "666")
            if c > 0: yield c
            pow2 <<= 1
    print(list(islice(agen(), 88))) # Michael S. Branicky, Apr 07 2024

Formula

a(n) >= A371807(n).