OFFSET
1,1
COMMENTS
For n > 1, a(n), if it exists, is of the form nextprime(t*10^(n-1)) for some t, 2 <= t <= 9. [Max Alekseyev, Apr 23 2010]
EXAMPLE
2003 is a term as the previous prime 1999 differs at every corresponding position (1,2), (9,0), (9,0), (9,3).
MATHEMATICA
Table[SelectFirst[Partition[Prime@ Range[PrimePi@ NextPrime[10^n], PrimePi[10^(n + 1) - 1]], 2, 1], AllTrue[Transpose@ {IntegerDigits[#1], IntegerDigits[#2]}, UnsameQ @@ # &] & @@ # &], {n, 0, 7}] [[All, -1]] (* Michael De Vlieger, Aug 14 2017 *)
PROG
(PARI) { a(n) = local(L, U, aa, bb); if(n==1, return(3)); for(t=2, 9, L=precprime(t*10^(n-1)); U=nextprime(t*10^(n-1)); aa=Vec(Str(L)); bb=Vec(Str(U)); if(sum(i=1, #aa, aa[i]!=bb[i])==#aa, return(U)); ); 0 } \\ Max Alekseyev, Apr 23 2010
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Nov 12 2005
EXTENSIONS
2 more terms from R. J. Mathar, Aug 31 2007
More terms from Max Alekseyev, Apr 23 2010
STATUS
approved