OFFSET
1,2
EXAMPLE
We start with 1,2,3,4,5,6,7,8,9,10,... We repeat the 2, inserting the new copy after the 3, which gives 1,2,3,2,4,5,6,7,8,... Then we insert two additional copies of the 3 in the earliest non-consecutive locations after the first 3, which gives 1,2,3,2,3,4,3,5,6,7,8,... And so on.
PROG
(PARI) Axxx ( N = 99, a = List([1..N]), i = 1 ) = {
for( n = 1, N, for ( j = 1, n-1,
if ( i+2*j > #a+1, N = 0; break); list insert ( a, n, i + 2*j )
) ; until ( i > #a || a[i] > n, i++ ) ; N || break ); a[1..min(i+1, #a)]}/* \\ From M. F. Hasler via Seqfan, Jul 10 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Ali Sada, Jul 09 2023
STATUS
approved