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.
%I A085059 #20 Nov 18 2024 09:44:36 %S A085059 1,2,4,1,5,10,4,11,3,12,2,13,1,14,28,13,29,12,30,11,31,10,32,9,33,8, %T A085059 34,7,35,6,36,5,37,4,38,3,39,2,40,1,41,82,40,83,39,84,38,85,37,86,36, %U A085059 87,35,88,34,89,33,90,32,91,31,92,30,93,29,94,28,95,27,96,26,97,25,98,24,99 %N A085059 a(1) = 1, a(n+1) = a(n)-n if a(n) > n else a(n+1) = a(n) + n. %C A085059 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. %H A085059 Reinhard Zumkeller, <a href="/A085059/b085059.txt">Table of n, a(n) for n = 1..10000</a> %F A085059 a(A003462(n)) = 1. - _Reinhard Zumkeller_, Jan 31 2013 %t A085059 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 *) %o A085059 (Haskell) %o A085059 a085059 n = a085059_list !! (n-1) %o A085059 a085059_list = 1 : f 1 1 where %o A085059 f v w = y : f (v + 1) y where %o A085059 y = if w > v then w - v else w + v %o A085059 -- _Reinhard Zumkeller_, Jan 31 2013 %Y A085059 Cf. A005132. %Y A085059 Equals 1+A008344(n). %Y A085059 Cf. A046901. %K A085059 nonn,easy,look %O A085059 1,2 %A A085059 _Amarnath Murthy_ and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 27 2003 %E A085059 More terms from _Sam Alexander_, Oct 20 2003