login
A098957
Decimal value of the reverse binary expansion of the prime numbers.
8
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
OFFSET
1,2
COMMENTS
15 of the first 16 terms happen to be prime. As terms increase, the preponderance of primes apparently decreases.
LINKS
FORMULA
a(n) = decimal(reverse(binary(prime(n)))) where prime(n) is the n-th prime.
a(n) = A030101(A000040(n)). - Rémy Sigrist, Oct 19 2022
EXAMPLE
a(14) = 53 because the 14th prime is 43, or 101011 binary; reverse of 101011 is 110101, or 53 decimal.
MAPLE
a:= proc(n) local m, r; m, r:= ithprime(n), 0;
while m>0 do r:= r*2+irem(m, 2, 'm') od; r
end:
seq(a(n), n=1..60); # Alois P. Heinz, Mar 08 2018
MATHEMATICA
Table[FromDigits[Reverse[IntegerDigits[Prime[n], 2]], 2], {n, 100}] (* Alonso del Arte, Mar 05 2018 *)
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
(Python)
from sympy import prime
def A098957(n): return int(bin(prime(n))[:1:-1], 2) # Chai Wah Wu, Feb 17 2022
CROSSREFS
Sequence in context: A137576 A161329 A111745 * A143245 A018205 A370762
KEYWORD
base,nonn
AUTHOR
Gil Broussard, Oct 21 2004
STATUS
approved