login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A008345 a(n+1) = a(n)-b(n+1) if a(n) >= b(n+1) else a(n)+b(n+1), where {b(n)} are the triangular numbers A000217. 4
0, 1, 4, 10, 0, 15, 36, 8, 44, 89, 34, 100, 22, 113, 8, 128, 264, 111, 282, 92, 302, 71, 324, 48, 348, 23, 374, 752, 346, 781, 316, 812, 284, 845, 250, 880, 214, 917, 176, 956, 136, 997, 94, 1040, 50, 1085, 4, 1132, 2308, 1083, 2358, 1032, 2410, 979, 2464, 924 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

a(0) and a(4) are both zero. Are there any other zero values? - N. J. A. Sloane, Sep 12 2019

LINKS

Rémy Sigrist, Table of n, a(n) for n = 0..25000 (first 1001 terms from Franklin T. Adams-Watters)

MAPLE

A008345 := proc(n) option remember; if n = 1 then n-1 elif A008345(n-1) >= n*(n+1)/2 then A008345(n-1)-n*(n+1)/2 else A008345(n-1)+n*(n+1)/2; fi; end;

MATHEMATICA

nxt[{n_, a_}]:=Module[{tr=((n+1)(n+2))/2}, {n+1, If[a>=tr, a-tr, a+tr]}]; Transpose[NestList[nxt, {0, 0}, 50]][[2]] (* Harvey P. Dale, Jun 19 2013 *)

CROSSREFS

Cf. A000217, A008344, A076042.

Sequence in context: A331450 A051499 A333654 * A279082 A016488 A087212

Adjacent sequences:  A008342 A008343 A008344 * A008346 A008347 A008348

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane and J. H. Conway

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 11 14:58 EDT 2021. Contains 342886 sequences. (Running on oeis4.)