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.

A272570 Inverse permutation to A175500.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 14, 8, 16, 12, 18, 13, 20, 19, 22, 24, 28, 33, 35, 15, 25, 37, 39, 26, 41, 27, 43, 30, 45, 47, 49, 17, 51, 53, 62, 29, 55, 57, 64, 31, 66, 84, 82, 21, 58, 70, 88, 74, 86, 59, 90, 60, 94, 96, 92, 23, 98, 102, 76, 32, 112, 68
Offset: 1

Views

Author

Max Barrentine, May 03 2016

Keywords

Crossrefs

Cf. A175500.

Programs

  • Mathematica
    p = Last /@ Import["https://oeis.org/A175500/b175500.txt", "Table"]; n = First[ Complement[ Range[10^4], p]] - 1; ip = 0 Range@ n; Do[If[(v = p[[i]]) <= n, ip[[v]] = i], {i, Length@p}]; ip (* Giovanni Resta, May 21 2016 *)
  • PARI
    ok(j, va, vs, n) = {if (vecsearch(vs, j), return (0)); for (k=1, n-1, if ((numdiv(j) == numdiv(va[k])) && (numdiv(va[k-1]) == numdiv(va[n-1])), return (0));); 1;}
    findnew(va, vs, n) = {my(j = 1); my(vs = vecsort(va)); until (ok(j, va, vs, n), j++); j;}
    listb(nn) = {my(va = [1]); for (n=2, nn, vs = vecsort(va); newa = findnew(va, vs, n); va = concat(va, newa);); va;}
    invp(v) = {for (i=1, vecmax(v), found = 0; for (k=1, #v, if (v[k] == i, found = k; break);); if (! found, break); print1(found, ", "););}
    lista(nn) = invp(listb(nn)); \\ Michel Marcus, May 04 2016