A383972 Smallest number m such that (m*(m + 1)/2)^2 is divisible by n.
1, 3, 2, 3, 4, 3, 6, 7, 2, 4, 10, 3, 12, 7, 5, 7, 16, 3, 18, 4, 6, 11, 22, 8, 4, 12, 8, 7, 28, 15, 30, 15, 11, 16, 14, 3, 36, 19, 12, 15, 40, 20, 42, 11, 5, 23, 46, 8, 6, 4, 17, 12, 52, 8, 10, 7, 18, 28, 58, 15, 60, 31, 6, 15, 25, 11, 66, 16, 23, 20, 70, 8, 72, 36, 5, 19, 21, 12, 78
Offset: 1
Keywords
Examples
n = 2: smallest m such that (m*(m + 1))^2 is divisible by 4*2 is m = 3. The first few numbers of the form (m*(m + 1))^2 / (4*n), m >= 1 are 1, 18, 3, 9, 20, 6, 63, ...
Programs
-
Maple
f:= proc(n) local x,R; R:= map(t -> rhs(op(t)), [msolve((x*(x+1))^2=0, 4*n)]); min(subs(0=4*n,R)) end proc: f(1):= 1: map(f, [$1..100]); # Robert Israel, May 18 2025
-
Mathematica
a[n_] := Module[{m = 1}, While[PowerMod[m*(m + 1)/2, 2, n] > 0, m++]; m]; Array[a, 100] (* Amiram Eldar, May 17 2025 *)
-
PARI
a(n) = my(m=1); while (Mod(m*(m+1)/2, n)^2, m++); m; \\ Michel Marcus, May 16 2025
Comments