Next special primes
Next special primes is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.
- Task
- n is smallest prime such that the difference of successive terms is strictly increasing.
Let 0 < n < 1050
Ring
<lang ring> load "stdlib.ring"
see "working..." + nl
row = 0 num = null limit1 = 100 nextPrime = 2 oldPrime = 2
for n = 1 to limit1
nextPrime = oldPrime + n if isprime(nextPrime) row = row + 1 see "" + nextPrime + " " if (row%5) = 0 see nl ok oldPrime = nextPrime ok
next
see nl + "done..." + nl
</lang>
- Output:
working... 3 5 11 19 29 41 59 79 101 127 157 191 227 269 313 359 409 461 521 587 659 733 809 887 967 1049 done...