

A118966


If n doesn't occur among the first (n1) terms of the sequence, then a(n)= 2n1. If n occurs among the first (n1) terms of the sequence, then a(n) = (n+1)/2.


1



1, 3, 2, 7, 9, 11, 4, 15, 5, 19, 6, 23, 25, 27, 8, 31, 33, 35, 10, 39, 41, 43, 12, 47, 13, 51, 14, 55, 57, 59, 16, 63, 17, 67, 18, 71, 73, 75, 20, 79, 21, 83, 22, 87, 89, 91, 24, 95, 97, 99, 26, 103, 105, 107, 28, 111, 29, 115, 30, 119, 121, 123, 32, 127, 129, 131, 34, 135
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

Sequence is a permutation of the positive integers. It also is its own inverse (i.e. a(a(n)) = n).


LINKS

Table of n, a(n) for n=1..68.


MATHEMATICA

f[s_] := Block[{n = Length@s}, Append[s, If[MemberQ[s, n], (n + 1)/2, 2n  1]]]; Rest@Nest[f, {1}, 70]  Robert G. Wilson v, May 16 2006


CROSSREFS

Cf. A118967.
Sequence in context: A026186 A026210 A257326 * A018891 A034423 A193859
Adjacent sequences: A118963 A118964 A118965 * A118967 A118968 A118969


KEYWORD

easy,nonn


AUTHOR

Leroy Quet, May 07 2006


EXTENSIONS

More terms from Robert G. Wilson v, May 16 2006


STATUS

approved



