login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A085059 a(1) = 1, a(n+1) = a(n)-n if a(n) > n else a(n+1) = a(n) + n. 2
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, 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, 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 (list; graph; refs; listen; history; internal format)
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.

MATHEMATICA

RecurrenceTable[{a[1]==1, a[n+1]==If[a[n]>n, a[n]-n , a[n]+n]}, a[n], {n, 80}] (* From Harvey P. Dale, May 11 2011 *)

CROSSREFS

Cf. A005132.

Equals 1+A008344(n).

Sequence in context: A201283 A080427 A118906 * A181336 A124037 A090285

Adjacent sequences:  A085056 A085057 A085058 * A085060 A085061 A085062

KEYWORD

nonn,easy

AUTHOR

Amarnath Murthy and Meenakshi Srikanth (amarnath_murthy(AT)yahoo.com), Jun 27 2003

EXTENSIONS

More terms from Sam Alexander (amnalexander(AT)yahoo.com), Oct 20 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 17 12:27 EST 2012. Contains 206011 sequences.