Bill Allombert on Tue, 17 Jun 2003 14:32:04 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: ceil bug


On Tue, Jun 17, 2003 at 01:15:21PM +0100, Jon Perry wrote:
> Working upon A001399, I developed the formula:

What is A001399 ?

> s(n)=6*t(floor(n/6))+(n%6)*(floor(n/6)+1)
> 
> with t(n)=n*(n+1)/2
> 
> Due to a typing mistake, I inadvertently typed:
> 
> s=6*t(floor(n/6))+(n%6)*(floor(n/6)+1)
> 
> and Pari produced 1/12*n^2 + 1/2*n

It this formula 'n' is a polynomial, not an integer and floor() act
accordingly, so the above is equivalent to

s=6*t(n/6)

> Testing this doesn't produce the sequence in question, however:
> 
> for(i=1,20,print1(ceil(1/12*i^2+1/2*i)","))
> 
> does.

Where is exactly the 'ceil bug' you are complaining about ?

Cheers,
Bill.