A383075 Smallest number m such that m*(m + 1)*(2*m + 1)/6 is divisible by n.
1, 3, 4, 7, 2, 4, 3, 15, 13, 4, 5, 8, 6, 3, 4, 31, 8, 27, 9, 7, 13, 11, 11, 31, 12, 12, 40, 7, 14, 4, 15, 63, 22, 8, 7, 40, 18, 19, 13, 15, 20, 27, 21, 16, 27, 11, 23, 31, 24, 12, 8, 32, 26, 40, 5, 31, 9, 28, 29, 40, 30, 15, 13, 127, 12, 27, 33, 8, 22, 7, 35
Offset: 1
Keywords
Examples
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
Links
- David A. Corneth, Table of n, a(n) for n = 1..10000
- David A. Corneth, PARI program
Programs
-
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 *)
-
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
Comments