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.

A147665 a(n) = a(a(n - 1)) + r(n) for n >= 3, where r(3*k) = a(a(k)), r(3*k+1) = a(a(k)) and r(3*k+2) = a(n-a(k)), with a(0) = 0 and a(1) = a(2) = 1.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 3, 3, 5, 4, 3, 6, 4, 3, 6, 5, 5, 9, 6, 5, 12, 6, 5, 15, 8, 8, 11, 8, 7, 11, 8, 7, 14, 9, 7, 14, 8, 7, 10, 5, 5, 13, 6, 6, 13, 6, 6, 9, 7, 6, 9, 8, 9, 17, 12, 7, 12, 7, 6, 15, 9, 8, 14, 9, 7, 18, 9, 7, 12, 9, 9, 16, 10, 8, 14, 11, 11, 15, 11, 12, 13, 8, 10, 14, 9, 7, 15, 11, 12, 15
Offset: 0

Views

Author

Roger L. Bagula, Nov 09 2008

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:= a[n]= If[n<3, Floor[(n+1)/2], a[a[n-1]] + If[Mod[n, 3]<2, a[a[Floor[n/3]]], a[n - a[Floor[n/3]]]]];
    Table[f[n], {n, 0, 100}]
  • Python
    def A147665(n):
        if n <= 2: return [0, 1, 1][n]
        elif n % 3 <= 1: return A147665(A147665(n-1)) + A147665(A147665(n//3))
        else: return A147665(A147665(n-1)) + A147665(n - A147665(n//3))
    print([A147665(n) for n in range(100)]) # Oct 18 2009

Formula

a(n) = a(a(n - 1)) + r(n) for n >= 3, where r(3*k) = a(a(k)), r(3*k+1) = a(a(k)) and r(3*k+2) = a(n-a(k)), with a(0) = 0 and a(1) = a(2) = 1.

Extensions

Applied OEIS standards to nomenclature - The Assoc. Editors of the OEIS, Oct 18 2009
Name edited by Petros Hadjicostas, Apr 11 2020