17 lines
871 B
Text
17 lines
871 B
Text
;Definition
|
||
The [https://en.wikipedia.org/wiki/Euclid%E2%80%93Mullin_sequence Euclid–Mullin sequence] is an infinite sequence of distinct prime numbers, in which each element is the least prime factor of one plus the product of all earlier elements.
|
||
|
||
The first element is usually assumed to be 2. So the second element is : (2) + 1 = 3 and the third element is : (2 x 3) + 1 = 7 as this is prime.
|
||
|
||
Although intermingled with smaller elements, the sequence can produce very large elements quite quickly and only the first 51 have been computed at the time of writing.
|
||
|
||
;Task
|
||
Compute and show here the first '''16''' elements of the sequence or, if your language does not support arbitrary precision arithmetic, as many as you can.
|
||
|
||
;Stretch goal
|
||
Compute the next '''11''' elements of the sequence.
|
||
|
||
;Reference
|
||
[https://oeis.org/A000945 OEIS sequence A000945]
|
||
<br><br>
|
||
|