cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A235265 Primes whose base-3 representation also is the base-2 representation of a prime.

This page as a plain text file.
%I A235265 #42 Dec 23 2024 14:53:43
%S A235265 3,13,31,37,271,283,733,757,769,1009,1093,2281,2467,2521,2551,2917,
%T A235265 3001,3037,3163,3169,3187,3271,6673,7321,7573,9001,9103,9733,19801,
%U A235265 19963,20011,20443,20521,20533,20749,21871,21961,22123,22639,22717,27253,28711,28759,29173,29191,59077,61483,61507,61561,65701,65881
%N A235265 Primes whose base-3 representation also is the base-2 representation of a prime.
%C A235265 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
%C A235265 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.
%C A235265 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.
%H A235265 Robert Israel, <a href="/A235265/b235265.txt">Table of n, a(n) for n = 1..10000</a>
%H A235265 M. F. Hasler, <a href="https://docs.google.com/document/d/10IM7fcAbB2tqRGuwfGvuEGUzD_IXbgXPDK0tfxN4M3o/pub">Primes whose base c expansion is also the base b expansion of a prime</a>
%H A235265 Veikko Pohjola, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2014-January/012202.html">A090709 Decimal primes whose decimal representation in base 6 is also prime</a>, SeqFan list, Jan 03 2014.
%e A235265 3 = 10_3 and 10_2 = 2 is prime. 13 = 111_3 and 111_2 = 7 is prime.
%p A235265 N:= 1000: # to get the first N terms
%p A235265 count:= 0:
%p A235265 for i from 1 while count < N do
%p A235265    p2:= ithprime(i);
%p A235265    L:= convert(p2,base,2);
%p A235265    p3:= add(3^(j-1)*L[j],j=1..nops(L));
%p A235265    if isprime(p3) then
%p A235265       count:= count+1;
%p A235265       A235265[count]:= p3;
%p A235265    fi
%p A235265 od:
%p A235265 [seq(A235265[i], i=1..N)]; # _Robert Israel_, May 04 2014
%t A235265 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 *)
%o A235265 (PARI) is(p,b=2,c=3)=vecmax(d=digits(p,c))<b&&isprime(vector(#d,i,b^(#d-i))*d~)&&isprime(p)
%o A235265 (Python)
%o A235265 from sympy import isprime, nextprime
%o A235265 def agen(): # generator of terms
%o A235265     p = 2
%o A235265     while True:
%o A235265         p3 = sum(3**i for i, bi in enumerate(bin(p)[2:][::-1]) if bi=='1')
%o A235265         if isprime(p3):
%o A235265             yield p3
%o A235265         p = nextprime(p)
%o A235265 g = agen()
%o A235265 print([next(g) for n in range(1, 52)]) # _Michael S. Branicky_, Jan 16 2022
%Y A235265 Subset of A077717.
%Y A235265 Cf. A235266, A065720 and A036952, A065721 - A065727, A235394, A235395, A089971 and A020449, A089981, A090707 - A091924, A235461 - A235482. See M. F. Hasler's OEIS wiki page for further cross-references.
%K A235265 nonn,base,nice
%O A235265 1,1
%A A235265 _M. F. Hasler_, Jan 05 2014