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.

Original entry on oeis.org

2, 4, 6, 7, 9, 11, 12, 13, 16, 18, 20, 21, 22, 24, 25, 27, 29, 30, 31, 34, 36, 37, 38, 39, 42, 43, 46, 48, 49, 51, 55, 56, 57, 58, 60, 61, 64, 65, 66, 67, 69, 70, 72, 73, 76, 79, 81, 83, 84, 87, 88, 90, 91, 92, 93, 94, 97, 99, 100, 101, 102, 106, 108
Offset: 1

Views

Author

Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de)

Keywords

Comments

Numbers n such that 8n+2 is in A085989. - Robert Israel, Mar 06 2017

Examples

			666 is in the sequence because we can write 666 = 435 + 231 = binomial(22,2) + binomial(30,2).
		

Crossrefs

Cf. A000217, A020756 (sums of two triangular numbers), A001481 (sums of two squares), A007294, A051611 (complement).
Cf. A061336: minimal number of triangular numbers that sum up to n.
Cf. A085989.

Programs

  • Haskell
    a051533 n = a051533_list !! (n-1)
    a051533_list = filter ((> 0) . a053603) [1..]
    -- Reinhard Zumkeller, Jun 28 2013
    
  • Maple
    isA051533 := proc(n)
        local a,ta;
        for a from 1 do
            ta := A000217(a) ;
            if 2*ta > n then
                return false;
            end if;
            if isA000217(n-ta) then
                return true;
            end if;
        end do:
    end proc:
    for n from 1 to 200 do
        if isA051533(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Dec 16 2015
  • Mathematica
    f[k_] := If[!
       Head[Reduce[m (m + 1) + n (n + 1) == 2 k && 0 < m && 0 < n, {m, n},
           Integers]] === Symbol, k, 0]; DeleteCases[Table[f[k], {k, 1, 108}], 0] (* Ant King, Nov 22 2010 *)
    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]] &]
    With[{nn=70},Take[Union[Total/@Tuples[Accumulate[Range[nn]],2]],nn]] (* Harvey P. Dale, Jul 16 2015 *)
  • 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

Formula

A053603(a(n)) > 0. - Reinhard Zumkeller, Jun 28 2013
A061336(a(n)) = 2. - M. F. Hasler, Mar 06 2017