login
A127367
Inverse permutation to A127366.
2
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,2
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]
PROG
(Haskell)
a127367 n | even n = n - m + 1
| otherwise = n + m
where m = length $ takeWhile (<= n) a002378_list
-- Reinhard Zumkeller, Oct 12 2011
CROSSREFS
Cf. A002378 (oblong numbers).
Sequence in context: A345967 A094512 A182650 * A054084 A296069 A058683
KEYWORD
nonn
AUTHOR
STATUS
approved