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.

A036952 Numbers whose binary expansion is a decimal prime.

This page as a plain text file.
%I A036952 #33 Feb 19 2023 16:16:42
%S A036952 3,5,23,47,89,101,149,157,163,173,179,185,199,229,247,253,295,313,329,
%T A036952 331,355,367,379,383,405,425,443,453,457,471,523,533,539,565,583,587,
%U A036952 595,631,643,647,653,659,671,675,689,703,709,755,781,785,815,841,855
%N A036952 Numbers whose binary expansion is a decimal prime.
%C A036952 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 A036952 Primes in A007088. - _N. J. A. Sloane_, Feb 17 2023
%H A036952 K. D. Bajpai, <a href="/A036952/b036952.txt">Table of n, a(n) for n = 1..10000</a>
%H A036952 <a href="/index/Mo#MWP">Index entries for sequences related to Most Wanted Primes video</a>
%e A036952 1 = 1_2 is not a prime.
%e A036952 2 = 10_2 is not OK because 10 = 2*5 is not a prime.
%e A036952 3 = 11_2 is OK because 11 is a prime.
%e A036952 4 = 100_2 is not OK because 100 = 4*25 is not a prime.
%e A036952 5 = 101_2 is OK because 101 is a prime.
%e A036952 7 = 111_2 is not OK because 111 = 3*37.
%e A036952 11 = 1011_2 is not OK because 1011 = 3*337.
%e A036952 313 = 100111001_2 is OK because 100111001 is prime.
%p A036952 A007088 := proc(n)
%p A036952 dgs := convert(n,base,2) ;
%p A036952 add(op(i,dgs)*10^(i-1),i=1..nops(dgs)) ;
%p A036952 end proc:
%p A036952 isA036952 := proc(n)
%p A036952 isprime( A007088(n)) :
%p A036952 end proc:
%p A036952 A036952 := proc(n)
%p A036952 if n =1 then
%p A036952 3;
%p A036952 else
%p A036952 for a from procname(n-1)+1 do
%p A036952 if isA036952(a) then
%p A036952 return a ;
%p A036952 end if;
%p A036952 end do:
%p A036952 end if;
%p A036952 end proc:
%p A036952 seq(A036952(n),n=1..80) ;
%p A036952 # _R. J. Mathar_, Mar 12 2010
%p A036952 A036952 := proc() if isprime(convert(n,binary)) then RETURN (n); fi; end: seq(A036952(), n=1..1000);  # _K. D. Bajpai_, Jul 04 2014
%t A036952 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 A036952 NestList[NestWhile[# + 2 &, #, ! PrimeQ[FromDigits[IntegerDigits[#2, 2]]] &, 2] &, 3, 52] (* _Jan Mangaldan_, Jul 02 2020 *)
%o A036952 (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 A036952 Cf. A007088, A020449, A036953-A036964.
%Y A036952 Union of A156059 and A065720.
%K A036952 nonn,base
%O A036952 1,1
%A A036952 _Patrick De Geest_, Jan 04 1999
%E A036952 Entry revised by _R. J. Mathar_ and _N. J. A. Sloane_, Mar 12 2010