OFFSET
1,3
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10001
Nick Hobson, Python program for this sequence
C. L. Mallows, Plot (jpeg) of first 10000 terms of A005132
C. L. Mallows, Plot (postscript) of first 10000 terms of A005132
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Sep 14 2000
EXTENSIONS
Initial zero added by N. J. A. Sloane, May 01 2020
STATUS
approved