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.

A335302 a(n) = prime(n+1) mod (2^k) where k is the least positive integer such that floor(prime(n)/(2^k)) = floor(prime(n+1)/(2^k)) and prime(n) denotes the n-th prime number.

Original entry on oeis.org

1, 5, 3, 11, 5, 17, 3, 7, 13, 3, 37, 9, 3, 7, 21, 11, 5, 67, 7, 9, 7, 19, 9, 33, 5, 3, 11, 5, 17, 15, 131, 9, 3, 21, 3, 13, 35, 7, 13, 19, 5, 15, 65, 5, 3, 19, 15, 35, 5, 9, 7, 17, 11, 257, 7, 13, 3, 21, 9, 3, 37, 19, 7, 9, 5, 75, 17, 11, 5, 33, 7, 15, 21, 11
Offset: 1

Views

Author

Rémy Sigrist, May 31 2020

Keywords

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.

Examples

			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
		

Crossrefs

Cf. A006519, A014210, A335301 (decimal variant).

Programs

  • 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))) }

Formula

a(n) <= prime(n+1) with equality iff prime(n+1) belongs to A014210.