login
A319406
Write n-th prime in binary, then increase each run of 0's by one 0, and increase each run of 1's by one 1. a(n) is the decimal equivalent of the result.
1
12, 7, 51, 15, 103, 115, 195, 199, 207, 243, 63, 1587, 1635, 1639, 415, 1843, 487, 499, 775, 783, 3171, 799, 3271, 3299, 899, 3635, 911, 3687, 3699, 963, 255, 1543, 6243, 6247, 25395, 6351, 6387, 6535, 6543, 26227, 6599, 26419, 1663, 1795, 7219, 1807, 7367
OFFSET
1,1
COMMENTS
Apply A175046 to the primes.
LINKS
PROG
(Python)
from sympy import prime
def a(n):
b = bin(prime(n))[2:]
return int(b.replace("01", "001").replace("10", "110") + b[-1], 2)
print([a(n) for n in range(1, 48)]) # Michael S. Branicky, Dec 07 2021
CROSSREFS
Cf. A175046.
A companion to A318923.
Sequence in context: A364135 A305939 A206423 * A038333 A185259 A090438
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Sep 19 2018
EXTENSIONS
More terms from Rémy Sigrist, Sep 20 2018
STATUS
approved