OFFSET
1,1
COMMENTS
This sequence and A235383 and A229037 are winners in the contest held at the 2014 AMS/MAA Joint Mathematics Meetings. - T. D. Noe, Jan 20 2014
This sequence was motivated by work initiated by V.J. Pohjola's post to the SeqFan list, which led to a clarification of the definition and correction of some errors, in sequences A089971, A089981 and A090707 through A090721. These sequences use "rebasing" (terminology of A065361) from some base b to base 10. Sequences A065720 - A065727 follow the same idea but use rebasing in the other sense, from base 10 to base b. The observation that only (10,b) and (b,10) had been considered so far led to the definition of this and related sequences: In a systematic approach, it seems natural to start with the smallest possible pairs of different bases, (2,3) and (3,2), then (2 <-> 4), (3 <-> 4), (2 <-> 5), etc.
Among the two possibilities using the smallest possible bases, 2 and 3, the present one seems a little bit more interesting, among others because not every base-3 representation is a valid base-2 representation (in contrast to the opposite case). This is also a reason why the present sequence grows much faster than the partner sequence A235266.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Veikko Pohjola, A090709 Decimal primes whose decimal representation in base 6 is also prime, SeqFan list, Jan 03 2014.
EXAMPLE
3 = 10_3 and 10_2 = 2 is prime. 13 = 111_3 and 111_2 = 7 is prime.
MAPLE
N:= 1000: # to get the first N terms
count:= 0:
for i from 1 while count < N do
p2:= ithprime(i);
L:= convert(p2, base, 2);
p3:= add(3^(j-1)*L[j], j=1..nops(L));
if isprime(p3) then
count:= count+1;
A235265[count]:= p3;
fi
od:
[seq(A235265[i], i=1..N)]; # Robert Israel, May 04 2014
MATHEMATICA
b32pQ[n_]:=Module[{idn3=IntegerDigits[n, 3]}, Max[idn3]<2&&PrimeQ[ FromDigits[ idn3, 2]]]; Select[Prime[Range[7000]], b32pQ] (* Harvey P. Dale, Apr 24 2015 *)
PROG
(PARI) is(p, b=2, c=3)=vecmax(d=digits(p, c))<b&&isprime(vector(#d, i, b^(#d-i))*d~)&&isprime(p)
(Python)
from sympy import isprime, nextprime
def agen(): # generator of terms
p = 2
while True:
p3 = sum(3**i for i, bi in enumerate(bin(p)[2:][::-1]) if bi=='1')
if isprime(p3):
yield p3
p = nextprime(p)
g = agen()
print([next(g) for n in range(1, 52)]) # Michael S. Branicky, Jan 16 2022
CROSSREFS
KEYWORD
nonn,base,nice
AUTHOR
M. F. Hasler, Jan 05 2014
STATUS
approved