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.

A280054 Index of first occurrence of n in A280053, the nachos numbers based on squares.

Original entry on oeis.org

1, 2, 3, 4, 9, 23, 53, 193, 1012, 11428, 414069, 89236803, 281079668014, 49673575524946259, 3690344289594918623401179, 2363083530686659576336864121757607550, 1210869542685904980187672572977511794639836071291151196
Offset: 1

Views

Author

N. J. A. Sloane, Jan 07 2017

Keywords

Comments

Analysis from Lars Blomberg, Jan 08 2017 (Start)
Consider the sequence of sums of squares, q(n), n=1,2,3,... (A000330):
1, 5, 14, 30, 55, 91, 140, 204, 285, 385, 506, 650, 819, 1015, 1240, 1496, ...
which has formula q(n) = n*(n+1)*(2*n+1)/6.
The term A280053(x) can be computed by repeatedly subtracting the largest q(n)<=x from x until 0 is reached. For example, 8 = 5+1+1+1, so A280053(8)=4
Note that A280054 is strictly increasing. Let r be the last term so far in A280054, and s the next term. We must find the smallest term in q such that s-q(n-1) = r, or s=q(n-1)+r. Therefore s will have one more phase than r, and it will be the smallest possible s.
We also require that s
Calculate n=floor(sqrt(r))+1 and from this we get s=q(n-1)+r.
Note that the q sequence need not be explicitly calculated and stored.
Examples:
r.........n....q(n-1).......q(n)........s..phases
4.........3.........5........14.........9.......5
9.........4........14........30........23.......6
23........5........30........55........53.......7
53........8.......140.......204.......193.......8
193......14.......819......1015......1012.......9
1012.....32.....10416.....11440.....11428......10
11428...107....402641....414090....414069......11
414069..644..88822734..89237470..89236803......12
...
The above values were confirmed by direct calculation.
(End)

Crossrefs

Cf. A280053.

Extensions

More terms from Lars Blomberg, Jan 08 2017

A280521 From the "Fibonachos" game: Number of phases of the following routine: during each phase, the player removes objects from a pile of n objects as the Fibonacci sequence until the pile contains fewer objects than the next Fibonacci number. The phases continue until the pile is empty.

Original entry on oeis.org

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, 2, 2, 3, 2, 3, 3, 2, 3, 3, 4, 3, 2, 3, 3, 4, 3, 4, 4, 3, 2, 1, 2, 2, 3, 2, 3, 3, 2, 3, 3, 4, 3, 2, 3, 3, 4, 3, 4, 4, 3, 2, 3, 3, 4, 3, 4, 4, 3, 4, 4, 5, 4, 3, 2
Offset: 1

Author

Peter Kagey, Jan 04 2017

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?"
Ones appear at indices in A000071.
Also the number of iterations of A066628(n + 1) required to reach 0.

Examples

			a(1) = 1 via [[1]];
a(2) = 1 via [[1, 1]];
a(3) = 2 via [[1, 1], [1]];
a(4) = 1 via [[1, 1, 2]];
a(5) = 2 via [[1, 1, 2], [1]];
a(6) = 2 via [[1, 1, 2], [1, 1]];
a(7) = 1 via [[1, 1, 2, 3]];
a(8) = 2 via [[1, 1, 2, 3], [1]];
a(9) = 2 via [[1, 1, 2, 3], [1, 1]];
a(10) = 3 via [[1, 1, 2, 3], [1, 1], [1]];
An example of counting iterations of A066628(n + 1) to reach zero:
a(10) = 3 because A066628(A066628(A066628(10 + 1) + 1) + 1) = 0. Fewer iterations fails to reach zero.
		

Crossrefs

Cf. A000045, A000071, A066628, A280523 (records).
See A280053 for other sequences based on this construction. - N. J. A. Sloane, Jan 07 2017

Programs

  • Maple
    A280521 := proc(n)
        local a,nres,i ;
        a := 0 ;
        nres := n;
        while nres > 0 do
            for i from 1 do
                if A000071(i) > nres then
                    break;
                end if;
            end do:
            nres := nres-A000071(i-1) ;
            a := a+1 ;
        end do:
        a ;
    end proc:
    seq(A280521(n),n=1..80) ; # R. J. Mathar, Mar 05 2017
  • PARI
    a(n)=my(s); while(n, my(k,t); while((t=fibonacci(k++))<=n, n-=t); s++); s \\ Charles R Greathouse IV, Jan 04 2017

A280055 Nachos sequence based on 1 plus primes (A008578).

Original entry on oeis.org

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

Author

N. J. A. Sloane, Jan 08 2017

Keywords

Comments

Like A280053 but based on 1,2,3,5,7,11,... rather than squares. See that entry for further information.
Equivalently, greedily subtract terms of A014284 from n until reaching 0; a(n) = number of steps required.

Examples

			26 takes 4 phases to read 0:
subtract leaves
1   25
2   23
3   20
5   15
7   8
------
1   7
2   5
3   2
------
1   1
------
1   0
so a(26) = 4
		

Crossrefs

For records see A280760.

Programs

  • Maple
    A280055 := proc(n)
        local a,nres,i ;
        a := 0 ;
        nres := n;
        while nres > 0 do
            for i from 1 do
                if A014284(i) > nres then
                    break;
                end if;
            end do:
            nres := nres-A014284(i-1) ;
            a := a+1 ;
        end do:
        a ;
    end proc:
    seq(A280055(n),n=1..80) ; # R. J. Mathar, Mar 05 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

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 *)

A281368 Index of first appearance of n in the triangular-based nachos numbers A281367.

Original entry on oeis.org

1, 2, 3, 7, 17, 52, 217, 1757, 35977, 3244071, 2757063867, 68246203026923, 265773420092483210413, 2042495276699414186047172525299, 1376053548027595532701211092865247287361883459, 24062832323766390460579042386921003503968575947499150009246321293279
Offset: 1

Author

N. J. A. Sloane, Jan 30 2017

Keywords

Comments

Using a similar computation as in A280054. - Lars Blomberg, Jan 31 2017

Crossrefs

Extensions

More terms from Lars Blomberg, Jan 31 2017
Showing 1-5 of 5 results.