For the first question, since Sage has the prime_range() function: [p for p in prime_range(10000) if mod(p, 8) in (1, 7)]. There are several ways of filtering a list in Python, but I tend to choose list comprehensions (http://en.wikipedia.org/wiki/ List_comprehension#Python)
On Jul 24, 8:24 am, raman <[email protected]> wrote: > Hi Dears > First I must find all primes in the form p=8k+1 or p=8k+7 in range > 10000. > Second I should find the all integers a and b such that p=a^2-2b^2 in > range 10000. > Could you please help me for writing this program? -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
