login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A101905
a(1) = 1; a(n+1) = A101261(2n).
2
1, 2, 4, 3, 8, 5, 9, 6, 16, 7, 14, 10, 21, 11, 19, 12, 32, 13, 24, 15, 34, 17, 30, 18, 45, 20, 36, 22, 47, 23, 40, 25, 64, 26, 44, 27, 59, 28, 51, 29, 74, 31, 56, 33, 73, 35, 61, 37, 93, 38, 67, 39, 87, 41, 72, 42, 103, 43, 78, 46, 99, 48, 83, 49, 128, 50, 88, 52, 111, 53, 92
OFFSET
1,2
COMMENTS
Sequence is a permutation of the positive integers.
LINKS
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
Sequence in context: A331585 A191729 A075378 * A297075 A306458 A287637
KEYWORD
easy,nonn
AUTHOR
Leroy Quet, Dec 20 2004
EXTENSIONS
More terms from R. J. Mathar, May 02 2007
STATUS
approved