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.

A347209 Emirps in both base 2 and base 10.

This page as a plain text file.
%I A347209 #16 Oct 13 2022 11:48:12
%S A347209 13,37,71,97,113,167,199,337,359,701,709,739,907,937,941,953,967,1033,
%T A347209 1091,1109,1153,1181,1201,1217,1229,1259,1439,1471,1487,1669,1733,
%U A347209 1789,1811,1933,1949,3019,3067,3083,3089,3121,3163,3221,3299,3343,3389,3433,3469,3511,3527,3571,3583,3643,3719
%N A347209 Emirps in both base 2 and base 10.
%C A347209 Primes p such that A030101(p) and A004086(p) are primes other than p.
%C A347209 Are there any cases where A030101(p) = A004086(p), i.e. emirps in A081434?
%H A347209 Robert Israel, <a href="/A347209/b347209.txt">Table of n, a(n) for n = 1..10000</a>
%e A347209 a(3) = 71 is a term because 71 is prime, its base-10 reversal 17 is a prime other than 71, and its base-2 reversal 113 is a prime other than 71.
%p A347209 filter:= proc(n) local L,nL,i,r,s;
%p A347209   if not isprime(n) then return false fi;
%p A347209   L:= convert(n,base,10);
%p A347209   nL:= nops(L);
%p A347209   r:= add(10^(nL-i)*L[i],i=1..nL);
%p A347209   if r=n or not isprime(r) then return false fi;
%p A347209   L:= convert(n,base,2);
%p A347209   nL:= nops(L);
%p A347209   s:=add(2^(nL-i)*L[i],i=1..nL);
%p A347209   s <> n and isprime(s)
%p A347209 end proc:
%p A347209 select(filter, [seq(i,i=3..10000,2)]);
%t A347209 Select[Range[4000], (ir = IntegerReverse[#]) != # && PrimeQ[#] && PrimeQ[ir] && (ir2 = IntegerReverse[#, 2]) != # && PrimeQ[ir2] &] (* _Amiram Eldar_, Aug 23 2021 *)
%t A347209 Select[Prime[Range[600]],!PalindromeQ[#]&&FromDigits[Reverse[IntegerDigits[#,2]],2]!=#&&AllTrue[{IntegerReverse[#],FromDigits[Reverse[IntegerDigits[#,2]],2]},PrimeQ]&] (* _Harvey P. Dale_, Oct 13 2022 *)
%o A347209 (Python)
%o A347209 from sympy import isprime, primerange
%o A347209 def ok(p):
%o A347209     s, b = str(p), bin(p)[2:]
%o A347209     if s == s[::-1] or b == b[::-1]: return False
%o A347209     return isprime(int(s[::-1])) and isprime(int(b[::-1], 2))
%o A347209 print(list(filter(ok, primerange(1, 3720)))) # _Michael S. Branicky_, Aug 24 2021
%Y A347209 Intersection of A006567 and A080790.
%Y A347209 Subset of A136634.
%Y A347209 Cf. A004086, A030101, A081434.
%K A347209 nonn,base
%O A347209 1,1
%A A347209 _J. M. Bergot_ and _Robert Israel_, Aug 23 2021