cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A319406 #14 Dec 07 2021 10:48:25
%S A319406 12,7,51,15,103,115,195,199,207,243,63,1587,1635,1639,415,1843,487,
%T A319406 499,775,783,3171,799,3271,3299,899,3635,911,3687,3699,963,255,1543,
%U A319406 6243,6247,25395,6351,6387,6535,6543,26227,6599,26419,1663,1795,7219,1807,7367
%N 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.
%C A319406 Apply A175046 to the primes.
%H A319406 Rémy Sigrist, <a href="/A319406/b319406.txt">Table of n, a(n) for n = 1..10000</a>
%o A319406 (Python)
%o A319406 from sympy import prime
%o A319406 def a(n):
%o A319406     b = bin(prime(n))[2:]
%o A319406     return int(b.replace("01", "001").replace("10", "110") + b[-1], 2)
%o A319406 print([a(n) for n in range(1, 48)]) # _Michael S. Branicky_, Dec 07 2021
%Y A319406 Cf. A175046.
%Y A319406 A companion to A318923.
%K A319406 nonn,base
%O A319406 1,1
%A A319406 _N. J. A. Sloane_, Sep 19 2018
%E A319406 More terms from _Rémy Sigrist_, Sep 20 2018