OFFSET
1,2
COMMENTS
Let (3^k-1)/2 = r then a((3^k-1)/2) = a(r) = 1 and a(r-1) = r. Geometrical interpretation. The sequence is obtained by the following rule: A point moves on the positive number line with the rule that in every step it has to move one unit more than the previous step and with the aim that it is to be as close to 0 as possible but on the positive side.
a(A003462(n)) = 1. - Reinhard Zumkeller, Jan 31 2013
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
MATHEMATICA
RecurrenceTable[{a[1]==1, a[n+1]==If[a[n]>n, a[n]-n , a[n]+n]}, a[n], {n, 80}] (* Harvey P. Dale, May 11 2011 *)
PROG
(Haskell)
a085059 n = a085059_list !! (n-1)
a085059_list = 1 : f 1 1 where
f v w = y : f (v + 1) y where
y = if w > v then w - v else w + v
-- Reinhard Zumkeller, Jan 31 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 27 2003
EXTENSIONS
More terms from Sam Alexander, Oct 20 2003
STATUS
approved