OFFSET
1,2
COMMENTS
This sequence is a permutation of the nonnegative integers (when n is prime, a(n) is the least value not yet in the sequence).
The inverse sequence (A355066) has similarities with the Two-Up sequence (A090252) as A355066(n) is coprime to the next n terms (and to the floor(n/2) previous terms).
Note that the relation "u does not belong to the interval ceiling(v/2)..2*v" is symmetrical (for u, v > 0).
LINKS
EXAMPLE
The first terms, alongside the forbidden values, are:
n a(n) Forbidden values
-- ---- ---------------------------------------------------
1 1 None
2 2 None
3 3 None
4 5 1..4 (from m=2)
5 4 None
6 11 1..4 (from m=2), 2..6 (from m=3), 3..10 (from m=4)
7 6 None
8 23 1..4 (from m=2), 3..10 (from m=4), 6..22 (from m=6)
9 24 2..6 (from m=3), 6..22 (from m=6)
10 47 1..4 (from m=2), 3..10 (from m=4), 2..8 (from m=5),
6..22 (from m=6), 12..46 (from m=8)
11 7 None
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Jun 17 2022
STATUS
approved