OFFSET
1,2
COMMENTS
This sequence is a permutation of the natural numbers.
LINKS
Alois P. Heinz Table of n, a(n) for n = 1..10000
Eric Angelini, Colour, read and jump sequence
E. Angelini, Colour, drag and drop sequence [Cached copy, with permission]
E. Angelini, Color, read and jump sequence [Cached copy, with permission]
MAPLE
mx:= 620: # increase mx to get more items
l:= [i$i=1..2*mx]: pos:= proc(n) global l; local i; for i to nops(l) while l[i]<>n do od; `if`(i>nops(l), -1, i) end: for n from 1 to mx do p:= pos(n); k:= l[p+1]; l:= [l[1..p-1][], l[p+1..p+k][], l[p], l[p+k+1..nops(l)][]] od: p:= pos(mx+1): a:= n-> `if`(n<p, l[n], NULL): seq(a(n), n=1..p);
MATHEMATICA
max = 200; r = Range[max]; For[n = 1, True, n++, p = Position[r, n]; If[p == {} || (q = p[[1, 1]] + r[[p[[1, 1]] + 1]] + 1) > max, Break[], c = r[[q]]; r = r /. {a___, n, b___, c, d___} :> {a, b, n, c, d}]]; A164287 = r[[1 ;; 72]] (* Jean-François Alcover, Jun 14 2012 *)
CROSSREFS
KEYWORD
AUTHOR
Eric Angelini and Alois P. Heinz, Aug 12 2009
STATUS
approved