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.

A375306 Terms as well as digits fit the even/odd/odd pattern; this is the lexicographically earliest injective sequence with this property.

Original entry on oeis.org

0, 1, 3, 2, 5, 7, 4, 9, 101, 10, 11, 21, 12, 13, 23, 14, 15, 25, 16, 17, 27, 18, 19, 29, 30, 31, 41, 32, 33, 43, 34, 35, 45, 36, 37, 47, 38, 39, 49, 50, 51, 61, 52, 53, 63, 54, 55, 65, 56, 57, 67, 58, 59, 69, 70, 71, 81, 72, 73, 83, 74, 75, 85, 76, 77, 87, 78, 79, 89, 90, 91, 211, 6, 93, 213, 8, 95, 215, 2110, 97
Offset: 1

Views

Author

Eric Angelini, Aug 11 2024

Keywords

Examples

			a(7) = 4, a(8) = 9, a(9) = 101, a(10) = 10; terms follow the even/odd/odd pattern and so do their digits: 4/9/1 and 0/1/1.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice, repeat
    def c(s, i):
        return all(int(d)%2 == int((i+j)%3 > 0) for j, d in enumerate(s))
    def agen(): # generator of terms
        seen, s = set(), 0
        for n in count(0):
            eo = int(n%3 > 0)
            an = next(k for k in count(eo, 2) if k not in seen and c(str(k), s))
            yield an
            seen.add(an)
            s += len(str(an))
    print(list(islice(agen(), 99))) # Michael S. Branicky, Aug 11 2024