OFFSET
1,2
COMMENTS
To build the sequence:
- we start with a(1) = 1, and repeatedly:
- let a(n) be the last known term and v the least value not yet in the sequence,
- if a(n) and v are congruent modulo the n-th prime number then a(n+1) = v,
- otherwise a(n+2) = v and a(n+1) is chosen as small as possible in such a way as to satisfy the required congruences (this is always possible as two consecutive prime numbers are coprime).
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, PARI program
EXAMPLE
The first terms are:
n a(n) a(n) mod prime(n) a(n+1) mod prime(n)
-- ----- ----------------- -------------------
1 1 1 1
2 5 2 2
3 2 2 2
4 17 3 3
5 3 3 3
6 69 4 4
7 4 4 4
8 310 6 6
9 6 6 6
10 558 7 7
11 7 7 7
12 193 8 8
13 8 8 8
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Nov 12 2023
STATUS
approved