OFFSET
1,3
COMMENTS
A085059 is the smallest positive sequence such that the first order absolute difference is {1,2,3,4,...}. Other related sequences may be found by searching for the words "absolute difference" with the "Lookup" facility.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
EXAMPLE
For the initial terms, no smaller positive terms work than
Sequence {a(n)}: 1,1,2,5,5,1,10,7,17,15,4,3,...
First absolute difference: 0,1,3,0,4,9,3,10,2,11,1,...
Second absolute difference: 1,2,3,4,5,6,7,8,9,10,...
PROG
(Haskell)
a086283 n = x086283_list !! (n-1)
a086283_list = 1 : 1 : f 1 0 [1..] where
f x y (z:zs) = u : f u (abs $ x - u) zs where
u = minimum [if v < x then x - v else x + v |
v <- if y < z then [y + z] else [y + z, y - z]]
-- Reinhard Zumkeller, Oct 17 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
John W. Layman, Aug 28 2003
STATUS
approved