login
A373750
Middle terms of A373749.
2
0, 0, 1, 1, 0, 4, 3, 2, 0, 7, 5, 3, 0, 10, 7, 4, 0, 13, 9, 5, 0, 16, 11, 6, 0, 19, 13, 7, 0, 22, 15, 8, 0, 25, 17, 9, 0, 28, 19, 10, 0, 31, 21, 11, 0, 34, 23, 12, 0, 37, 25, 13, 0, 40, 27, 14, 0, 43, 29, 15, 0, 46, 31, 16, 0, 49, 33, 17, 0, 52, 35, 18, 0, 55
OFFSET
0,6
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
Cf. A373749.
Sequence in context: A258692 A067018 A200233 * A350493 A327351 A239475
KEYWORD
nonn,look,easy
AUTHOR
Peter Luschny, Jun 23 2024
STATUS
approved