Consecutive primes with ascending or descending differences: Difference between revisions

m
fix
m (fix)
Line 357:
print prime(i-1);" (";prime(i)-prime(i-1);") ";
next i
print prime(i+-1) : print
'now for the descending ones
 
Line 378:
print prime(i-1);" (";prime(i)-prime(i-1);") ";
next i
print prime(i+-1)</lang>
{{out}}
<pre>The longest sequence of ascending primes (with their difference from the last one) is:
The longest sequence of ascending primes (with their difference from the last one) is:
128981 (2) 128983 (4) 128987 (6) 128993 (8) 129001 (10) 129011 (12) 129023 (14) 129061129037
 
The longest sequence of descending primes (with their difference from the last one) is:
322171 (22) 322193 (20) 322213 (16) 322229 (8) 322237 (6) 322243 (4) 322247 (2) 322271322249</pre>
 
=={{header|Julia}}==
781

edits