OFFSET
1,1
LINKS
Jon E. Schoenfield, Table of n, a(n) for n = 1..10000
EXAMPLE
211=11010011_2 is in the sequence, since each of its base-2 suffixes (1010011_2=83, 10011_2=19, 11_2=3, and 1_2=1) is either prime or 1.
MATHEMATICA
First /@ DeleteCases[Map[NestWhileList[# - 2^Floor@ Log2@ # &, #, # > 1 &] &, Prime@ Range[2, 1250]], w_ /; Times @@ Boole[PrimeQ /@ Most@ w] != 1] (* Michael De Vlieger, Nov 22 2016 *)
PROG
(Magma)
/* generates b-file through a(1027)=1770887435474165579843 in a couple of seconds */ /* Note: A[j] is a(j-1) */ A:=[1]; for d in [1..70] do for j in [1..#A] do t:=2^d+A[j]; if IsPrime(t) then A[#A+1]:=t; #A-1, A[#A]; end if; end for; end for; // Jon E. Schoenfield, Nov 23 2016
(PARI)
red(n)=n-(1<<logint(n, 2));
isok(n)=if(n==1, 1, my(r=red(n)); isprime(n)&&isok(red(n)));
forprime (p=3, 10^3, if(isok(p), print1(p, ", ")));
\\ Joerg Arndt, Nov 23 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Randy L. Ekl, Nov 22 2016
STATUS
approved