A143245 Primes in A098957.
3, 5, 7, 13, 11, 17, 29, 23, 31, 41, 37, 53, 61, 43, 47, 97, 113, 73, 101, 67, 83, 107, 71, 127, 193, 233, 197, 229, 181, 173, 131, 163, 227, 251, 199, 167, 151, 223, 257, 449, 353, 337, 433, 409, 313, 421, 277, 373, 269, 461, 349, 509, 307, 331, 491, 283, 443
Offset: 1
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Gray Code
Crossrefs
Cf. A098957.
Programs
-
Maple
brev:= proc(n) local L; L:= convert(n,base,2); add(L[-i]*2^(i-1),i=1..nops(L)) end proc: select(isprime, [seq(brev(ithprime(i)),i=1..100)]); # Robert Israel, Apr 03 2019
-
Mathematica
GrayCodeList[k_] := Module[{b = IntegerDigits[k, 2], i}, Do[ If[b[[i - 1]] == 1, b[[i]] = 1 - b[[i]]], {i, Length[b], 2, -1} ]; b ]; a[n_] = GrayCodeList[Prime[n]]; a0 = Table[Sum[a[n][[m + 1]]*2^m, {m, 0, Length[a[n]] - 1}], {n, 1, 200}]; Flatten[Table[If[PrimeQ[a0[[n]]], a0[[n]], {}], {n, 1, 200}]]
-
PARI
forprime(p=2, 1e3, v=binary(p); s=0; forstep(i=#v, 1, -1, s+=s+v[i]); if(isprime(s),print1(s", "))) \\ Charles R Greathouse IV, Nov 07 2011
Comments