login
Irregular triangle read by rows: row n (n>=1) lists the primes of the form prime(n) + k! for k >= 0.
3

%I #17 Apr 26 2022 08:10:48

%S 3,3,5,7,11,29,13,31,127,727,13,17,131,5051,3628811,19,37,733,19,23,

%T 41,137,362897,39916817,43,139,739,5059,3628819,39916819,87178291219,

%U 29,47,743,40343,362903,20922789888023,31,53,149,39916829,479001629,2432902008176640029,37,151,751,40351,362911,39916831,355687428096031,51090942171709440031,1124000727777607680031

%N Irregular triangle read by rows: row n (n>=1) lists the primes of the form prime(n) + k! for k >= 0.

%H Michael S. Branicky, <a href="/A352912/b352912.txt">Table of n, a(n) for n = 1..1019</a>

%e The initial rows, prefixed by prime(n), are:

%e [2]: 3, 3,

%e [3]: 5,

%e [5]: 7, 11, 29,

%e [7]: 13, 31, 127, 727,

%e [11]: 13, 17, 131, 5051, 3628811,

%e [13]: 19, 37, 733,

%e [17]: 19, 23, 41, 137, 362897, 39916817,

%e [19]: 43, 139, 739, 5059, 3628819, 39916819, 87178291219,

%e [23]: 29, 47, 743, 40343, 362903, 20922789888023,

%e [29]: 31, 53, 149, 39916829, 479001629, 2432902008176640029,

%e [31]: 37, 151, 751, 40351, 362911, 39916831, 355687428096031, 51090942171709440031, 1124000727777607680031,

%e [37]: 43, 61, 157, 757, 5077, 40357, 39916837, 6402373705728037, 2432902008176640037, 51090942171709440037, 8683317618811886495518194401280000037,

%e ...

%o (PARI)

%o forprime(p=2,59,print1([p],": ");for(k=0,p,if(ispseudoprime(p+k!),print1(p+k!,", ")));print())

%o (Python)

%o from sympy import isprime, prime

%o from itertools import count, islice

%o def agen(): # generator of terms

%o for n in count(1):

%o pn, fk = prime(n), 1

%o for k in range(1, pn+1):

%o if isprime(pn + fk): yield pn + fk

%o fk *= k

%o print(list(islice(agen(), 51))) # _Michael S. Branicky_, Apr 16 2022

%Y Cf. A352913 (last term in each row), A082470 (lengths of rows).

%K nonn,tabf

%O 1,1

%A Editors of OEIS, based on a suggestion from _Hemjyoti Nath_, Apr 16 2022