OFFSET
1,3
COMMENTS
If we drop the constraint "if n = least k > m such that a(k) = a(m) then m and n have a different parity" then we obtain the natural numbers interspersed with 1's: 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, ...
Conjecturally, (a(n), a(n+1)) uniquely runs over all pairs of positive integers (this is the motivation for this sequence).
This sequence has similarities with:
- A226005 whose pairs of consecutive terms run over all pairs of positive integers,
- A290633 whose pairs of consecutive terms (conjecturally) run over all pairs of noncoprime positive integers.
The representation of the first pairs of consecutive terms has nice features.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, PARI program for A291712
EXAMPLE
a(1) = 1 is suitable.
a(2) = 1 is suitable.
a(3) cannot equal 1 as the pair (1,1) has already been visited.
a(3) = 2 is suitable.
a(4) cannot equal 1 as the previous occurrence of 1 happened at even index.
a(4) = 2 is suitable.
a(5) = 1 is suitable.
a(6) cannot equal 1 as the pair (1,1) has already been visited.
a(6) cannot equal 2 as the previous occurrence of 2 happened at even index.
a(6) = 3 is suitable.
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Aug 30 2017
STATUS
approved