OFFSET
0,3
COMMENTS
The shortest arithmetic sequence with initial term n and difference 1 that sums to p^2, p prime number. 2*(n - 1) >= a(n) >= -1.
FORMULA
a(p^2) = 0, p prime number.
EXAMPLE
n = 2: 2 + 3 + 4 = 9 = 3^2, a(2) = 2.
n = 3: 3 + 4 + 5 + 6 + 7 = 5^2, a(3) = 4.
n = 4: 4 = 2^2, a(4) = 0.
CROSSREFS
KEYWORD
sign
AUTHOR
Ctibor O. Zizka, Jul 05 2023
STATUS
approved