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.

A051533 Numbers that are the sum of two positive triangular numbers.

This page as a plain text file.
%I A051533 #38 Feb 16 2025 08:32:41
%S A051533 2,4,6,7,9,11,12,13,16,18,20,21,22,24,25,27,29,30,31,34,36,37,38,39,
%T A051533 42,43,46,48,49,51,55,56,57,58,60,61,64,65,66,67,69,70,72,73,76,79,81,
%U A051533 83,84,87,88,90,91,92,93,94,97,99,100,101,102,106,108
%N A051533 Numbers that are the sum of two positive triangular numbers.
%C A051533 Numbers n such that 8n+2 is in A085989. - _Robert Israel_, Mar 06 2017
%H A051533 T. D. Noe, <a href="/A051533/b051533.txt">Table of n, a(n) for n = 1..1000</a>
%H A051533 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/FermatsPolygonalNumberTheorem.html">Fermat's Polygonal Number Theorem</a>
%F A051533 A053603(a(n)) > 0. - _Reinhard Zumkeller_, Jun 28 2013
%F A051533 A061336(a(n)) = 2. - _M. F. Hasler_, Mar 06 2017
%e A051533 666 is in the sequence because we can write 666 = 435 + 231 = binomial(22,2) + binomial(30,2).
%p A051533 isA051533 := proc(n)
%p A051533     local a,ta;
%p A051533     for a from 1 do
%p A051533         ta := A000217(a) ;
%p A051533         if 2*ta > n then
%p A051533             return false;
%p A051533         end if;
%p A051533         if isA000217(n-ta) then
%p A051533             return true;
%p A051533         end if;
%p A051533     end do:
%p A051533 end proc:
%p A051533 for n from 1 to 200 do
%p A051533     if isA051533(n) then
%p A051533         printf("%d,",n) ;
%p A051533     end if;
%p A051533 end do: # _R. J. Mathar_, Dec 16 2015
%t A051533 f[k_] := If[!
%t A051533    Head[Reduce[m (m + 1) + n (n + 1) == 2 k && 0 < m && 0 < n, {m, n},
%t A051533        Integers]] === Symbol, k, 0]; DeleteCases[Table[f[k], {k, 1, 108}], 0] (* _Ant King_, Nov 22 2010 *)
%t A051533 nn=50; tri=Table[n(n+1)/2, {n,nn}]; Select[Union[Flatten[Table[tri[[i]]+tri[[j]], {i,nn}, {j,i,nn}]]], #<=tri[[-1]] &]
%t A051533 With[{nn=70},Take[Union[Total/@Tuples[Accumulate[Range[nn]],2]],nn]] (* _Harvey P. Dale_, Jul 16 2015 *)
%o A051533 (Haskell)
%o A051533 a051533 n = a051533_list !! (n-1)
%o A051533 a051533_list = filter ((> 0) . a053603) [1..]
%o A051533 -- _Reinhard Zumkeller_, Jun 28 2013
%o A051533 (PARI) is(n)=for(k=ceil((sqrt(4*n+1)-1)/2),(sqrt(8*n-7)-1)\2, if(ispolygonal(n-k*(k+1)/2, 3), return(1))); 0 \\ _Charles R Greathouse IV_, Jun 09 2015
%Y A051533 Cf. A000217, A020756 (sums of two triangular numbers), A001481 (sums of two squares), A007294, A051611 (complement).
%Y A051533 Cf. A061336: minimal number of triangular numbers that sum up to n.
%Y A051533 Cf. A085989.
%K A051533 easy,nonn,nice
%O A051533 1,1
%A A051533 Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de)