OFFSET
0,1
COMMENTS
This sequence is well defined: a(0) = a(1) = 2, and for n > 1, (n+1)! and n*n! + 1 are coprime, so by Dirichlet's theorem on arithmetic progressions, there exists a prime number p of the form k*(n+1)! + n*n! + 1 for some k >= 0, and the factorial base expansion of this prime number contains the digit n, hence a(n) <= p.
LINKS
FORMULA
a(n) > A001563(n).
EXAMPLE
The initial terms, in decimal and in factorial base, are:
n a(n) fact(a(n))
- ------- -----------------
0 2 1,0
1 2 1,0
2 5 2,1
3 19 3,0,1
4 97 4,0,0,1
5 601 5,0,0,0,1
6 4327 6,0,0,1,0,1
7 35281 7,0,0,0,0,0,1
8 322571 8,0,0,0,0,1,2,1
9 3265949 9,0,0,0,0,1,0,2,1
PROG
(PARI) a(n) = { forprime (p = n*n!, oo, my (q = p); for (r = 2, oo, if (q==0, break, q % r==n, return (p), q \= r); ); ); }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 23 2025
STATUS
approved
