/* Hello-world program for PARI/GP, based on Thomas Baruchel’s Python: and on typing at my shell prompt gp2c <<<'nextprime(351)' */ #include #include #include int main(int argc, char **argv) { long n = argv[1] ? atol(argv[1]) : 33; pari_init(1<<16, 0); /* Without this it segfaults; 1<<19 more reasonable */ printf("next prime after %ld is %ld\n", n, itos(nextprime(stoi(n)))); return 0; }