login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A036952 Numbers whose binary expansion is a decimal prime. 55
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 (list; graph; refs; listen; history; text; internal format)
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

LINKS

K. D. Bajpai, Table of n, a(n) for n = 1..10000

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 *)

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

Cf. A020449, A036953-A036964.

Union of A156059 and A065720.

Sequence in context: A199336 A214876 A280273 * A065720 A148554 A120937

Adjacent sequences:  A036949 A036950 A036951 * A036953 A036954 A036955

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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified June 24 08:22 EDT 2017. Contains 288697 sequences.