OFFSET
1,1
COMMENTS
See A065720 for the primes given by these terms considered as numbers written in base 2, i.e., the sequence with the definition "working in the opposite sense". - M. F. Hasler, Jan 05 2014
A subsequence of A020449. - M. F. Hasler, Jan 11 2014
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Alejandro J. Becerra Jr., Python code for computing terms of A089971, A089981, A090707-A090710, A235394-A235395.
Alejandro J. Becerra Jr., Table of n, a(n) for n = 1..42012
EXAMPLE
a(1)=11 is a prime and its decimal representation is also a valid base-2 representation (because all digits are < 2), and 11_2 = 3_10 is again a prime.
MATHEMATICA
Select[ FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 2], PrimeQ] (* Robert G. Wilson v, Jan 05 2014 *)
PROG
(PARI) is_A089971(p)=vecmax(d=digits(p))<2&&isprime(vector(#d, i, 2^(#d-i))*d~)&&isprime(p) \\ "d" is implicitly declared local. Putting isprime(p) to the end improves performance when the function is applied to primes only or to very large numbers. - M. F. Hasler, Jan 05 2014
(PARI) fixBase(n, oldBase, newBase)=my(d=digits(n, oldBase), t=newBase-1); for(i=1, #d, if(d[i]>t, for(j=i, #d, d[j]=t); break)); fromdigits(d, newBase)
list(lim)=my(v=List(), t); forprime(p=2, fixBase(lim\1, 10, 2), if(isprime(t=fromdigits(digits(p, 2), 10)), listput(v, t))); Vec(v) \\ Charles R Greathouse IV, Nov 07 2016
(Python)
from sympy import isprime, primerange
def aupto(limit):
alst = []
for p in primerange(2, limit+1):
t = int(bin(p)[2:])
if isprime(t): alst.append(t)
return alst
print(aupto(2**11)) # Michael S. Branicky, Aug 19 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Cino Hilliard, Jan 18 2004
EXTENSIONS
Definition and example reworded, offset corrected, and cross-references added by M. F. Hasler, Jan 05 2014
STATUS
approved