OFFSET
1,1
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..25000
Rémy Sigrist, C++ program for A187943
EXAMPLE
PROG
(Haskell)
import Data.Set (Set, singleton, member, insert)
a187922 n = a187922_list !! (n-1)
a187922_list = r (singleton 0) 1 0 where
r :: Set Integer -> Integer -> Integer -> [Integer]
r s n x | x <= n = r (insert (x+n) s) (n+1) (x+n)
| (x-n) `member` s = n : r (insert (x+n) s) (n+1) (x+n)
| otherwise = r (insert (x-n) s) (n+1) (x-n)
(C++) See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Mar 17 2011
EXTENSIONS
Added condition "0 < m" to definition. See A333552. - N. J. A. Sloane, May 04 2020
STATUS
approved