OFFSET
1,1
COMMENTS
Except for a(1) = 2, which is the only even prime, all terms end with 1.
The corresponding sequences of primes are A235473 (for base 3) and A235467 (for base 4) (see examples).
As 1381 = 1220011_3 = 111211_4, prime 1381 occurs twice and is the next such prime after 2 (see example), which has a representation in base 3 and a representation in base 4 that are both terms of this sequence.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 2 and 2_3 = 2_4 = 2_10.
a(2) = 1121 because 1121_3 = 43_10 and 1121_4 = 89_10 are primes.
a(3) = 2021 because 2021_3 = 61_10 and 2021_4 = 137_10 are primes.
MATHEMATICA
f[n_] := Module[{d = IntegerDigits[n, 3]}, If[PrimeQ[FromDigits[d, 4]], FromDigits[d, 10], 0]]; seq = {}; Do[If[PrimeQ[n], m = f[n]; If[m > 0, AppendTo[seq, m]]], {n, 2, 1000}]; seq (* Amiram Eldar, Jan 03 2021 *)
FromDigits[#]&/@Select[Tuples[{0, 1, 2}, 7], PrimeQ[FromDigits[#, 4]] && PrimeQ[ FromDigits[ #, 3]]&] (* Harvey P. Dale, Dec 15 2021 *)
PROG
(PARI) f(n, b) = fromdigits(digits(n, b));
my(vp=primes(700)); setintersect(apply(x->f(x, 3), vp), apply(x->f(x, 4), vp)) \\ Michel Marcus, Jan 04 2021
(PARI) forprime(p=2, 10^3, my(t=digits(p, 3)); if( isprime( fromdigits(t, 4)), print1(fromdigits(t, 10), ", "))) \\ Joerg Arndt, Jan 04 2021
(Python)
from sympy import prime, isprime
from sympy.ntheory.factor_ import digits
A340290_list = [int(s) for s in (''.join(str(d) for d in digits(prime(i), 3)[1:]) for i in range(1, 1000)) if isprime(int(s, 4))] # Chai Wah Wu, Jan 09 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Jan 03 2021
EXTENSIONS
More terms from Amiram Eldar, Jan 03 2021
STATUS
approved