|
|
A103889
|
|
Odd and even positive integers swapped.
|
|
26
|
|
|
2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15, 18, 17, 20, 19, 22, 21, 24, 23, 26, 25, 28, 27, 30, 29, 32, 31, 34, 33, 36, 35, 38, 37, 40, 39, 42, 41, 44, 43, 46, 45, 48, 47, 50, 49, 52, 51, 54, 53, 56, 55, 58, 57, 60, 59, 62, 61, 64, 63, 66, 65, 68, 67, 70, 69, 72, 71
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
(a(n)-1)*(a(n-1)+1) = 2*A176222(n+1) for n>1; (a(n)-1)*(a(n-3)+1) = 2*A176222(n) for n>3. - Bruno Berselli, Nov 16 2010
For n >= 5, also the number of (undirected) Hamiltonian cycles in the (n-2)-Moebius ladder. - Eric W. Weisstein, May 06 2019
For n >= 4, also the number of (undirected) Hamiltonian cycles in the (n-1)-prism graph. - Eric W. Weisstein, May 06 2019
The lexicographically first involution of the natural numbers with no fixed points. - Alexander Fraebel, Sep 08 2020
|
|
LINKS
|
Table of n, a(n) for n=1..72.
Eric Weisstein's World of Mathematics, Hamiltonian Cycle
Eric Weisstein's World of Mathematics, Moebius Ladder
Eric Weisstein's World of Mathematics, Prism Graph
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
|
|
FORMULA
|
a(2k) = 2k-1 = A005408(k), a(2k-1) = 2k = A005843(k), k=1, 2, ...
O.g.f.: x*(x^2-x+2)/[(x-1)^2*(1+x)]. - R. J. Mathar, Apr 06 2008
a(n) = n-1+2*(n mod 2). - Rolf Pleisch, Apr 22 2008
a(n) = 2*n-a(n-1)-1 (with a(1)=2). - Vincenzo Librandi, Nov 16 2010
a(n) = n-(-1)^n. a(n)-a(n-1)-a(n-2)+a(n-3) = 0 for n>3. - Bruno Berselli, Nov 16 2010
|
|
MATHEMATICA
|
Table[{n + 1, n}, {n, 1, 100, 2}] // Flatten
Table[n - (-1)^n, {n, 25}] (* Eric W. Weisstein, May 06 2019 *)
|
|
PROG
|
[ n eq 1 select 2 else -Self(n-1)+2*n-1: n in [1..72] ];
(Haskell)
import Data.List (transpose)
a103889 n = n - 1 + 2 * mod n 2
a103889_list = concat $ transpose [tail a005843_list, a005408_list]
-- Reinhard Zumkeller, Jun 23 2013, Feb 21 2011
(PARI) a(n)=n-1+if(n%2, 2) \\ Charles R Greathouse IV, Feb 24 2011
|
|
CROSSREFS
|
Essentially the same as A014681.
Odd numbers: A005408. Even numbers: A005843.
Cf. A103889, A004442.
Sequence in context: A167419 A114285 A014681 * A137805 A163501 A306229
Adjacent sequences: A103886 A103887 A103888 * A103890 A103891 A103892
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
Zak Seidov, Feb 20 2005
|
|
STATUS
|
approved
|
|
|
|