primorial operator '#' for GP?
| Newsgroups | gmane.comp.mathematics.pari.devel |
|---|---|
| Message-ID | <[email protected]> |
GP has factorial operator:
? 11!
%6 = 39916800
?
Similarly primorial is product of first n primes.
prodeuler produces only a floating point approximation:
? prodeuler(p=2,11,p)
%7 = 2310.0000000000000000000000000000000000
?
Something like this is exact:
? P(x)={r=1;forprime(p=2,x,r*=p);r}
%8 = (x)->r=1;forprime(p=2,x,r*=p);r
? P(11)
%9 = 2310
?
Any chance to see "#" as operator in GP like "!"?
? 11#
*** syntax error, unexpected '#', expecting end of file: 11#
*** ^-
?
Would be useful for eg. working with primorial primes p#±1:
https://en.wikipedia.org/wiki/Primorial_prime
Regards,
Hermann.