OFFSET
1,2
COMMENTS
To build the sequence:
- we start with a(1) = 1,
- once we have n terms, let v be the least value not yet in the sequence,
- if a(1) + ... 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 so as to meet the required conditions (this is always possible as n+1 and n+2 are coprime).
The construction is similar to that of A367288.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, PARI program
EXAMPLE
The first terms, alongside the average of the first terms, are:
n a(n) (a(1)+...+a(n))/n
-- ---- -----------------
1 1 1
2 3 2
3 2 2
4 10 4
5 4 4
6 52 12
7 5 11
8 43 15
9 6 14
10 54 18
11 7 17
12 65 21
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Mar 15 2024
STATUS
approved