login
A280054
Index of first occurrence of n in A280053, the nachos numbers based on squares.
3
1, 2, 3, 4, 9, 23, 53, 193, 1012, 11428, 414069, 89236803, 281079668014, 49673575524946259, 3690344289594918623401179, 2363083530686659576336864121757607550, 1210869542685904980187672572977511794639836071291151196
OFFSET
1,2
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<q(n), otherwise we must pick a larger n. In other words, r must be less than the interval between q(n-1) and q(n), that is r < q(n-1)-q(n) = n^2
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)
LINKS
CROSSREFS
Cf. A280053.
Sequence in context: A089243 A122534 A101135 * A088220 A333431 A085612
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jan 07 2017
EXTENSIONS
More terms from Lars Blomberg, Jan 08 2017
STATUS
approved