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.

A057165 Indices of addition steps in Recamán's sequence A005132.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 9, 11, 13, 15, 17, 18, 19, 21, 24, 26, 28, 30, 32, 33, 34, 36, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 66, 67, 69, 71, 73, 75, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 101, 102, 104, 106, 108, 112, 113, 114
Offset: 1

Views

Author

N. J. A. Sloane, Sep 14 2000

Keywords

Crossrefs

Union of A187921 and A187922.

Programs

  • Haskell
    import Data.Set (Set, singleton, notMember, insert)
    a057165 n = a057165_list !! n
    a057165_list = r (singleton 0) 1 0 where
       r :: Set Integer -> Integer -> Integer -> [Integer]
       r s n x = if x > n && (x - n) `notMember` s
                    then r (insert (x-n) s) (n+1) (x-n)
                    else n : r (insert (x+n) s) (n+1) (x+n)
    -- Reinhard Zumkeller, Mar 17 2011

Extensions

Initial zero added by N. J. A. Sloane, May 01 2020