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.

A358431 a(0) = 1; a(n+1) = 1 if a(n) > n, otherwise a(n+1) = a(n) + a(a(n)).

Original entry on oeis.org

1, 1, 2, 4, 1, 2, 4, 5, 7, 12, 1, 2, 4, 5, 7, 12, 16, 32, 1, 2, 4, 5, 7, 12, 16, 32, 1, 2, 4, 5, 7, 12, 16, 32, 48, 1, 2, 4, 5, 7, 12, 16, 32, 48, 1, 2, 4, 5, 7, 12, 16, 32, 48, 55, 1, 2, 4, 5, 7, 12, 16, 32, 48, 55, 57, 62, 110, 1, 2, 4, 5, 7, 12, 16, 32, 48, 55, 57, 62, 110
Offset: 0

Views

Author

Aidan Clarke, Nov 15 2022

Keywords

Crossrefs

Cf. A062039.

Programs

  • Mathematica
    a[0] = 1; a[n_] := a[n] = If[a[n - 1] > n - 1, 1, a[n - 1] + a[a[n - 1]]]; Array[a, 80, 0] (* Amiram Eldar, Dec 06 2022 *)
  • Python
    from functools import cache
    @cache
    def a(n): return 1 if n==0 else (1 if a(n-1) > n-1 else a(n-1) + a(a(n-1)))
    print([a(n) for n in range(76)]) # Michael S. Branicky, Nov 15 2022