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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

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

Views

Author

Alex Ratushnyak, Mar 30 2014

Keywords

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

Examples

			n=5: the smallest solution k>0 to 8*k^2 + 64*k + 225 = m^2 is k=4, so a(5)=4.
		

Crossrefs

Programs

  • Haskell
    a239970 n = head [k | k <- [1..],
                          a010054 (a000217 k + a000217 (n + k)) == 1]
    -- Reinhard Zumkeller, Apr 03 2014
  • 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 *)
  • 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
    

Extensions

First PROG corrected by Colin Barker, Apr 04 2014
Showing 1-1 of 1 results.