/* Generating Odd Primes in Picat. https://plus.google.com/u/0/communities/113220522707815729771?partnerid=gplp0 """ Peter Luschny: Odd primes. What is the shortest program to compute the odd primes? My nomination (with Sage/Python): def A065091(limit): f = 3; print f for n in range(3, limit, 2): if (f+1) > n*(f//n)+1: print n f = f*n A065091(100) This is certainly not the fastest method known to compute the odd primes. But it is way better than the second PARI program which in my opinion is moonshine but unfortunately was allowed to enter OEIS. But now the crucial question: Is the algorithm correct? Proof? http://oeis.org/A065091 """ This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ main => go. go => a065091(100), nl. a065091(Limit) => F=3, println(F), foreach(N in 3..2..Limit) if F+1 > N * (F//N) + 1 then println(N) end, F := F*N end.