

A239969


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


2



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, 464, 10, 12, 1, 11, 13, 313, 12, 5, 58, 13, 15, 37, 14, 3, 493, 15, 17, 31, 16, 18, 47, 17, 2, 79, 9, 20, 796, 19, 21, 883, 20, 22, 89, 4, 23, 58, 22, 24, 100, 23, 25, 1276
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

3,1


COMMENTS

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


LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 3..1000


EXAMPLE

a(3) = 2 because triangular(3)+triangular(3+2)=21 is a triangular number.
a(5) = 1 because triangular(5)+triangular(5+1)=36 is a triangular number.
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.


PROG

(PARI) triangular(n) = n*(n+1)/2;
is_triangular(n) = issquare(8*n+1);
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
(Haskell)
a239969 n = head [k  k < [1..],
a010054 (a000217 n + a000217 (n + k)) == 1]
 Reinhard Zumkeller, Apr 03 2014


CROSSREFS

Cf. A000217, A082183, A076708, A076049, A239970.
Cf. A010054.
Sequence in context: A269598 A100226 A121428 * A105686 A316131 A153726
Adjacent sequences: A239966 A239967 A239968 * A239970 A239971 A239972


KEYWORD

nonn


AUTHOR

Alex Ratushnyak, Mar 30 2014


EXTENSIONS

First PROG corrected by Colin Barker, Apr 04 2014


STATUS

approved



