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.

A127367 Inverse permutation to A127366.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Let m be the largest number such that n >= m(m+1). If n is even, a(n) = n - m; otherwise a(n) = n + m + 1.
a(A005408(n)) > 0; a(A005843(n)) <= 0. [Reinhard Zumkeller, Oct 12 2011]

Crossrefs

Cf. A002378 (oblong numbers).

Programs

  • Haskell
    a127367 n | even n    = n - m + 1
              | otherwise = n + m
              where m = length $ takeWhile (<= n) a002378_list
    -- Reinhard Zumkeller, Oct 12 2011