login
A277516
a(n) = smallest k >= 0 for which there is a sequence n = b_1 < b_2 < ... < b_t = n + k such that b_1 + b_2 +...+ b_t is a perfect square.
1
0, 0, 2, 3, 0, 5, 4, 2, 6, 0, 4, 2, 1, 5, 4, 3, 0, 2, 4, 4, 3, 6, 5, 3, 1, 0, 2, 6, 4, 6, 4, 2, 3, 5, 4, 5, 0, 5, 4, 3, 1, 7, 6, 4, 7, 5, 4, 2, 4, 0, 7, 6, 7, 6, 4, 3, 7, 6, 5, 3, 1, 5, 4, 4, 0, 8, 7, 8, 7, 6, 4, 2, 5, 4, 2, 8, 7, 6, 4, 4, 9, 0, 5, 3, 1, 6, 5
OFFSET
0,3
COMMENTS
Records occur at n = 1, 2, 3, 5, 8, 41, 65, 80, 90, 183, 292, 467, 627, 1428, 1547, 1666, 1999, 3568, 4012, 5737, 7458, 12119, 13640, 14365, 21859, 28445, 37408, 38839, 40763, 50346, 50347, 92063, ...
FORMULA
a(n) = A277278(n) - n.
EXAMPLE
a(1) = 0 via 1 = 1^2;
a(2) = 2 via 2 + (2+1) + (2+2) = 3^2;
a(6) = 4 via 6 + (6+4) = 4^2.
PROG
(Haskell)
a277516 n = a277278 n - n
CROSSREFS
Cf. A277278.
Sequence in context: A354365 A066913 A090303 * A322333 A346615 A240667
KEYWORD
nonn,easy
AUTHOR
Peter Kagey, Oct 19 2016
STATUS
approved