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.

A079668 Start with 1; at n-th step, write down what is in the sequence so far.

Original entry on oeis.org

1, 1, 1, 3, 1, 4, 1, 0, 2, 1, 3, 1, 0, 6, 1, 1, 2, 2, 3, 1, 4, 2, 0, 10, 1, 3, 2, 3, 3, 2, 4, 0, 5, 1, 6, 4, 0, 12, 1, 6, 2, 6, 3, 3, 4, 1, 5, 2, 6, 0, 7, 0, 8, 0, 9, 1, 10, 8, 0, 15, 1, 8, 2, 8, 3, 5, 4, 2, 5, 5, 6, 1, 7, 1, 8, 1, 9, 2, 10, 0, 11, 1, 12, 10
Offset: 1

Views

Author

N. J. A. Sloane Jan 26 2003

Keywords

Comments

After 1 1 1 3 1, we see "4 1's, 0 2's and 1 3", so next terms are 4 1 0 2 3 1.

Examples

			Row n lists all terms written at the n-th step:
  1;
  1, 1;
  3, 1;
  4, 1,  0, 2, 1, 3;
  1, 0,  6, 1, 1, 2, 2, 3, 1, 4;
  2, 0, 10, 1, 3, 2, 3, 3, 2, 4, 0, 5, 1, 6;
  4, 0, 12, 1, 6, 2, 6, 3, 3, 4, 1, 5, 2, 6, 0, 7, 0, 8, 0, 9, 1, 10;
  ...
		

Crossrefs

For other versions see A051120, A055186, A079686.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<1, 0, b(n-1)+add(x^i, i=T(n))) end:
    T:= proc(n) option remember; `if`(n=1, 1, (p->
          seq([coeff(p, x, i), i][], i=ldegree(p)..degree(p)))(b(n-1)))
        end:
    seq(T(n), n=1..10);  # Alois P. Heinz, Aug 24 2025
  • Mathematica
    s={1}; Do[s=Flatten[{s,{Count[s,#],#}&/@Range[Min[s],Max[s]]}],{20}];s (* Peter J. C. Moses, Mar 21 2013 *)
  • Python
    from itertools import islice
    def agen(): # generator of terms
        a = [1]
        yield 1
        while True:
            counts = []
            for d in range(min(a), max(a)+1):
                c = a.count(d)
                counts.extend([c, d])
            a += counts
            yield from counts
    print(list(islice(agen(), 84))) # Michael S. Branicky, Aug 24 2025

Extensions

More terms from Sean A. Irvine, Aug 24 2025