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.

A309416 a(n) = Sum_{k > 0} d^k(n), where d^k corresponds to the k-th iterate of A296239.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 2, 2, 1, 0, 1, 2, 3, 5, 3, 2, 1, 0, 1, 2, 3, 5, 5, 7, 7, 5, 5, 3, 2, 1, 0, 1, 2, 3, 5, 5, 7, 8, 8, 10, 12, 12, 10, 8, 8, 7, 5, 5, 3, 2, 1, 0, 1, 2, 3, 5, 5, 7, 8, 8, 10, 12, 13, 13, 13, 15, 17, 19, 22, 19, 17, 15, 13, 13, 13, 12
Offset: 0

Views

Author

Rémy Sigrist, Jul 30 2019

Keywords

Comments

Iterating A296239 from any nonnegative number always leads to the fixed point 0, hence the series in the name has only finitely many nonzero terms and is well defined.

Examples

			For n = 1024:
- A296239(1024) = 37,
- A296239(37) = 3,
- A296239(3) = 0,
- hence a(1024) = 37 + 3 = 40.
		

Crossrefs

Programs

  • PARI
    A296239(n) = for (i=1, oo, if (n<=fibonacci(i), return (min(n-fibonacci(i-1), fibonacci(i)-n))))
    a(n) = my (v=0); while (n=A296239(n), v+=n); return (v)

Formula

a(n) = 0 iff n is a Fibonacci number.