A280053 "Nachos" sequence based on squares.
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
Keywords
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.
Links
- Lars Blomberg, Table of n, a(n) for n = 1..10000
- Reddit user Teblefer, Fibonachos
Crossrefs
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 *)
Comments