|
|
A256480
|
|
Smallest prime obtained by appending n to a nonzero number with identical digits or 0 if no such prime exists.
|
|
2
|
|
|
0, 11, 0, 13, 0, 0, 0, 17, 0, 19, 0, 211, 0, 113, 0, 0, 0, 317, 0, 419, 0, 421, 0, 223, 0, 0, 0, 127, 0, 229, 0, 131, 0, 233, 0, 0, 0, 137, 0, 139, 0, 241, 0, 443, 0, 0, 0, 347, 0, 149, 0, 151, 0, 353, 0, 0, 0, 157, 0, 359, 0, 461, 0, 163, 0, 0, 0, 167, 0, 269
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
a(n) = 0 if n is even or a multiple of 5. Conjecture: all other terms are nonzero. Conjecture verified for n <= 10^7.
"Appending" means "on the right".
|
|
LINKS
|
|
|
PROG
|
(Python)
from gmpy2 import digits, mpz, is_prime
....sn = str(n)
....if not (n % 2 and n % 5):
........return 0
....for i in range(1, limit+1):
........for j in range(1, 10):
............si = digits(j, 10)*i
............p = mpz(si+sn)
............if is_prime(p):
................return int(p)
....else:
........return 'search limit reached.'
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|