This site is supported by donations to The OEIS Foundation.

# User:Anders Hellström/Euclid-Mullin

Euclid-Mullin(A000945)

```first_EM(m,k)=my(v=vector(m),j=prime(k));v[1]=j;for(i=2,m,v[i]=gpf(1+prod(j=1,i-1,v[j])));v; \\Euclid-Mullin initial value j
first_EM(m,p)=my(v=vector(m),j=p);v[1]=j;for(i=2,m,v[i]=gpf(1+prod(j=1,i-1,v[j])));v;
show_EM(j,k)={for(i=1,j,print(first_EM(k,i)));} \\Show some EM sequences.
show_EM(j,k)={for(i=1,j,print(first_EM(k,i)));}
first_EM(m,k)=my(v=vector(m),j=prime(k));v[1]=j;for(i=2,m,v[i]=gpf(1+prod(j=1,i-1,v[j])));v;
digits_EM(k)=d=0;f=first_EM(8,k);for(i=1,#f,d+=#digits(f[i]));d;
show_digits_EM(j)=for(i=1,j,print1("(",i,")=>",digits_EM(i),", "))
```
```(11)=> 31,            2,  3,   11,  23,   47059,     7,    5,     89,         19,     2287, 233,         17,                     647,                  1607, 12637,103,        13,       163, 4980301,
(23)=> 83,            2,  167, 3,   7,    67,        5,    13,    719,        37,     11,    31,         1367,                   31440216015620321911, 988487183108868589955299792587646370011, 19,
(32)=>131,            2,  263, 3,   37,   971,      1249,  5,     31,         13,     19,    11161,      3963633099343201420891, 997,                  7,   751,  23,         163,      127,   89,
(33)=>137,            2,  5,   3,   4111, 16896211, 7,     773,   659,        23,     227,   17,         61,                     151,                  113, 233,  3989,       11,       4621,  5624803,
(34)=>139,            2,  3,   5,   43,   11,       7,     13,    179489311,  320377, 827,   3895650091, 151,                    17,                   823, 191,  8648810893, 17548807, 83,    127,
(35)=>149,            2,  13,  5,   3,    58111,    3217,  7,     17,         151,    431,   29,         59,                     31,                   107, 103,  802669489,  27191,    10301, 11056953723831464507246391411845378755306535971,
(427010)=>6221671     2,  3,   7,   43,   11,       1451,  131,   21377,      8664743,79,    5,          13,                     391879,               83, 197,  233,        67,        19,   887,
=>38709183810571, 2,  3,   7,   43,   13,       53,    5,     6221671,    139,    2801, 11,          17,                     5471,                 52662739, 23003, 30693651606209,
(3151105)=>52662739,       2,  3,   5,   7,    113,      17573, 37,    151,        11,     13,   476977,      3767,                   601,                  102023, 1559, 8713, 315193, 2711, 367,

```