OFFSET
1,1
LINKS
David A. Corneth, PARI program
FORMULA
EXAMPLE
a(1) = 2, because 9*1*2 + 1 = 19 is prime and no lesser number has this property.
MATHEMATICA
p[m_, n_] := AllTrue[Range[n], PrimeQ[9*#*m + 1] &];
a[n_] := a[n] = Module[{m = 1}, While[! p[m, n], m++]; m]
Table[a[n], {n, 1, 9}] (* Robert P. P. McKone, May 02 2024 *)
PROG
(PARI) is(n, m)=my(u=vector(n, k, 9*k*m+1)); for(i=1, n, if(!isprime(u[i]), return(0))); 1
a(n)=my(pas=1); if(n<15, if(n>2, pas=factorback(primes(primepi(n))); pas/=3; my(m=pas)); forstep(m=pas, +oo, pas, if(is(n, m), return(m))))
(PARI) See PARI link
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Jean-Marc Rebert, Apr 23 2024
EXTENSIONS
a(11)-a(13) from David A. Corneth, Apr 24 2024
a(14) from Jason Yuen, Apr 25 2024
STATUS
approved