A280054 Index of first occurrence of n in A280053, the nachos numbers based on squares.
1, 2, 3, 4, 9, 23, 53, 193, 1012, 11428, 414069, 89236803, 281079668014, 49673575524946259, 3690344289594918623401179, 2363083530686659576336864121757607550, 1210869542685904980187672572977511794639836071291151196
Offset: 1
Keywords
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.
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
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.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
- N. J. A. Sloane, Winter Fruits: New Problems from OEIS. (Sequence mentioned from 12:50-19:50.)
- Reddit user Teblefer, Fibonachos
Crossrefs
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).
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
Keywords
Comments
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
Links
- Lars Blomberg, Table of n, a(n) for n = 1..10000
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.
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
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 = 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.
Links
- Lars Blomberg, Table of n, a(n) for n = 1..10000
- Reddit user Teblefer, Fibonachos
Crossrefs
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.
1, 2, 3, 7, 17, 52, 217, 1757, 35977, 3244071, 2757063867, 68246203026923, 265773420092483210413, 2042495276699414186047172525299, 1376053548027595532701211092865247287361883459, 24062832323766390460579042386921003503968575947499150009246321293279
Offset: 1
Keywords
Comments
Using a similar computation as in A280054. - Lars Blomberg, Jan 31 2017
Links
- Lars Blomberg, Table of n, a(n) for n = 1..22
Extensions
More terms from Lars Blomberg, Jan 31 2017
Comments
Links
Crossrefs
Extensions