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.

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

This page as a plain text file.
%I A089982 #40 Jun 21 2021 15:22:21
%S A089982 6,21,36,55,66,91,120,136,171,210,231,276,351,378,406,496,561,666,703,
%T A089982 741,820,861,946,990,1035,1081,1176,1225,1326,1378,1431,1485,1540,
%U A089982 1596,1653,1711,1770,1891,1953,2016,2080,2211,2278,2346,2556,2701,2775,2850
%N A089982 Triangular numbers that can be expressed as the sum of 2 positive triangular numbers.
%C A089982 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 A089982 A subsequence of A051533. - _Wolfdieter Lang_, Jan 11 2017
%H A089982 Michael S. Branicky, <a href="/A089982/b089982.txt">Table of n, a(n) for n = 1..11915</a>
%F A089982 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 A089982 a(n) = A000217(A012132(n)). - _Ivan N. Ianakiev_, Jan 17 2013
%e A089982 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 A089982 All other solutions occur when 3+2k, 6+3k, 10+4k, etc. -- in general, T(j) + j*k -- is triangular.
%t A089982 trn[i_]:=Module[{trnos=Accumulate[Range[i]],t2s},t2s=Union[Total/@ Tuples[ trnos,2]];Intersection[trnos,t2s]] (* _Harvey P. Dale_, Nov 08 2011 *)
%t A089982 Select[Range[75], ! PrimeQ[#^2 + (# + 1)^2] &] /. Integer_ -> (Integer^2 + Integer)/2 (* _Arkadiusz Wesolowski_, Dec 03 2015 *)
%o A089982 (PARI) t(i) = i*(i+1)/2;
%o A089982 { 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 A089982 (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 A089982 (Python)
%o A089982 from itertools import count, takewhile
%o A089982 def aupto(lim):
%o A089982     t = list(takewhile(lambda x: x<=lim, (i*(i+1)//2 for i in count(1))))
%o A089982     s = set(a+b for i, a in enumerate(t) for b in t[i:])
%o A089982     return sorted(s & set(t))
%o A089982 print(aupto(3000)) # _Michael S. Branicky_, Jun 21 2021
%Y A089982 Cf. A000217, A012132, A051533, A057100.
%K A089982 nonn,easy
%O A089982 1,1
%A A089982 _Jon Perry_, Jan 13 2004
%E A089982 More terms from Lambert Klasen (Lambert.Klasen(AT)gmx.net) and _David Wasserman_, Sep 23 2005