OFFSET
1,3
COMMENTS
a(1) = 0. a(n) is the smallest positive integer > a(n-1) such that Sum_{m = 1..n-1} (a(m+1)-a(m))*a(m) is a perfect square.
LINKS
David A. Corneth, Table of n, a(n) for n = 1..1018
David A. Corneth, PARI program
EXAMPLE
The first 6 terms of A386369 are 0, 1, 2, 2, 2, 2 which has partial sum 9. We have A386369(7) = 6. To find a(4) we look for the next term in A386369 that is larger than 6 i.e. solve 6*(k-6) + 9 = s^2 for some k. Rewrite gives 6*(k-6) = s^2 - 9 = (s-3)(s + 3). So we have 4 cases:
1 | s - 3, 6 | s + 3
2 | s - 3, 3 | s + 3
3 | s - 3, 2 | s + 3
6 | s - 3, 1 | s + 3
Solving for smallest t > 6 gives s = 9. So 6*(k-6) = 9^2 - 9 = 72 and so k = 18.
MATHEMATICA
Module[{s = 0, a = 0}, Table[If[IntegerQ[Sqrt[s += a]], a = k-1, Nothing], {k, 10^5}]]
PROG
(PARI) \\ See Corneth link
CROSSREFS
KEYWORD
nonn
AUTHOR
David A. Corneth and Paolo Xausa, Jul 29 2025
EXTENSIONS
More terms from Michael De Vlieger, Jul 29 2025
STATUS
approved
