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”).

A063993
Number of ways of writing n as an unordered sum of exactly 3 nonzero triangular numbers.
11
0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 2, 1, 2, 0, 2, 2, 2, 1, 1, 2, 2, 2, 0, 3, 2, 2, 2, 2, 2, 1, 3, 1, 2, 3, 2, 2, 2, 2, 3, 2, 2, 3, 3, 1, 2, 5, 1, 2, 1, 2, 5, 3, 3, 1, 4, 2, 3, 2, 2, 4, 4, 2, 1, 4, 3, 3, 3, 2, 4, 3, 3, 3, 4, 2, 1, 6, 1, 5, 3, 3, 5, 2, 2, 2, 5, 2, 5, 4, 2, 4, 5, 3, 1
OFFSET
0,13
COMMENTS
a(A002097(n)) = 0; a(A111638(n)) = 1; a(A064825(n)) = 2. - Reinhard Zumkeller, Jul 20 2012
EXAMPLE
5 = 3 + 1 + 1, so a(5) = 1.
MAPLE
A063993 := proc(n)
local a, t1idx, t2idx, t1, t2, t3;
a := 0 ;
for t1idx from 1 do
t1 := A000217(t1idx) ;
if 3*t1 > n then
break;
end if;
for t2idx from t1idx do
t2 := A000217(t2idx) ;
if t1+t2 > n then
break;
end if;
t3 := n-t1-t2 ;
if t3 >= t2 then
if isA000217(t3) then
a := a+1 ;
end if;
end if ;
end do:
end do:
a ;
end proc: # R. J. Mathar, Apr 28 2020
MATHEMATICA
a = Table[ n(n + 1)/2, {n, 1, 15} ]; b = {0}; c = Table[ 0, {100} ]; Do[ b = Append[ b, a[ [ i ] ] + a[ [ j ] ] + a[ [ k ] ] ], {k, 1, 15}, {j, 1, k}, {i, 1, j} ]; b = Delete[ b, 1 ]; b = Sort[ b ]; l = Length[ b ]; Do[ If[ b[ [ n ] ] < 100, c[ [ b[ [ n ] ] + 1 ] ]++ ], {n, 1, l} ]; c
PROG
(Haskell)
a063993 n = length [() | let ts = takeWhile (< n) $ tail a000217_list,
x <- ts, y <- takeWhile (<= x) ts,
let z = n - x - y, 0 < z, z <= y, a010054 z == 1]
-- Reinhard Zumkeller, Jul 20 2012
(PARI) trmx(n)=my(k=sqrtint(8*n+1)\2); if(k^2+k>2*n, k-1, k)
trmn(n)=trmx(ceil(n)-1)+1
a(n)=if(n<3, return(0)); sum(a=trmn(n/3), trmx(n-2), my(t=n-a*(a+1)/2); sum(b=trmn(t/2), min(trmx(t-1), a), ispolygonal(t-b*(b+1)/2, 3))) \\ Charles R Greathouse IV, Jul 07 2022
CROSSREFS
Cf. A053604, A008443, A002636, A064181 (greedy inverse), A307598 (3 distinct positive).
Column k=3 of A319797.
Sequence in context: A309228 A309778 A143223 * A353445 A115722 A115721
KEYWORD
nonn,easy,nice
AUTHOR
N. J. A. Sloane, Sep 18 2001
EXTENSIONS
More terms from Robert G. Wilson v, Sep 20 2001
STATUS
approved