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.

A225850 Inverse of permutation in A167151.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 8, 5, 10, 12, 14, 16, 7, 18, 20, 22, 24, 26, 9, 28, 30, 32, 34, 36, 38, 40, 11, 42, 44, 46, 48, 50, 52, 54, 56, 13, 58, 60, 62, 64, 66, 68, 70, 72, 74, 15, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 17, 96, 98, 100, 102, 104, 106, 108, 110, 112
Offset: 0

Views

Author

Reinhard Zumkeller, May 17 2013

Keywords

Comments

For n > 0: a(A005228(n)) = 2*n-1 and a(A030124(n)) = 2*n.
For n > 0: A232739(n) = a(A232739(n+1))/2. - Antti Karttunen, Dec 04 2013

Crossrefs

Inverse permutation: A167151.
Cf. also A005228, A030124, A232739, A232746, A232747, A232749, and also the permutation pair A232751/A232752.

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a225850 = fromJust . (`elemIndex` a167151_list)
    
  • Mathematica
    nmax = 100; A5228 = {1};
    Module[{d = 2, k = 1}, Do[While[MemberQ[A5228, d], d++]; k += d; d++; AppendTo[A5228, k], {n, 1, nmax}]];
    a46[n_] := For[k = 1, True, k++, If[A5228[[k]] > n, Return[k - 1]]];
    a47[n_] := If[n == 1, 1, a46[n] (a46[n] - a46[n - 1])];
    a48[n_] := a48[n] = If[n == 1, 0, a48[n-1] + (1 - (a46[n] - a46[n-1]))];
    a49[n_] := If[n == 1, 0, a48[n] (a48[n] - a48[n - 1])];
    a[n_] := If[n < 3, n, 2 (a47[n] + a49[n]) - (a46[n] - a46[n - 1])];
    Table[a[n], {n, 0, nmax}] (* Jean-François Alcover, Dec 09 2021 *)
  • Scheme
    (define (A225850 n) (if (< n 3) n (- (* 2 (+ (A232747 n) (A232749 n))) (- (A232746 n) (A232746 (- n 1))))))
    ;; Antti Karttunen, Dec 04 2013

Formula

If n < 3, a(n) = n, otherwise a(n) = (2*(A232747(n)+A232749(n))) - (A232746(n)-A232746(n-1)). - Antti Karttunen, Dec 04 2013