OFFSET
1,1
COMMENTS
a(n) exists for all n: by Dirichlet's theorem on primes in arithmetic progressions, there is a prime x such that 3^(n-1) * x == 2*10^n + (10^n-1)/9 mod 10^(n+1).
EXAMPLE
a(4) = 501111 because 501111 = 3^2 * 13 * 4283 is the product of four primes (counted with multiplicity) and ends in four 1's, and no smaller number works.
MAPLE
f:= proc(n) local x, t, y;
t:= (10^n-1)/9;
for x from 0 do
if x mod 10 = 1 then next fi;
y:= 10^n * x + t;
if numtheory:-bigomega(y) = n then return y fi
od;
end proc:
map(f, [$1..14]);
PROG
(Python)
from sympy import factorint
from itertools import count
def f(n): return sum(e for p, e in factorint(n).items())
def a(n):
Rn, pow10 = (10**n-1)//9, 10**n
return next(t for d in count(0) for r in range(10**(d-1) if d else 0, 10**d) if r%10 != 1 and f(t:=r*pow10 + Rn) == n)
print([a(n) for n in range(1, 13)]) # Michael S. Branicky, Sep 21 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Sep 07 2024
STATUS
approved
