small PARI q., was Re: A129755 (??!!)

N. J. A. Sloane njas at research.att.com
Sat Jun 2 15:29:18 CEST 2007


a , must be changed to ;
it must read:

gp > for(k=1,100,t=(k*(k+1))/2;if(isprime(t+10),print1(k,", ")))
1, 2, 6, 13, 17, 18, 21, 22, 33, 38, 46, 57, 58, 61, 66, 73, 81, 82, 98,

Maximilian
On 6/2/07, N. J. A. Sloane <njas at research.att.com> wrote:
> Dear Seqfans, I am not a regular PARI user. The other day
> Joerg A. sent this program for A129755:
> for(k=1,100,t=(k*(k+1))/2,if(isprime(t+10),print1(k,", ")))
> I cannot get it to work.
> I don't know if the prgram is wrong or - more likely -
> I am doing something wrong. Look:
>
> fry$ gp
>                            GP/PARI CALCULATOR Version 2.0.16 (beta)
>                                     unknown 32-bit version
>                        (readline v1.0 enabled, extended help available)
>
>                                   Copyright (C) 1989-1999 by
>                  C. Batut, K. Belabas, D. Bernardi, H. Cohen and M. Olivier.
>
> Type ? for help, \q to quit.
> Type ?12 for how to get moral (and possibly technical) support.
>
>    realprecision = 28 significant digits
>    seriesprecision = 16 significant terms
>    format = g0.28
>
> parisize = 4000000, primelimit = 500000
> ? for(k=1,100,t=(k*(k+1))/2,if(isprime(t+10),print1(k,", ")))
>   ***   expected character: ')'
>   ***   instead of:
>   ***   for(k=1,100,t=(k*(k+1))/2,if(isprime(t+10),pr
>                                  ^-------------------
>
> I can't see anything wrong!
>
> What am I doing wrong?
>
> Thanks
>
> Neil
>





More information about the SeqFan mailing list