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.

Showing 1-5 of 5 results.

A280522 The number of restarts for the routine described by A280521.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 0, 1, 1, 2, 1, 0, 1, 1, 2, 1, 2, 2, 1, 0, 1, 1, 2, 1, 2, 2, 1, 2, 2, 3, 2, 1, 0, 1, 1, 2, 1, 2, 2, 1, 2, 2, 3, 2, 1, 2, 2, 3, 2, 3, 3, 2, 1, 0, 1, 1, 2, 1, 2, 2, 1, 2, 2, 3, 2, 1, 2, 2, 3, 2, 3, 3, 2, 1, 2, 2, 3, 2, 3, 3, 2, 3, 3, 4, 3, 2, 1
Offset: 1

Views

Author

Peter Kagey, Jan 04 2017

Keywords

Comments

This is simply one less than the number of stages, but is seems like an equally good measure, so it gets its own entry. - N. J. A. Sloane, Jan 27 2017

Crossrefs

Formula

a(n) = A280521(n) - 1.

A280053 "Nachos" sequence based on squares.

Original entry on oeis.org

1, 2, 3, 4, 1, 2, 3, 4, 5, 2, 3, 4, 5, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 2, 3, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 4, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 4, 5, 6, 7, 3, 4, 2, 3, 4, 5, 6, 3
Offset: 1

Views

Author

N. J. A. Sloane, Jan 07 2017

Keywords

Comments

The nachos sequence based on a sequence of positive numbers S starting with 1 is defined as follows: To find a(n) we start with a pile of n nachos.
During each phase, we successively remove S(1), then S(2), then S(3), ..., then S(i) nachos from the pile until fewer than S(i+1) remain. Then we start a new phase, successively removing S(1), then S(2), ..., then S(j) nachos from the pile until fewer than S(j+1) remain. Repeat. a(n) is the number of phases required to empty the pile.
Suggested by the Fibonachos sequence A280521, which is the case when S is 1,1,2,3,5,8,13,... (A000045).
If S = 1,2,3,4,5,... we get A057945.
If S = 1,2,3,5,7,11,... (A008578) we get A280055.
If S = triangular numbers we get A281367.
If S = squares we get the present sequence.
If S = powers of 2 we get A100661.
Needs a more professional Maple program.
Comment from Matthew C. Russell, Jan 30 2017 (Start):
Theorem: Any nachos sequence based on a sequence S = {1=s1 < s2 < s3 < ...} is unbounded.
Proof: S is the (infinite) set of numbers that we are allowed to subtract. (In the case of Fibonachos, this is the set of Fibonaccis themselves, not the partial sums.)
Suppose that n is a positive integer, with the number of stages of the process denoted by a(n).
Let s_m be the smallest element of S that is greater than n.
Then, if you start the process at N = n + s1 + s2 + s3 + ... + s_(m-1), you will get stuck when you hit n, and will have to start the process over again. Thus you will take a(n) + 1 stages of the process here, so a(N) = a(n) + 1.
(End)

Examples

			If n = 10, in the first phase we successively remove 1, then 4 nachos, leaving 5 in the pile. The next square is 9, which is bigger than 5, so we start a new phase. We remove 1, then 4 nachos, and now the pile is empty. There were two phases, so a(10)=2.
		

Crossrefs

For indices of first occurrences of 1,2,3,4,... see A280054.

Programs

  • Maple
    S:=[seq(i^2,i=1..1000)];
    phases := proc(n) global S; local a,h,i,j,ipass;
    a:=1; h:=n;
    for ipass from 1 to 100 do
       for i from 1 to 100 do
          j:=S[i];
          if j>h then a:=a+1; break; fi;
          h:=h-j;
          if h=0 then return(a); fi;
                           od;
    od;
    return(-1);
    end;
    t1:=[seq(phases(i),i=1..1000)];
    # 2nd program
    A280053 := proc(n)
        local a,nres,i ;
        a := 0 ;
        nres := n;
        while nres > 0 do
            for i from 1 do
                if A000330(i) > nres then
                    break;
                end if;
            end do:
            nres := nres-A000330(i-1) ;
            a := a+1 ;
        end do:
        a ;
    end proc:
    seq(A280053(n),n=1..80) ; # R. J. Mathar, Mar 05 2017
  • Mathematica
    A280053[n_] := Module[{a, nres, i}, a = 0; nres = n; While[nres > 0, For[i = 1, True, i++, If[i(i+1)(2i+1)/6 > nres, Break[]]]; nres = nres - i(i-1)(2i-1)/6; a++]; a];
    Table[A280053[n], {n, 1, 90}] (* Jean-François Alcover, Mar 16 2023, after R. J. Mathar *)

A280523 a(n) = Fibonacci(2n + 1) - n.

Original entry on oeis.org

1, 3, 10, 30, 84, 227, 603, 1589, 4172, 10936, 28646, 75013, 196405, 514215, 1346254, 3524562, 9227448, 24157799, 63245967, 165580121, 433494416, 1134903148, 2971215050, 7778742025, 20365011049, 53316291147, 139583862418
Offset: 1

Views

Author

Peter Kagey, Jan 04 2017

Keywords

Comments

Old (and equivalent) definition: these are the indices of records in the Fibonachos sequence A280521: the least k such that A280521(k) = n.
Conjecture: a(n) = A215004(2n - 2). - Peter Kagey. The conjecture is true. See link for analysis of connections with A215004 and A280521. - Nathan Fox, Jan 27 2017
Define the n-th Fibonacci compositions CF(n) by CF(1)={(1)}, CF(2)={(2)}, and CF(n) is 1 adjoined at the end of each composition in CF(n-1) union 2 adjoined to the end of each composition in CF(n-2). The union is disjoint, so |CF(n)| is the n-th Fibonacci number. Define the weight of a composition c by 2^(number of singletons in c). For example, 2122 has 1 singleton and weight 2. Let s(n) be the sum of the weights of CF(n). Conjecture: a(n)= s(2n+4)-s(2n+3). - George Beck, Jan 31 2020

Examples

			a(1) = 1    because A280521(1)    = 1;
a(2) = 3    because A280521(3)    = 2;
a(3) = 10   because A280521(10)   = 3;
a(4) = 30   because A280521(30)   = 4;
a(5) = 84   because A280521(84)   = 5;
a(6) = 227  because A280521(227)  = 6;
a(7) = 603  because A280521(603)  = 7;
a(8) = 1589 because A280521(1589) = 8.
		

Crossrefs

Programs

  • Mathematica
    Table[Fibonacci[2n + 1] - n, {n, 30}] (* Alonso del Arte, Jan 29 2017 *)
    LinearRecurrence[{5,-8,5,-1},{1,3,10,30},30] (* Harvey P. Dale, Feb 06 2024 *)
  • PARI
    F=vector(64,n,fibonacci(n+2)-1); \\ Resize as needed
    A280521(n)=my(s); while(n, s++; t=setsearch(F,n,1); if(t, n-=F[t-1], return(s))); s
    first(n)=my(v=vector(n),k,t,mn=1,gaps=n); while(gaps, t=A280521(k++); if(t>=mn && t<=n && v[t]==0, v[t]=k; while(mn<=n && v[mn], mn++); print("a("t") = "k); gaps--)); v \\ Charles R Greathouse IV, Jan 04 2017

Formula

G.f.: -x*(-1+2*x-3*x^2+x^3) / ( (x^2-3*x+1)*(x-1)^2 ). - R. J. Mathar, Mar 11 2017
a(n) = 5*a(n-1)-8*a(n-2)+5*a(n-3)-a(n-4). - Wesley Ivan Hurt, Apr 26 2021

Extensions

Corrected and extended by Charles R Greathouse IV, Jan 04 2017
a(26) from Charles R Greathouse IV, Jan 09 2017
a(27) from Charles R Greathouse IV, Jan 16 2017
Replaced old definition by simple formula established by Nathan Fox. - N. J. A. Sloane, Jan 30 2017

A281367 "Nachos" sequence based on triangular numbers.

Original entry on oeis.org

1, 2, 3, 1, 2, 3, 4, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 4, 5, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 2, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 2, 3, 4, 5, 3, 4, 5, 6, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 4, 5, 3, 4
Offset: 1

Views

Author

N. J. A. Sloane, Jan 30 2017

Keywords

Comments

The nachos sequence based on a sequence of positive numbers S starting with 1 is defined as follows: To find a(n) we start with a pile of n nachos.
During each phase, we successively remove S(1), then S(2), then S(3), ..., then S(i) nachos from the pile until fewer than S(i+1) remain. Then we start a new phase, successively removing S(1), then S(2), ..., then S(j) nachos from the pile until fewer than S(j+1) remain. Repeat. a(n) is the number of phases required to empty the pile.
Suggested by the Fibonachos sequence A280521, which is the case when S is 1,1,2,3,5,8,13,... (A000045).
If S = 1,2,3,4,5,... we get A057945.
If S = 1,2,3,5,7,11,... (A008578) we get A280055.
If S = triangular numbers we get the present sequence.
If S = squares we get A280053.
If S = powers of 2 we get A100661.
More than the usual number of terms are shown in order to distinguish this sequence from A104246.

Examples

			If n = 14, in the first phase we successively remove 1, then 3, then 6 nachos, leaving 4 in the pile. The next triangular number is 10, which is bigger than 4, so we start a new phase. We remove 1, then 3 nachos, and now the pile is empty. There were two phases, so a(14)=2.
		

Crossrefs

For indices of first occurrences of 1,2,3,4,... see A281368.
Different from A104246.

Programs

  • Maple
    S:=[seq(i*(i+1)/2,i=1..1000)];
    phases := proc(n) global S; local a,h,i,j,ipass;
    a:=1; h:=n;
    for ipass from 1 to 100 do
    for i from 1 to 100 do
    j:=S[i];
    if j>h then a:=a+1; break; fi;
    h:=h-j;
    if h=0 then return(a); fi;
    od;
    od;
    return(-1);
    end;
    t1:=[seq(phases(i),i=1..1000)];
    # 2nd program
    A281367 := proc(n)
        local a,nres,i ;
        a := 0 ;
        nres := n;
        while nres > 0 do
            for i from 1 do
                if A000292(i) > nres then
                    break;
                end if;
            end do:
            nres := nres-A000292(i-1) ;
            a := a+1 ;
        end do:
        a ;
    end proc:
    seq(A281367(n),n=1..80) ; # R. J. Mathar, Mar 05 2017
  • Mathematica
    tri[n_] := n (n + 1) (n + 2)/6;
    A281367[n_] := Module[{a = 0, nres = n, i}, While[nres > 0, For[i = 1, True, i++, If[tri[i] > nres, Break[]]]; nres -= tri[i-1]; a++]; a];
    Table[A281367[n], {n, 1, 99}] (* Jean-François Alcover, Apr 11 2024, after R. J. Mathar *)

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
    ];
Showing 1-5 of 5 results.