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.

A239970 Least positive k such that triangular(k) + triangular(n+k) is a triangular number (A000217).

This page as a plain text file.
%I A239970 #22 Nov 11 2024 16:38:00
%S A239970 2,5,3,6,9,4,15,18,21,5,27,30,9,36,6,42,10,48,51,14,7,60,63,15,69,72,
%T A239970 19,8,81,26,20,13,17,24,99,9,105,14,111,114,29,120,123,126,10,132,135,
%U A239970 34,20,144,147,35,153,45,11,29,165,33,17,174,30,44,183,186,189,12,18,23
%N A239970 Least positive k such that triangular(k) + triangular(n+k) is a triangular number (A000217).
%C A239970 a(n) <= 3*n-3, because triangular(3*n-3) + triangular(4*n-3) = triangular(5*n-4).
%C A239970 In other words, smallest k>0 such that 8*k^2 + 4*(2*k + 1)*n + 4*n^2 + 8*k + 1 = m^2 has an integer solution. - _Ralf Stephan_, Apr 01 2014
%H A239970 Reinhard Zumkeller, <a href="/A239970/b239970.txt">Table of n, a(n) for n = 0..1000</a>
%e A239970 n=5: the smallest solution k>0 to 8*k^2 + 64*k + 225 = m^2 is k=4, so a(5)=4.
%t A239970 tr[n_]:=(n(n+1))/2;lpk[n_]:=Module[{k=1},While[!OddQ[Sqrt[8(tr[k]+tr[n+k])+1]],k++];k]; Array[lpk,70,0] (* _Harvey P. Dale_, Nov 11 2024 *)
%o A239970 (PARI) triangular(n) = n*(n+1)/2;
%o A239970 is_triangular(n) = issquare(8*n+1);
%o A239970 s=[]; for(n=0, 100, k=1; while(!is_triangular(triangular(k)+triangular(n+k)), k++); s=concat(s, k)); s \\ _Colin Barker_, Mar 31 2014
%o A239970 (PARI) a(n)=my(k=1); while(!ispolygonal(k*(k+n+1)+(n^2+n)/2,3), k++); k \\ _Charles R Greathouse IV_, Apr 01 2014
%o A239970 (Haskell)
%o A239970 a239970 n = head [k | k <- [1..],
%o A239970                       a010054 (a000217 k + a000217 (n + k)) == 1]
%o A239970 -- _Reinhard Zumkeller_, Apr 03 2014
%Y A239970 Cf. A000217, A239969.
%Y A239970 Cf. A010054.
%K A239970 nonn
%O A239970 0,1
%A A239970 _Alex Ratushnyak_, Mar 30 2014
%E A239970 First PROG corrected by _Colin Barker_, Apr 04 2014