OFFSET
1,2
COMMENTS
Sequence is a permutation of the positive integers.
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..10000
MAPLE
A101261 := proc(nmax) local a, n, anex ; a := [1, 2] ; while nops(a) < nmax do if nops(a) mod 2 = 0 then a := [op(a), 1] ; else n := (nops(a)+1)/2 ; n := op(n, a) ; anex := 2 ; while anex in a or n > 1 do if not anex in a then n := n-1 ; fi ; anex := anex+1 ; od ; a := [op(a), anex] ; fi ; od ; RETURN(a) ; end: A101905 := proc(nmax) local a, n, anex ; a := A101261(2*nmax) ; for n from 2*nmax-1 to 3 by -2 do a := subsop(n=NULL, a) ; od ; RETURN(a) ; end: A101905(80) ; # R. J. Mathar, May 02 2007
MATHEMATICA
a = {1}; Do[AppendTo[a, Complement[Range[Max[a] + (d = If[EvenQ[n], 1, a[[(n + 1)/2]]])], a][[d]]], {n, 2, 71}]; a (* Ivan Neretin, May 03 2015 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Leroy Quet, Dec 20 2004
EXTENSIONS
More terms from R. J. Mathar, May 02 2007
STATUS
approved