login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A008343 a(1)=1; thereafter a(n+1) = a(n)-n if a(n) >= n otherwise a(n+1) = a(n)+n. 5
1, 0, 2, 5, 1, 6, 0, 7, 15, 6, 16, 5, 17, 4, 18, 3, 19, 2, 20, 1, 21, 0, 22, 45, 21, 46, 20, 47, 19, 48, 18, 49, 17, 50, 16, 51, 15, 52, 14, 53, 13, 54, 12, 55, 11, 56, 10, 57, 9, 58, 8, 59, 7, 60, 6, 61, 5, 62, 4, 63, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
For n>0, a(A060816(n))=0. - Dmitry Kamenetsky, Feb 14 2017
LINKS
FORMULA
a(n) = (n-1+a(n-1)) mod (2*(n-1)). - Jon Maiga, Jul 09 2021
MAPLE
A008343 := proc(n) option remember; if n = 1 then 1 elif A008343(n-1) >= (n-1) then A008343(n-1)-(n-1) else A008343(n-1)+(n-1); fi; end;
MATHEMATICA
nxt[{n_, a_}]:={n+1, If[a>=n, a-n, a+n]}; Transpose[NestList[nxt, {1, 1}, 60]][[2]] (* Harvey P. Dale, May 04 2014 *)
CROSSREFS
Sequence in context: A356273 A077382 A046527 * A257264 A093952 A308882
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name edited by Dmitry Kamenetsky, Feb 14 2017
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 10:22 EDT 2024. Contains 371967 sequences. (Running on oeis4.)