The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A126234 a(0)=0; a(n)=a(n-1)-n, if a(n-1)>2n; otherwise a(n)=a(n-1)+n. 1
0, 1, 3, 6, 10, 15, 9, 16, 24, 15, 25, 14, 26, 39, 25, 40, 24, 41, 23, 42, 22, 43, 65, 42, 66, 41, 67, 40, 68, 39, 69, 38, 70, 37, 71, 36, 72, 109, 71, 110, 70, 111, 69, 112, 68, 113, 67, 114, 66, 115, 65, 116, 64, 117, 63, 118, 62, 119, 61, 120, 180, 119, 181, 118, 182, 117 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
MAPLE
A[0]:= 0:
for n from 1 to 100 do
if A[n-1]>2*n then A[n]:= A[n-1]-n else A[n]:= A[n-1]+n fi
od:
seq(A[i], i=0..100); # Robert Israel, Nov 16 2016
MATHEMATICA
s={0}; a=0; Do[a=a+If[a>2n, -n, n]; AppendTo[s, a], {n, 200}]; s
nxt[{n_, a_}]:={n+1, If[a>2(n+1), a-n-1, a+n+1]}; NestList[nxt, {0, 0}, 70][[All, 2]] (* Harvey P. Dale, Feb 28 2022 *)
CROSSREFS
Sequence in context: A194037 A194101 A105333 * A259604 A130484 A074374
KEYWORD
nonn,look
AUTHOR
Zak Seidov, Mar 08 2007
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 May 13 03:04 EDT 2024. Contains 372497 sequences. (Running on oeis4.)