OFFSET
0,3
COMMENTS
To build the sequence:
- we start with a(0) = 0, 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 n+1 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 n+1 and n+2 are coprime).
This construction is similar to that of A352713.
LINKS
EXAMPLE
The first terms are:
n a(n) a(n-1) mod n a(n) mod n
-- ---- ------------ ----------
0 0 N/A N/A
1 1 0 0
2 5 1 1
3 2 2 2
4 18 2 2
5 3 3 3
6 39 3 3
7 4 4 4
8 60 4 4
9 6 6 6
10 106 6 6
11 7 7 7
12 151 7 7
13 8 8 8
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Nov 12 2023
STATUS
approved