login
A239970
Least positive k such that triangular(k) + triangular(n+k) is a triangular number (A000217).
2
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, 19, 8, 81, 26, 20, 13, 17, 24, 99, 9, 105, 14, 111, 114, 29, 120, 123, 126, 10, 132, 135, 34, 20, 144, 147, 35, 153, 45, 11, 29, 165, 33, 17, 174, 30, 44, 183, 186, 189, 12, 18, 23
OFFSET
0,1
COMMENTS
a(n) <= 3*n-3, because triangular(3*n-3) + triangular(4*n-3) = triangular(5*n-4).
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
LINKS
EXAMPLE
n=5: the smallest solution k>0 to 8*k^2 + 64*k + 225 = m^2 is k=4, so a(5)=4.
MATHEMATICA
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 *)
PROG
(PARI) triangular(n) = n*(n+1)/2;
is_triangular(n) = issquare(8*n+1);
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
(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
(Haskell)
a239970 n = head [k | k <- [1..],
a010054 (a000217 k + a000217 (n + k)) == 1]
-- Reinhard Zumkeller, Apr 03 2014
CROSSREFS
Cf. A010054.
Sequence in context: A335499 A358838 A359008 * A111202 A194280 A163362
KEYWORD
nonn,changed
AUTHOR
Alex Ratushnyak, Mar 30 2014
EXTENSIONS
First PROG corrected by Colin Barker, Apr 04 2014
STATUS
approved