login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A036952 Numbers whose binary expansion is a decimal prime. 56

%I #33 Feb 19 2023 16:16:42

%S 3,5,23,47,89,101,149,157,163,173,179,185,199,229,247,253,295,313,329,

%T 331,355,367,379,383,405,425,443,453,457,471,523,533,539,565,583,587,

%U 595,631,643,647,653,659,671,675,689,703,709,755,781,785,815,841,855

%N Numbers whose binary expansion is a decimal prime.

%C 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

%C Primes in A007088. - _N. J. A. Sloane_, Feb 17 2023

%H K. D. Bajpai, <a href="/A036952/b036952.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Mo#MWP">Index entries for sequences related to Most Wanted Primes video</a>

%e 1 = 1_2 is not a prime.

%e 2 = 10_2 is not OK because 10 = 2*5 is not a prime.

%e 3 = 11_2 is OK because 11 is a prime.

%e 4 = 100_2 is not OK because 100 = 4*25 is not a prime.

%e 5 = 101_2 is OK because 101 is a prime.

%e 7 = 111_2 is not OK because 111 = 3*37.

%e 11 = 1011_2 is not OK because 1011 = 3*337.

%e 313 = 100111001_2 is OK because 100111001 is prime.

%p A007088 := proc(n)

%p dgs := convert(n,base,2) ;

%p add(op(i,dgs)*10^(i-1),i=1..nops(dgs)) ;

%p end proc:

%p isA036952 := proc(n)

%p isprime( A007088(n)) :

%p end proc:

%p A036952 := proc(n)

%p if n =1 then

%p 3;

%p else

%p for a from procname(n-1)+1 do

%p if isA036952(a) then

%p return a ;

%p end if;

%p end do:

%p end if;

%p end proc:

%p seq(A036952(n),n=1..80) ;

%p # _R. J. Mathar_, Mar 12 2010

%p A036952 := proc() if isprime(convert(n,binary)) then RETURN (n); fi; end: seq(A036952(), n=1..1000); # _K. D. Bajpai_, Jul 04 2014

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

%t NestList[NestWhile[# + 2 &, #, ! PrimeQ[FromDigits[IntegerDigits[#2, 2]]] &, 2] &, 3, 52] (* _Jan Mangaldan_, Jul 02 2020 *)

%o (PARI) is(n)=my(v=binary(n));isprime(sum(i=1,#v,v[i]*10^(#v-i))) \\ _Charles R Greathouse IV_, Jun 28 2013

%Y Cf. A007088, A020449, A036953-A036964.

%Y Union of A156059 and A065720.

%K nonn,base

%O 1,1

%A _Patrick De Geest_, Jan 04 1999

%E Entry revised by _R. J. Mathar_ and _N. J. A. Sloane_, Mar 12 2010

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)