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.

A344949 a(n) is the smallest square s > 0 such that s*(2n+1) is a triangular number.

This page as a plain text file.
%I A344949 #35 Jun 21 2021 15:09:10
%S A344949 1,1,9,4,4,441,25,1,9,9,1,3218436,49,1089,1656369,16,16,225,46225,9,
%T A344949 81,314721,1,12217323024,25,25,2427192623025,1,2304,199572129,121,400,
%U A344949 81225,39727809,4,36,36,4,736164,94864,592900,4357032433168041,169,3025,3600,1
%N A344949 a(n) is the smallest square s > 0 such that s*(2n+1) is a triangular number.
%C A344949 Proof that every odd natural number 2n+1 is a triangular number divided by a square. As the number 4n + 2 is never a square, Pell's equation x^2 - (4n+2)*y^2 = 1 has solutions in integers with y != 0 for every n. It is immediate that x has to be odd. We replace x = 2b+1 and we observe that y must be then even. We replace y = 2a and it follows that b(b+1)/2 = (2n+1)*a^2. So (2n+1) is a triangular number divided by a square. Of course, for given n, there are infinitely many such pairs (b,a).
%t A344949 Table[k=1;While[!IntegerQ[Sqrt[8k^2(2n+1)+1]],k++];k^2,{n,0,22}] (* _Giorgos Kalogeropoulos_, Jun 03 2021 *)
%o A344949 (C#)
%o A344949 static BigInteger a(int n)
%o A344949         {
%o A344949             // The next lines solve the Pell equation x^2 - D y^2 = 1
%o A344949             int D = 4 * n + 2;
%o A344949             BigInteger num = 0;
%o A344949             BigInteger den = 0;
%o A344949             if (n < 0)
%o A344949                 return 0;
%o A344949             BigInteger limit = (int)Math.Sqrt(D);
%o A344949             BigInteger m = 0;
%o A344949             BigInteger d = 1;
%o A344949             BigInteger a = limit;
%o A344949             BigInteger numm1 = 1;
%o A344949             num = a;
%o A344949             BigInteger denm1 = 0;
%o A344949             den = 1;
%o A344949             while (num * num - D * den * den != 1)
%o A344949             {
%o A344949                 m = d * a - m;
%o A344949                 d = (D - m * m) / d;
%o A344949                 a = (limit + m) / d;
%o A344949                 BigInteger numm2 = numm1;
%o A344949                 numm1 = num;
%o A344949                 BigInteger denm2 = denm1;
%o A344949                 denm1 = den;
%o A344949                 num = a * numm1 + numm2;
%o A344949                 den = a * denm1 + denm2;
%o A344949             }
%o A344949             // The list square is computed
%o A344949             BigInteger square = (den * den) / 4;
%o A344949             return square;
%o A344949         }
%o A344949 (PARI) a(n) = my(k=1); while (!ispolygonal(k^2*(2*n+1), 3), k++); k^2; \\ _Michel Marcus_, Jun 06 2021
%o A344949 (Python)
%o A344949 from sympy.solvers.diophantine.diophantine import diop_DN
%o A344949 def A344949(n): return min(d[1]**2 for d in diop_DN(4*n+2, 1))//4 # _Chai Wah Wu_, Jun 21 2021
%Y A344949 Cf. A000217, A000290, A061782.
%K A344949 nonn
%O A344949 0,3
%A A344949 _Mihai Prunescu_, Jun 03 2021