OFFSET
0,1
COMMENTS
f(n) = 100..00011..11 is the least positive integer whose decimal digits are n+1 1's and n+1 0's.
LINKS
Jean-Marc Rebert, Table of n, a(n) for n = 0..309
FORMULA
a(n) = 3 iff n = 3k + 2, since f(n) is odd and has n+1 1 digits so that "casting out 9's" shows f(n) == n+1 (mod 3).
a(n) = 7 iff n = 6k + 1.
a(n) = 11 iff n = 6k + 3.
EXAMPLE
a(1) = 7, because the smallest prime factor of f(1) = 1001 = 7 * 11 * 13 is 7.
a(2) = 3, because the smallest prime factor of f(2) = 100011 = 3 * 17 * 37 * 43 is 3.
MATHEMATICA
a[n_]:=Min[First/@FactorInteger[10^(2*n+1)+(10^n-1)/9]]; Array[a, 64, 0] (* Stefano Spezia, Sep 24 2023 *)
PROG
(PARI) a365966(n, limtd=10^9) = {my (x=10^(2*n+1)+(10^n-1)/9); forprime (p=2, limtd, if(x%p==0, return(p))); factor(x)[1, 1]}; \\ Hugo Pfoertner, Nov 14 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Jean-Marc Rebert, Sep 23 2023
STATUS
approved