OFFSET
1,2
COMMENTS
m*(m + 1)*(2*m + 1)/6 is divisible by n if and only if m*(m + 1)*(2*m + 1) is divisible by 6*n. - David A. Corneth, Apr 21 2025
If n > 3 is a prime of the form (8*k + 3), then a(2*n) = n. - Ctibor O. Zizka, May 21 2025
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
David A. Corneth, PARI program
EXAMPLE
n = 2: smallest m such that m*(m + 1)*(2*m + 1) is divisible by 2*6 is m = 3.
a(4) = 7. The first few numbers of the form m*(m + 1)*(2*m + 1)/6, m >= 1 are 1, 5, 14, 30, 55, 91, 140,... The first 6 are not divisible by 4 but the seventh is. - David A. Corneth, Apr 21 2025
MATHEMATICA
a[n_]:=Module[{m=1}, While[!Divisible[m(m+1)(2m+1)/6, n], m++]; m]; Array[a, 71] (* Stefano Spezia, Apr 15 2025 *)
PROG
(PARI) a(n) = my(m=1); while (m*(m+1)*(2*m+1)/6 % n, m++); m; \\ Michel Marcus, Apr 20 2025
(PARI) \\ See Corneth link
(Python)
from itertools import count
from sympy import integer_nthroot
def A383075(n): return next(m for m in count(integer_nthroot(3*n, 3)[0]) if not m*(m+1)*((m<<1)+1)%(6*n)) # Chai Wah Wu, Apr 21 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Apr 15 2025
STATUS
approved
