|
| |
|
|
A098957
|
|
Decimal value of the reverse binary expansion of the prime numbers.
|
|
5
| |
|
|
1, 3, 5, 7, 13, 11, 17, 25, 29, 23, 31, 41, 37, 53, 61, 43, 55, 47, 97, 113, 73, 121, 101, 77, 67, 83, 115, 107, 91, 71, 127, 193, 145, 209, 169, 233, 185, 197, 229, 181, 205, 173, 253, 131, 163, 227, 203, 251, 199, 167, 151, 247, 143, 223, 257, 449, 353, 481, 337
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 1,2
|
|
|
COMMENTS
| 15 of the first 16 terms happen to be prime. As terms increase, the preponderance of primes apparently decreases.
|
|
|
LINKS
| Eric Weisstein's World of Mathematics, Grey Code
|
|
|
FORMULA
| a(n) = Decimal(reverse(Binary(p(n)))) where p(n) is the n-th prime.
a(n)=GrayCodeBinarySum[Prime[n]). - Roger L. Bagula and Gary W. Adamson (rlbagulatftn(AT)yahoo.com), Oct 21 2008
|
|
|
EXAMPLE
| a(14)=53 because the 14th prime is 43, or 101011 binary; reverse of 101011 is 110101, or 53 decimal.
|
|
|
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]]; Table[Sum[a[n][[m + 1]]*2^m, {m, 0, Length[a[n]] - 1}], {n, 1, 200}] - Roger L. Bagula and Gary W. Adamson (rlbagulatftn(AT)yahoo.com), Oct 21 2008
|
|
|
PROG
| (PARI) a(n)=my(v=binary(prime(n)), s); forstep(i=#v, 1, -1, s+=s+v[i]); s \\ Charles R Greathouse IV, Aug 17 2011
|
|
|
CROSSREFS
| Sequence in context: A137576 A161329 A111745 * A143245 A018205 A121047
Adjacent sequences: A098954 A098955 A098956 * A098958 A098959 A098960
|
|
|
KEYWORD
| base,nonn
|
|
|
AUTHOR
| Gil Broussard (kikiriki(AT)mindspring.com), Oct 21 2004
|
| |
|
|