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.

A064664 Regard A064413 as giving a permutation of the positive integers; sequence gives inverse permutation.

Original entry on oeis.org

1, 2, 5, 3, 10, 4, 14, 8, 6, 9, 20, 7, 28, 13, 11, 17, 33, 12, 37, 18, 15, 19, 43, 16, 24, 27, 22, 26, 57, 23, 61, 31, 21, 32, 25, 30, 67, 36, 29, 40, 74, 35, 81, 41, 39, 42, 89, 45, 50, 46, 34, 47, 100, 48, 53, 49, 38, 56, 107, 52, 115, 60, 51, 64, 54, 59, 128, 65, 44, 55
Offset: 1

Views

Author

N. J. A. Sloane, Oct 11 2001

Keywords

Comments

The Mathematica program computes the EKG sequence A064413 and then determines the inverse permutation. - T. D. Noe, Nov 13 2002

Examples

			Original permutation has cycles (1) (2) (3, 4, 6, 9, 10, 5) (..., 20, 18, 12, 7, 14, 13, 28, 26, ...) (8) ...
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a064664 = (+ 1) . fromJust . (`elemIndex` a064413_list)
    -- Reinhard Zumkeller, May 01 2014, Sep 17 2011
  • Mathematica
    maxN=200; lst={1, 2}; unused=Range[3, maxN]; found=True; While[found, found=False; i=0; While[ !found&&i1, found=True; AppendTo[lst, unused[[i]]]; unused=Delete[unused, i]]]]; Take[Ordering[lst], unused[[1]]-1]