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!)
A143245 Primes in A098957. 1

%I #17 Apr 03 2019 15:07:08

%S 3,5,7,13,11,17,29,23,31,41,37,53,61,43,47,97,113,73,101,67,83,107,71,

%T 127,193,233,197,229,181,173,131,163,227,251,199,167,151,223,257,449,

%U 353,337,433,409,313,421,277,373,269,461,349,509,307,331,491,283,443

%N Primes in A098957.

%H Robert Israel, <a href="/A143245/b143245.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/GrayCode.html">Gray Code</a>

%p brev:= proc(n) local L;

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

%p add(L[-i]*2^(i-1),i=1..nops(L))

%p end proc:

%p select(isprime, [seq(brev(ithprime(i)),i=1..100)]); # _Robert Israel_, Apr 03 2019

%t 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}]]

%o (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

%Y Cf. A098957.

%K nonn,look,base

%O 1,1

%A _Roger L. Bagula_ and _Gary W. Adamson_, Oct 21 2008

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 16 19:21 EDT 2024. Contains 371754 sequences. (Running on oeis4.)