[go: up one dir, main page]

login
Search: a064825 -id:a064825
     Sort: relevance | references | number | modified | created      Format: long | short | data
Number of ways of writing n as an unordered sum of exactly 3 nonzero triangular numbers.
+10
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.
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
Numbers that are not the sum of 3 nonzero triangular numbers.
+10
7
1, 2, 4, 6, 11, 20, 29
OFFSET
1,2
COMMENTS
A063993(a(n)) = 0. - Reinhard Zumkeller, Jul 20 2012
MATHEMATICA
Complement[Range[30], Union[Total/@Tuples[Accumulate[Range[8]], 3]]] (* Harvey P. Dale, Oct 06 2017 *)
CROSSREFS
KEYWORD
fini,full,nonn
STATUS
approved
Numbers having a unique partition into three positive triangular numbers.
+10
6
3, 5, 7, 8, 9, 10, 13, 14, 15, 16, 18, 24, 25, 36, 38, 50, 53, 55, 60, 69, 81, 83, 99, 110, 119
OFFSET
1,1
COMMENTS
A063993(a(n)) = 1. - Reinhard Zumkeller, Jul 20 2012
EXAMPLE
Example: 119=55+36+28
MATHEMATICA
trig[n_]:=n(n+1)/2; trigInv[x_]:=Ceiling[Sqrt[Max[0, 2x]]]; lim=100; nLst=Table[0, {trig[lim]}]; Do[n=trig[a]+trig[b]+trig[c]; If[n>0 && n<=trig[lim], nLst[[n]]++ ], {a, 1, lim}, {b, a, trigInv[trig[lim]-trig[a]]}, {c, b, trigInv[trig[lim]-trig[a]-trig[b]]}]; Flatten[Position[nLst, 1]]
CROSSREFS
Cf. A060773 (n having a unique partition into three nonnegative triangular numbers).
KEYWORD
fini,full,nonn
AUTHOR
T. D. Noe, Aug 10 2005
STATUS
approved
Numbers that are the sum of 3 triangular numbers in exactly 2 ways.
+10
3
3, 6, 7, 9, 10, 13, 15, 17, 18, 19, 23, 24, 25, 26, 32, 33, 35, 38, 41, 44, 47, 54, 60, 62, 68, 69, 74, 80, 83, 89, 95, 99, 110, 113, 119, 128, 179, 194
OFFSET
1,1
COMMENTS
If it is required that the triangular numbers be positive, sequence A064825 results. - Jon E. Schoenfield, Jan 01 2020
EXAMPLE
From Jon E. Schoenfield, Jan 01 2020: (Start)
15 is a term of the sequence because there are exactly 2 ways to express 15 as the sum of 3 triangular numbers: 15 = 6 + 6 + 3 = 15 + 0 + 0.
60 is a term because there are exactly 2 ways to express 60 as the sum of 3 triangular numbers: 60 = 36 + 21 + 3 = 45 + 15 + 0.
12 can be expressed as the sum of 3 triangular numbers in 3 ways, so it is not a term: 12 = 10 + 1 + 1 = 6 + 6 + 0 = 6 + 3 + 3. (End)
PROG
(PARI) for(n=1, 150, if(sum(i=0, n, sum(j=0, i, sum(k=0, j, if(i*(i+1)/2+j*(j+1)/2+k*(k+1)/2-n, 0, 1))))==2, print1(n, ", ")))
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, Jun 02 2002
EXTENSIONS
More terms from Vladeta Jovovic, Jun 07 2002
STATUS
approved
a(n) is the largest number that can be expressed as the sum of three triangular numbers in exactly n ways.
+10
1
53, 194, 470, 788, 1730, 2000, 2693, 4310, 6053, 6845, 10688, 11348, 13970, 12923, 20768, 17135, 27830, 26480, 36245, 31688, 37073, 39983, 57860, 46940, 49148, 68258, 62810, 66515, 76985, 73868, 82850, 123878, 87890, 119810, 111053, 118490, 118880, 119183
OFFSET
1,1
COMMENTS
One or more of the three triangular numbers may be zeros. If it were required that the triangular numbers be positive, sequence A330811 would result.
KEYWORD
nonn
AUTHOR
Jon E. Schoenfield, Jan 01 2020
STATUS
approved
a(n) is the largest number that can be expressed as the sum of three positive triangular numbers in exactly n ways.
+10
1
29, 119, 335, 713, 1730, 1328, 3413, 3485, 4565, 6053, 6950, 10688, 11348, 13970, 16778, 20768, 18173, 36245, 26480, 27203, 37073, 35033, 39983, 57860, 46940, 49148, 68258, 62810, 66515, 76985, 73868, 123878, 103403, 87890, 119810, 111053, 118490, 118880
OFFSET
0,1
COMMENTS
If the triangular numbers were not required to be positive, sequence A330810 would result.
KEYWORD
nonn
AUTHOR
Jon E. Schoenfield, Jan 01 2020
STATUS
approved

Search completed in 0.014 seconds