cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A383075 Smallest number m such that m*(m + 1)*(2*m + 1)/6 is divisible by n.

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, Apr 15 2025

Keywords

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

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
		

Crossrefs

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