A343995 Smallest m > 0 such that the triangular number m*(m+1)/2 is divisible by 2^n-1.
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
Keywords
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
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..419 (terms 1..253 from David A. Corneth)
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
Comments