p = Primes()
p
Set of all prime numbers: 2, 3, 5, 7, ...
type(p)
<class 'sage.sets.primes.Primes_with_category'>
321 in p
False
199 in p
True
p.first()
2
p.next(5)
7
p.next(199)
211
p[:20]
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]