OFFSET
1,2
COMMENTS
In other words, the binary representation of a(n) is the smallest suffix to be overlaid on the binary representation of the n-th prime number to obtain that of the next prime number.
This sequence has similarities with A006519; here we consider consecutive prime numbers, there consecutive nonnegative integers.
There are no two consecutive equal terms.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
FORMULA
a(n) <= prime(n+1) with equality iff prime(n+1) belongs to A014210.
EXAMPLE
The first terms, alongside the binary representations of a(n) and of prime(n+1), are:
n a(n) bin(a(n)) bin(prime(n+1))
-- ---- --------- ---------------
0 N/A N/A 10
1 1 1 11
2 5 101 101
3 3 11 111
4 11 1011 1011
5 5 101 1101
6 17 10001 10001
7 3 11 10011
8 7 111 10111
9 13 1101 11101
10 3 11 11111
PROG
(PARI) { base=2; p=2; forprime (q=p+1, 379, for (k=0, oo, m=base^k; if (q\m == p\m, print1 (q%m", "); p=q; break))) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, May 31 2020
STATUS
approved