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.

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

This page as a plain text file.
%I A235266 #21 Mar 28 2022 00:41:51
%S A235266 2,7,11,13,41,47,67,73,79,109,127,151,173,181,191,193,211,223,227,229,
%T A235266 233,251,283,331,367,421,443,487,541,557,563,587,601,607,631,641,661,
%U A235266 677,719,733,877,941,947,967,971,1033,1187,1193,1201,1301,1321,1373,1447,1451,1471,1531,1567,1571,1657,1667,1669,1697,1709,1759
%N A235266 Primes whose base-2 representation is also the base-3 representation of a prime.
%H A235266 Robert Israel, <a href="/A235266/b235266.txt">Table of n, a(n) for n = 1..10000</a>
%H A235266 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>
%F A235266 a(n) is the number whose base-3 representation is the base-2 representation of A235265(n).
%p A235266 f:= proc(n) local L,i;
%p A235266   L:= convert(n,base,2);
%p A235266   isprime(add(L[i]*3^(i-1),i=1..nops(L)))
%p A235266 end proc:
%p A235266 select(f, [seq(ithprime(i),i=1..1000)]); # _Robert Israel_, Jun 03 2019
%t A235266 Select[Prime@ Range@ 250, PrimeQ@ FromDigits[IntegerDigits[#, 2], 3] &] (* _Michael De Vlieger_, Jun 03 2019 *)
%o A235266 (PARI) is(p,b=3,c=2)=isprime(vector(#d=digits(p,c),i,b^(#d-i))*d~)&&isprime(p) \\ This code can be used for other bases b,c when b>c. See A235265 for code valid for b<c.
%o A235266 (PARI) forprime(p=2, 1e3, if(isprime(fromdigits(binary(p), 3)), print1(p", "))) \\ _Charles R Greathouse IV_, Mar 28 2022
%o A235266 (Python)
%o A235266 from sympy import isprime, nextprime
%o A235266 def agen(): # generator of terms
%o A235266     p = 2
%o A235266     while True:
%o A235266         p3 = sum(3**i for i, bi in enumerate(bin(p)[2:][::-1]) if bi=='1')
%o A235266         if isprime(p3):
%o A235266             yield p
%o A235266         p = nextprime(p)
%o A235266 g = agen()
%o A235266 print([next(g) for n in range(1, 65)]) # _Michael S. Branicky_, Jan 16 2022
%Y A235266 Cf. A090707 - A091924, A235461 - A235482. See the LINK for further cross-references.
%Y A235266 Cf. A077717, A005836.
%K A235266 nonn,base
%O A235266 1,1
%A A235266 _M. F. Hasler_, Jan 05 2014