OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..995
MAPLE
f:= proc(n) local p;
for p from 10^n+1 by 10^(n+1) do
if isprime(p) then return p fi
od
end proc:
map(f, [$1..30]); # Robert Israel, May 03 2018
MATHEMATICA
Table[k=0; While[!PrimeQ[p=FromDigits[Join[IntegerDigits[k], IntegerDigits[10^n+1]]]], k++]; p, {n, 20}]
PROG
(Python)
from sympy import isprime as is_prime
# This implementation assumes function is_prime(n)
# returns True if n is prime, or False otherwise:
for n in range (1, 100):
pattern = 10**n + 1
for j in range (0, 10000000):
if (j == 0):
num = "%d" % (pattern)
else:
num = "%d%d" % (j, pattern)
if (is_prime(num)):
print(num)
break
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amir H. Farrahi, Feb 07 2011
STATUS
approved