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.

A382814 Number of nachos that the first player gets when playing the "Fibonachos" game starting with n nachos.

Original entry on oeis.org

1, 1, 2, 3, 3, 4, 3, 4, 4, 5, 6, 8, 8, 9, 9, 9, 10, 10, 12, 8, 9, 9, 10, 11, 11, 12, 11, 12, 12, 13, 14, 16, 21, 21, 22, 22, 22, 23, 23, 25, 25, 26, 26, 26, 25, 26, 26, 27, 28, 28, 29, 28, 33, 21, 22, 22, 23, 24, 24, 25, 24, 25, 25, 26, 27, 29, 29, 30, 30, 30
Offset: 1

Views

Author

Peter Kagey, Apr 05 2025

Keywords

Comments

From the Fibonachos link: "Two people are sharing a plate of nachos. They take turns dividing the nachos, each taking the n-th Fibonacci number of nachos on the n-th turn. When the number of nachos left is less than the next Fibonacci number, they start the sequence over. What number of nachos (less than 500) requires the most number of restarts? How would you generate numbers of nachos with a high number of restarts?"
The first ten terms of the sequence are the following:
a(1) = 1 via [[1]];
a(2) = 1 via [[1, 1]];
a(3) = 1 + 1 = 2 via [[1, 1], [1]];
a(4) = 1 + 2 = 3 via [[1, 1, 2]];
a(5) = 1 + 2 = 3 via [[1, 1, 2], [1]];
a(6) = 1 + 2 + 1 = 4 via [[1, 1, 2], [1, 1]];
a(7) = 1 + 2 = 3 via [[1, 1, 2, 3]];
a(8) = 1 + 2 + 1 = 4 via [[1, 1, 2, 3], [1]];
a(9) = 1 + 2 + 1 = 4 via [[1, 1, 2, 3], [1, 1]]; and
a(10) = 1 + 2 + 1 + 1 = 5 via [[1, 1, 2, 3], [1, 1], [1]].
Conjecture:
a(n) = n/2 if and only if n is in {2, 8, 10, 32}.
Conjecture:
For n > 32, a(n) > n/2 if and only if F(m)-1 <= n <= F(m+1)-2 for some odd integer m, where F(n) = A000045(n).

Crossrefs

Programs

  • Mathematica
    A382814[n_] := Module[{m = n, i = 1, p = True, c = 0},
       While[m > 0,
          If[Fibonacci[i] > m, i = 1];
          If[p, c += Fibonacci[i]];
          m -= Fibonacci[i]; i += 1; p = Not[p];
       ];
       c
    ];