Skip to content

Double summation limits

4 messages · Orestis Chrysafis, Ron Michael, David Winsemius

#
Perhaps:

SSCxy <- function(z) {tail(sapply(0:z, function (x) sum(sapply(0:x,  
function(y) sum(choose(x+y, y))))), 1) }

 > SSCxy(5)
[1] 462

See also:
http://www.research.att.com/~njas/sequences/?q=1%2C3%2C10%2C35%2C126%2C462&sort=0&fmt=0&language=english&go=Search
On May 1, 2009, at 3:45 PM, Orestis Chrysafis wrote:

            
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
#
Can anyone please explain me why it is not coming? I have done following :
[1] 3
[1] 10
[1] 35
Warning message:
In 0:j : numerical expression has 4 elements: only the first used
[1] 4

Here if value of "j" is given independently it is ok. However as soon as "j"
is used in loop it fails? Why it is happening? Is there any mathematics
behind that?
Orestis Chrysafis wrote:

  
    
#
On May 2, 2009, at 12:18 AM, RON70 wrote:

            
What loop? You made j a vector and then tried to treat it like a  
single value. You even got an informative error message:
"Warning message:
In 0:j : numerical expression has 4 elements: only the first used"
Read for meaning.
David Winsemius, MD
Heritage Laboratories
West Hartford, CT