[seqfan] Re: a question about triangular numbers
Tanya Khovanova
mathoflove-seqfan at yahoo.com
Tue Dec 8 19:36:22 CET 2009
Right,
Not any number is a sum of two triangular numbers. When n - (the largest triangular not exceeding n) can't be represented as a sum of two triangles, we get a drop out.
Is there any lower bound for this sequence?
Tanya
--- On Tue, 12/8/09, Richard Mathar <mathar at strw.leidenuniv.nl> wrote:
> From: Richard Mathar <mathar at strw.leidenuniv.nl>
> Subject: [seqfan] Re: a question about triangular numbers
> To: seqfan at seqfan.eu
> Date: Tuesday, December 8, 2009, 1:28 PM
>
> On behalf of http://list.seqfan.eu/pipermail/seqfan/2009-December/003182.html
> :
>
> If a(n)=the largest of the three triangular numbers x,y,z
> of partitioning n=x+y+z into any three triangulare numbers,
> I get the more
> irregular:
>
> 1, 1, 3, 3, 3, 6, 6, 6, 6, 10, 10, 10, 10, 10, 15, 15, 15,
> 15, 15, 10,
> 21, 21, 21, 21, 21, 15, 21, 28, 28, 28, 28, 28, 21, 28, 28,
> 36, 36, 36,
> 36, 36, 28, 36, 36, 28, 45, 45, 45, 45, 45, 28,...
> with "drop-outs"
>
> Maple:
> # The triangular numbers
> A000027 := proc(n)
> option remember;
> n*(n+1)/2 ;
> end proc:
> # test if the argument is a triangular number
> isA000027 := proc(n)
> issqr(1+8*n) ;
> end proc:
> # calculate the maximum in the set Ta+Tb+Tc=n, any Ta, Tb,
> Tc of A000027
> ltn := proc(n)
> local res, ai,bi,Ta,Tb,Tc ;
> res := -1 ;
> # loop Ta over all triangular numbers
> for ai from 0 do
> Ta := A000027(ai) ;
> if Ta > n then
>
> break;
> else
> #
> loop Tb over all triangular numbers
>
> for bi from ai do
>
> Tb := A000027(bi) ;
>
> if Ta+Tb > n then
>
> break;
>
> else
>
> # Tc the remainder to
> sum to n
>
> Tc := n-Ta-Tb ;
>
> if isA000027(Tc) then
>
> res
> := max(res, Ta, Tb, Tc) ;
>
> #
> printf("%d = %d + %d + %d\n",n,Ta,Tb,Tc) ;
>
> end if;
>
> end if ;
>
> end do ;
> end if ;
> end do;
> return res;
> end proc:
>
> seq(ltn(n),n=1..50) ;
>
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>
More information about the SeqFan
mailing list