OFFSET
1,8
COMMENTS
Number of solutions, (s,t,k), to s^2 + t^2 = k*n such that s + t = n, 1 <= s <= t and 1 <= k <= n-1. - Wesley Ivan Hurt, Oct 01 2020
LINKS
FORMULA
a(n) = Sum_{i=1..floor(n/2)} (1 - ceiling(2*i*(n-i)/n) + floor(2*i*(n-i)/n)).
a(n) = Sum_{i=1..floor(n/2)} Sum_{k=1..n-1} [i^2 + (n-i)^2 = n*k], where [ ] is the Iverson bracket. - Wesley Ivan Hurt, Oct 01 2020
MATHEMATICA
Table[Sum[1 - Ceiling[2*i*(n - i)/n] + Floor[2*i*(n - i)/n], {i, Floor[n/2]}], {n, 100}]
Table[Sum[Sum[KroneckerDelta[(i^2 + (n - i)^2)/k, n], {k, n - 1}], {i, Floor[n/2]}], {n, 100}]
PROG
(PARI) A337101(n) = { my(u, t); sum(s=1, n\2, t = n-s; u = (s^2 + t^2); (!(u%n) && (u/n) <= n-1)); }; \\ Antti Karttunen, Dec 12 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Aug 15 2020
STATUS
approved