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
LINKS
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
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