OFFSET
2,1
COMMENTS
0# = 1# = 2 by convention.
FORMULA
n# = product of primes <= n. 0#=1#=2. n#/(p-r)# is analogous to the number of permutations of n things taken r at a time: P(n, r) = n!/(n-r)! where factorial ! is replaced by primorial # and n is replaced with the preceding prime to n.
PROG
(PARI) perm(n, r) = { local(p); forprime(p=r, n, print1(floor(primorial(p)/primorial(p-r))", ") ) } primorial(n) = \ The product of primes <= n using the pari primelimit. { local(p1, x); if(n==0||n==1, return(2)); p1=1; forprime(x=2, n, p1*=x); return(p1) }
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Feb 25 2005
STATUS
approved