VOOZH about

URL: https://oeis.org/A392677

⇱ A392677 - OEIS


login
A392677
a(n) = Sum_{i=1..n} i^2*(-1)^ceiling(sqrt(i)).
1
-1, 3, 12, 28, 3, -33, -82, -146, -227, -127, -6, 138, 307, 503, 728, 984, 695, 371, 10, -390, -831, -1315, -1844, -2420, -3045, -2369, -1640, -856, -15, 885, 1846, 2870, 3959, 5115, 6340, 7636, 6267, 4823, 3302, 1702, 21, -1743, -3592, -5528, -7553, -9669, -11878, -14182, -16583, -14083
OFFSET
1,2
COMMENTS
If n is of the form k^2+k-1 where k is some positive integer then abs(a(n)) is a triangular number (A000217).
MATHEMATICA
a[n_]:=Sum[i^2*(-1)^Ceiling[Sqrt[i]], {i, n}]; Array[a, 50] (* Stefano Spezia, Jan 19 2026 *)
PROG
(PARI) a(n) = sum(i=1, n, if (ceil(sqrt(i)) % 2, -i^2, i^2)); \\ Michel Marcus, Jan 19 2026
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Dwight Boddorf, Jan 19 2026
STATUS
approved