login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Triangular numbers that can be expressed as the sum of 2 positive triangular numbers.
7

%I #40 Jun 21 2021 15:22:21

%S 6,21,36,55,66,91,120,136,171,210,231,276,351,378,406,496,561,666,703,

%T 741,820,861,946,990,1035,1081,1176,1225,1326,1378,1431,1485,1540,

%U 1596,1653,1711,1770,1891,1953,2016,2080,2211,2278,2346,2556,2701,2775,2850

%N Triangular numbers that can be expressed as the sum of 2 positive triangular numbers.

%C Intersection of triangular numbers with sumset of triangular numbers. Triangular number analog of what for squares is {A057100(n)^2} = {A009000(n)^2}. {A000217} INTERSECT {A000217 + A000217}. - _Jonathan Vos Post_, Mar 09 2007

%C A subsequence of A051533. - _Wolfdieter Lang_, Jan 11 2017

%H Michael S. Branicky, <a href="/A089982/b089982.txt">Table of n, a(n) for n = 1..11915</a>

%F Triangular number m is in this sequence iff A000161(4*m+1)>1 or, alternatively, A083025(4*m+1)>1. - _Max Alekseyev_, Oct 24 2008

%F a(n) = A000217(A012132(n)). - _Ivan N. Ianakiev_, Jan 17 2013

%e Generally, A000217(A000217(n)) = A000217(A000217(n)-1) + A000217(n) and so is automatically included. These are 6=T(3), 21=T(6), 55=T(10), etc. Other solutions occur when a partial sum from x to y is triangular, e.g., 15 + 16 + 17 + 18 = 66 = T(11), so T(14) + T(11) = T(18). This particular example arises since 10+4k is triangular (at k=14, 10 + 4k = 66), and we therefore have a solution.

%e All other solutions occur when 3+2k, 6+3k, 10+4k, etc. -- in general, T(j) + j*k -- is triangular.

%t trn[i_]:=Module[{trnos=Accumulate[Range[i]],t2s},t2s=Union[Total/@ Tuples[ trnos,2]];Intersection[trnos,t2s]] (* _Harvey P. Dale_, Nov 08 2011 *)

%t Select[Range[75], ! PrimeQ[#^2 + (# + 1)^2] &] /. Integer_ -> (Integer^2 + Integer)/2 (* _Arkadiusz Wesolowski_, Dec 03 2015 *)

%o (PARI) t(i) = i*(i+1)/2;

%o { v=vector(100,i,t(i)); y=vector(100); c=0; for (i=1,30, for (j=i,30, x=t(i)+t(j); f=0; for (k=1,100,if (x==v[k],f=1;break)); if (f==1,y[c++ ]=x))); select(x->(x>0), vecsort(y,,8)) } \\ slightly edited by _Michel Marcus_, Apr 15 2021

%o (PARI) lista(nn) = {for (n=1, nn, my(t = n*(n+1)/2); for (k=1, n-1, if (ispolygonal(t - k*(k+1)/2, 3), print1(t, ", "); break;)););} \\ _Michel Marcus_, Apr 15 2021

%o (Python)

%o from itertools import count, takewhile

%o def aupto(lim):

%o t = list(takewhile(lambda x: x<=lim, (i*(i+1)//2 for i in count(1))))

%o s = set(a+b for i, a in enumerate(t) for b in t[i:])

%o return sorted(s & set(t))

%o print(aupto(3000)) # _Michael S. Branicky_, Jun 21 2021

%Y Cf. A000217, A012132, A051533, A057100.

%K nonn,easy

%O 1,1

%A _Jon Perry_, Jan 13 2004

%E More terms from Lambert Klasen (Lambert.Klasen(AT)gmx.net) and _David Wasserman_, Sep 23 2005