OFFSET
0,1
COMMENTS
a(n) = 0 if n is a palindrome with even number of digits. Conjecture: No other term is zero.
The conjecture is false. a(231) = 0, a(420) = 0, a(n) = 0 if 11 divides n and n has an even number of digits. a(1414) has over 2000 digits. - Chai Wah Wu, Mar 31 2015
LINKS
Chai Wah Wu, Table of n, a(n) for n = 0..365
Chai Wah Wu, On a conjecture regarding primality of numbers constructed from prepending and appending identical digits, arXiv:1503.08883 [math.NT], 2015.
MATHEMATICA
(* f(n) defined by José de Jesús Camacho Medina in A010785. *)
lst={}; f[m_]:=IntegerDigits[(m-9*Floor[(m-1)/9])*(10^Floor[(m+8)/9]-1)/9];
g[n_]:=FromDigits[Flatten[{f[m], IntegerDigits[n], f[m]}]];
Do[m=1; While[True, If[Mod[Length[IntegerDigits[n]], 2]==0&&IntegerDigits[n]==Reverse[IntegerDigits[n]],
AppendTo[lst, 0]; Break[], If[PrimeQ[g[n]], AppendTo[lst, g[n]]; Break[]]]; m++], {n, 25}];
lst (* Ivan N. Ianakiev, Mar 23 2015 *)
PROG
(Python)
from gmpy2 import is_prime, mpz, digits
def A090287(n, limit=2000):
....sn = str(n)
....if n in (231, 420, 759) or not (len(sn) % 2 or n % 11):
........return 0
....for i in range(1, limit+1):
........for j in range(1, 10, 2):
............si = digits(j, 10)*i
............p = mpz(si+sn+si)
............if is_prime(p):
................return int(p)
....else:
........return 'search limit reached.' # Chai Wah Wu, Mar 31 2015
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Nov 29 2003
EXTENSIONS
a(0) from Chai Wah Wu, Mar 23 2015
a(26)-a(38) from Chai Wah Wu, Mar 24 2015
STATUS
approved