login
A385254
Distinct terms in A386369.
2
0, 1, 2, 6, 18, 26, 70, 82, 222, 642, 1902, 5682, 17022, 51042, 59778, 59958, 77774, 107258, 268870, 285010, 361086, 930666, 1084314, 1498134, 3813282, 5053994, 13240150, 14183598, 15487758, 15579122, 18418666, 18622506, 23809998, 58728474, 64572254, 65013058
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, 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
Cf. A386369.
Sequence in context: A032649 A237989 A185382 * A257065 A066286 A324541
KEYWORD
nonn
AUTHOR
David A. Corneth and Paolo Xausa, Jul 29 2025
EXTENSIONS
More terms from Michael De Vlieger, Jul 29 2025
STATUS
approved