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.
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
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
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
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.
Comments