OFFSET
0,6
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,2,0,0,0,-1).
FORMULA
From Robert Israel, Sep 18 2025: (Start)
For n >= 2, [This depends on the definition used, cf. the comments in A373749 and the Sage implemention below. - Peter Luschny, Sep 18 2025]
a(n) = floor(n/2)^2 mod n.
a(4*n) = 0.
a(4*n+1) = 3*n + 1 for n >= 1.
a(4*n+2) = 2*n + 1.
a(4*n+3) = n + 1.
G.f.: (x + x^2 + x^3 + 2*x^5 + x^6)/(1 - 2*x^4 + x^8) - x. (End)
MAPLE
REM := (n, k) -> ifelse(k = 0, n, irem(n, k)):
T := n -> local k; seq(REM(k^2, n), k = 0..n):
seq(T(n)[iquo(n, 2) + 1], n = 0..73);
# Alternative:
0, 0, seq(floor(n/2)^2 mod n, n=2..100); # Robert Israel, Sep 17 2025
MATHEMATICA
A373750[n_] := If[n == 0, 0, Mod[Quotient[n, 2]^2, n]];
Array[A373750, 100, 0] (* Paolo Xausa, Sep 18 2025 *)
PROG
(SageMath)
def A373750(n): return mod((n//2)^2, n)
print([A373750(n) for n in range(74)]) # Peter Luschny, Sep 18 2025
CROSSREFS
KEYWORD
AUTHOR
Peter Luschny, Jun 23 2024
STATUS
approved
