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.

A115409 Inverse integer permutation of A115408.

Original entry on oeis.org

1, 5, 4, 7, 6, 2, 17, 16, 12, 10, 20, 19, 15, 13, 3, 43, 42, 38, 36, 26, 23, 51, 50, 46, 44, 34, 31, 8, 105, 104, 100, 98, 88, 85, 62, 54, 114, 113, 109, 107, 97, 94, 71, 63, 9
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 22 2006

Keywords

Comments

Seen as a triangle read by rows T(n,k) = a(n*(n-1)/2+k) = A024431(n)-A024431(k-1), 1<=k<=n.
T(n,1) = A024431(n)-1; T(n,n) = A247414(n-1). - Reinhard Zumkeller, Sep 16 2014

Examples

			Triangle begins:
1;
5, 4;
7, 6, 2;
17, 16, 12, 10;
20, 19, 15, 13, 3;
...
		

Crossrefs

Programs

  • Haskell
    import Data.List (inits)
    a115409 n k = a115409_tabl !! (n-1) !! (k-1)
    a115409_row n = a115409_tabl !! (n-1)
    a115409_tabl = map f $ drop 2 $ inits a024431_list where
       f xs = reverse $ map (z -) zs where (z:zs) = reverse xs
    a115409_list = concat a115409_tabl
    -- Reinhard Zumkeller, Sep 16 2014
  • Mathematica
    nmax = 9;
    differenceQ[seq_, x_] := Module[{r = False}, Do[If[x==seq[[k]] - seq[[j]], r = True; Break[]], {j, 1, Length[seq]}, {k, 1, Length[seq]}]; r];
    seq[1] = {1, 2};
    seq[i_] := seq[i] = Module[{j, k}, k = Max[seq[i-1]]; j = First[Select[ Range[k], !differenceQ[seq[i-1], #]&, 1]]; Union[seq[i-1], {2k+2, 2k+2+j}]];
    A024431 = seq[nmax];
    T[n_, k_] := A024431[[n+1]] -  A024431[[k]];
    Table[T[n, k], {n, 1, nmax}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 20 2021 *)