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”).

A102568
a(n+1) = if a(n-1)=a(n)-1 then 2*a(n) else smallest number not occurring earlier; a(1)=1, a(2)=2.
4
1, 2, 4, 3, 5, 6, 12, 7, 8, 16, 9, 10, 20, 11, 13, 14, 28, 15, 17, 18, 36, 19, 21, 22, 44, 23, 24, 48, 25, 26, 52, 27, 29, 30, 60, 31, 32, 64, 33, 34, 68, 35, 37, 38, 76, 39, 40, 80, 41, 42, 84, 43, 45, 46, 92, 47, 49, 50, 100, 51, 53, 54, 108, 55, 56, 112, 57, 58, 116, 59, 61
OFFSET
1,2
COMMENTS
Permutation of the natural numbers with inverse A102569;
a(n) <= 2*n; a(n) <> n for n>6;
A102570(n) = a(a(n)).
MATHEMATICA
Nest[Append[#, If[#[[-1]] == #[[-2]] + 1, 2 #[[-1]], Min[Complement[Range[Max[#] + 1], #]]]] &, {1, 2}, 69] (* Ivan Neretin, Sep 08 2015 *)
CROSSREFS
Sequence in context: A338252 A086434 A086433 * A338834 A338835 A210536
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jan 15 2005
STATUS
approved