login
A036952
Numbers whose binary expansion is a decimal prime.
56
3, 5, 23, 47, 89, 101, 149, 157, 163, 173, 179, 185, 199, 229, 247, 253, 295, 313, 329, 331, 355, 367, 379, 383, 405, 425, 443, 453, 457, 471, 523, 533, 539, 565, 583, 587, 595, 631, 643, 647, 653, 659, 671, 675, 689, 703, 709, 755, 781, 785, 815, 841, 855
OFFSET
1,1
COMMENTS
A100051(f(a(n))) = 1 with f(x) = if x<2 then x else 10*f(floor(x/2)) + x mod 2. - Reinhard Zumkeller, Mar 31 2010
Primes in A007088. - N. J. A. Sloane, Feb 17 2023
EXAMPLE
1 = 1_2 is not a prime.
2 = 10_2 is not OK because 10 = 2*5 is not a prime.
3 = 11_2 is OK because 11 is a prime.
4 = 100_2 is not OK because 100 = 4*25 is not a prime.
5 = 101_2 is OK because 101 is a prime.
7 = 111_2 is not OK because 111 = 3*37.
11 = 1011_2 is not OK because 1011 = 3*337.
313 = 100111001_2 is OK because 100111001 is prime.
MAPLE
A007088 := proc(n)
dgs := convert(n, base, 2) ;
add(op(i, dgs)*10^(i-1), i=1..nops(dgs)) ;
end proc:
isA036952 := proc(n)
isprime( A007088(n)) :
end proc:
A036952 := proc(n)
if n =1 then
3;
else
for a from procname(n-1)+1 do
if isA036952(a) then
return a ;
end if;
end do:
end if;
end proc:
seq(A036952(n), n=1..80) ;
# R. J. Mathar, Mar 12 2010
A036952 := proc() if isprime(convert(n, binary)) then RETURN (n); fi; end: seq(A036952(), n=1..1000); # K. D. Bajpai, Jul 04 2014
MATHEMATICA
f[n_, k_]:=FromDigits[IntegerDigits[n, k]]; lst={}; Do[If[PrimeQ[f[n, 2]], AppendTo[lst, n]], {n, 7!}]; lst (* Vladimir Joseph Stephan Orlovsky, Mar 12 2010 *)
NestList[NestWhile[# + 2 &, #, ! PrimeQ[FromDigits[IntegerDigits[#2, 2]]] &, 2] &, 3, 52] (* Jan Mangaldan, Jul 02 2020 *)
PROG
(PARI) is(n)=my(v=binary(n)); isprime(sum(i=1, #v, v[i]*10^(#v-i))) \\ Charles R Greathouse IV, Jun 28 2013
CROSSREFS
Union of A156059 and A065720.
Sequence in context: A199336 A214876 A280273 * A065720 A148554 A120937
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Jan 04 1999
EXTENSIONS
Entry revised by R. J. Mathar and N. J. A. Sloane, Mar 12 2010
STATUS
approved