OFFSET
1,1
FORMULA
a(3k + 2) = 3, a(6k + 3) = 7, a(6k + 4) = 7.
EXAMPLE
a(1) = 101, because f(1) = 101 is prime.
a(2) = 3, because the smallest prime factor of f(2) = 10011 = 3 * 337 is 3.
MATHEMATICA
a[n_]:=Min[First/@FactorInteger[10^(2*n)+(10^n-1)/9]]; Array[a, 59] (* Stefano Spezia, Sep 24 2023 *)
PROG
(PARI) a(n)=my(x=10^(2*n)+(10^n-1)/9); m=factor(x); return(m[1, 1])
(PARI) a(n) = my(x=10^(2*n)+(10^n-1)/9, k=10); if (ispseudoprime(x), return(x)); while (1, m=factor(x, k); if (m[1, 1]<x, return(m[1, 1])); k*=10); \\ Michel Marcus, Sep 24 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Jean-Marc Rebert, Sep 23 2023
EXTENSIONS
a(60) from Jinyuan Wang, Sep 24 2023
STATUS
approved