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.

This page as a plain text file.
%I A343995 #39 Jun 02 2021 14:04:01
%S A343995 1,2,6,5,30,27,126,50,146,186,712,90,8190,2666,3472,6425,131070,37449,
%T A343995 524286,95325,547624,700074,2677214,184365,540299,11180714,12870192,
%U A343995 8956040,66682968,349866,2147483646,210570380,407645720,2863377066,483939976,509033160,56701272284,45812722346
%N A343995 Smallest m > 0 such that the triangular number m*(m+1)/2 is divisible by 2^n-1.
%C A343995 a(n) = A011772(2^n-1).
%C A343995 For n >= 2, a(n) <= 2^n-2, with equality if 2^n-1 is a prime (Cf. A000043).
%H A343995 Michael S. Branicky, <a href="/A343995/b343995.txt">Table of n, a(n) for n = 1..419</a> (terms 1..253 from David A. Corneth)
%e A343995 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
%t A343995 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 *)
%o A343995 (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}
%o A343995 process(c) = { if(c < res, if(c > 0, res = c))} \\ _David A. Corneth_, May 30 2021
%o A343995 (Python)
%o A343995 from sympy.ntheory.modular import crt
%o A343995 from sympy import factorint
%o A343995 from itertools import product
%o A343995 def A343995(n):
%o A343995     plist = [p**q for p, q in factorint(2*(2**n-1)).items()]
%o A343995     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
%Y A343995 Cf. A000043, A000217, A011772.
%K A343995 nonn
%O A343995 1,2
%A A343995 _N. J. A. Sloane_, May 30 2021