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.

A239969 Least positive k such that triangular(n) + triangular(n+k) is a triangular number (A000217), or -1 if no such k exists.

This page as a plain text file.
%I A239969 #17 Apr 05 2014 01:32:48
%S A239969 2,5,1,3,20,2,4,16,3,5,31,4,6,119,5,7,16,6,8,103,7,9,2,8,10,26,9,11,
%T A239969 464,10,12,1,11,13,313,12,5,58,13,15,37,14,3,493,15,17,31,16,18,47,17,
%U A239969 2,79,9,20,796,19,21,883,20,22,89,4,23,58,22,24,100,23,25,1276
%N A239969 Least positive k such that triangular(n) + triangular(n+k) is a triangular number (A000217), or -1 if no such k exists.
%C A239969 In other words, smallest solution k>0 to 4*k^2 + 8*(k + 1)*n + 8*n^2 + 4*k + 1 = m^2. - _Ralf Stephan_, Apr 01 2014
%H A239969 Reinhard Zumkeller, <a href="/A239969/b239969.txt">Table of n, a(n) for n = 3..1000</a>
%e A239969 a(3) = 2 because triangular(3)+triangular(3+2)=21 is a triangular number.
%e A239969 a(5) = 1 because triangular(5)+triangular(5+1)=36 is a triangular number.
%e A239969 In other words, k=a(3)=2 is the smallest positive solution to 4*k^2 + 28*k + 97 = m^2, and k=a(5)=1 is the smallest positive solution to 4*k^2 + 44*k + 241 = m^2.
%o A239969 (PARI) triangular(n) = n*(n+1)/2;
%o A239969 is_triangular(n) = issquare(8*n+1);
%o A239969 s=[]; for(n=3, 100, k=1; while(!is_triangular(triangular(n)+triangular(n+k)), k++); s=concat(s, k)); s \\ _Colin Barker_, Mar 31 2014
%o A239969 (Haskell)
%o A239969 a239969 n = head [k | k <- [1..],
%o A239969                       a010054 (a000217 n + a000217 (n + k)) == 1]
%o A239969 -- _Reinhard Zumkeller_, Apr 03 2014
%Y A239969 Cf. A000217, A082183, A076708, A076049, A239970.
%Y A239969 Cf. A010054.
%K A239969 nonn
%O A239969 3,1
%A A239969 _Alex Ratushnyak_, Mar 30 2014
%E A239969 First PROG corrected by _Colin Barker_, Apr 04 2014