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.

A343995 Smallest m > 0 such that the triangular number m*(m+1)/2 is divisible by 2^n-1.

Original entry on oeis.org

1, 2, 6, 5, 30, 27, 126, 50, 146, 186, 712, 90, 8190, 2666, 3472, 6425, 131070, 37449, 524286, 95325, 547624, 700074, 2677214, 184365, 540299, 11180714, 12870192, 8956040, 66682968, 349866, 2147483646, 210570380, 407645720, 2863377066, 483939976, 509033160, 56701272284, 45812722346
Offset: 1

Views

Author

N. J. A. Sloane, May 30 2021

Keywords

Comments

a(n) = A011772(2^n-1).
For n >= 2, a(n) <= 2^n-2, with equality if 2^n-1 is a prime (Cf. A000043).

Examples

			a(6) = 27 as the triangular number 27*(27 + 1)/2 = 378 is divisible by 2^6-1 = 63. - _David A. Corneth_, May 30 2021
		

Crossrefs

Programs

  • Mathematica
    Table[Min[Most[m /. Solve[{(m*(m + 1)) == c*(2^(n + 1) - 2), c > 0, m > 0}, Integers] /. C[1] -> 0]], {n, 1, 50}] (* Vaclav Kotesovec, May 30 2021 *)
  • PARI
    a(n) = { my(d = divisors((2^n-1)*2)); res = oo; for(i = 1, (#d + 1)\2, if(gcd(d[i], d[#d + 1 - i])==1, c = lift(chinese(Mod(-1, d[i]), Mod(0, d[#d + 1 - i]))); process(c); c = lift(chinese(Mod(0, d[i]), Mod(-1, d[#d + 1 - i]))); process(c))); res}
    process(c) = { if(c < res, if(c > 0, res = c))} \\ David A. Corneth, May 30 2021
    
  • Python
    from sympy.ntheory.modular import crt
    from sympy import factorint
    from itertools import product
    def A343995(n):
        plist = [p**q for p, q in factorint(2*(2**n-1)).items()]
        return min(k for k in (crt(plist,d)[0] for d in product([0,-1],repeat=len(plist))) if k > 0) # Chai Wah Wu, May 30 2021