A339174 Let b(1) = 2 and let b(n+1) be the least prime expressible as k*(b(n)-1)*b(n)+1; this sequence gives the values of k in order.
1, 1, 1, 2, 5, 9, 6, 79, 16, 219, 580, 387, 189, 7067, 1803, 6582, 31917, 18888, 20973, 132755, 11419, 50111
Offset: 1
Examples
[Corrected by _Peter Munn_, Nov 05 2022] For p = 2, the smallest k for which f(k) = k*(p-1)*p+1 is prime is 1 because we have: f(1) = k*(p-1)*p+1 = 1*(2-1)*2+1 = 3. This sets p = 3 for the next iteration for which the smallest k for which f(k) is prime is 1: f(1) = k*(p-1)*p+1 = 1*(3-1)*3+1 = 7.
Programs
-
PARI
my(p=2, k=1); while(1, my(runningP=k*(p-1)*p+1); if(ispseudoprime(runningP), print1(k, ", "); k=1; p=runningP; , k=k+1))
-
PARI
my(k=[1, 1, 1, 2, 5, 9, 6, 79, 16, 219, 580, 387, 189, 7067, 1803, 6582, 31917, 18888, 20973, 132755, 11419, 50111], p=2); for(i=1, #k, p=k[i]*(p-1)*p+1); print("\n", p, "\n"); \\ to produce the P587124 prime
-
Python
from sympy import isprime A339174_list, a = [2], 2 while len(A339174_list) < 10: k, c, b = 1, 1, (a-1)*a while True: c += b if isprime(c): A339174_list.append(k) a = c break k += 1 # Chai Wah Wu, Dec 04 2020
Formula
Nested f(k) = k*(p-1)*p+1 for p=2. After each iteration the last obtained f(k) is substituted for p. The primes can be certified using OpenPFGW by adding each previous iteration to the helper file.
Extensions
a(22) from Rashid Naimi, Jan 13 2023
Comments