login
A371214
Lexicographically earliest sequence of distinct nonnegative integers such that for any n > 0, a(n-1) + a(n) is a multiple of n, and the least value not yet in the sequence appears as soon as possible.
2
0, 1, 7, 2, 22, 3, 45, 4, 76, 5, 115, 6, 18, 8, 216, 9, 279, 10, 350, 11, 429, 12, 516, 13, 611, 14, 714, 15, 825, 16, 944, 17, 47, 19, 1205, 20, 1348, 21, 55, 23, 1657, 24, 1824, 25, 1999, 26, 2182, 27, 2373, 28, 2572, 29, 2779, 30, 2994, 31, 3217, 32, 3448
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) + v is a multiple of 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).
The construction is similar to that of A367288.
This sequence is a variant of A099506 and, by design, is guaranteed to be a permutation of the nonnegative integers (with inverse A371215).
EXAMPLE
The first terms are:
n a(n) (a(n-1) + a(n))/n
-- ---- -----------------
0 0 N/A
1 1 1
2 7 4
3 2 3
4 22 6
5 3 5
6 45 8
7 4 7
8 76 10
9 5 9
10 115 12
11 6 11
12 18 2
PROG
(PARI) See Links section.
CROSSREFS
Cf. A099506, A367288, A371215 (inverse).
Sequence in context: A279807 A282362 A248282 * A213836 A340801 A338284
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Mar 15 2024
STATUS
approved