cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A116941 Permutation of the natural numbers in conjunction with A116939 and A003056.

Original entry on oeis.org

0, 1, 3, 2, 4, 6, 5, 7, 9, 11, 8, 10, 12, 14, 16, 13, 15, 17, 19, 21, 23, 18, 20, 22, 24, 26, 28, 30, 25, 27, 29, 31, 33, 35, 37, 39, 32, 34, 36, 38, 40, 42, 44, 46, 48, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 61, 63, 65, 67, 69, 71, 73
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 27 2006

Keywords

Comments

Inverse: A116942;
A003056(n) = A116939(a(n)).

Programs

  • Haskell
    a116941 n = a116941_list !! n
    a116941_list = f 0 1 (zip a116939_list [0..]) [] where
       f u v xis'@((x,i):xis) ws
         | x == u    = i : f u v xis ws
         | x == v    = f u v xis (i : ws)
         | otherwise = reverse ws ++ f v x xis' []
    -- Reinhard Zumkeller, Jun 28 2013
  • Mathematica
    Table[ Ceiling[(n -1)^2/2] + 2k -2, {n, 12}, {k, n}] // Flatten (* Robert G. Wilson v, Mar 09 2017 after Ivan Neretin in A074147 *)

Formula

a(n) = A074147(n+1) - 1. - Robert G. Wilson v, Mar 09 2017