>> 
>> I'm also not buying the sqrt(length(a))+1 bit --- floor(2*length(a)) is more 
>> like it.
>> 
> 
> Shouldn’t that be
> 
> m <- sqrt(floor(2*length(a)))
> M <- matrix(0,m,m)
> 
> for the general case?
> 
> Berend
> 

Closer, but I actually meant:

floor(sqrt(2*length(a)))

if k is m*(m+1)/2, 2*k will be between m^2 and (m+1)^2, so sqrt(2*k) will be 
between m and m+1. QED.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: [email protected]  Priv: [email protected]

______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to