OFFSET
1,8
COMMENTS
There are 6 accumulation points for the sequence {a(n)/n} namely: -0.2, 0, 0.2, 0.4, 0.6 and 0.8.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
MATHEMATICA
a[n_]:= a[n]= If[n<5, 0, Abs[a[n-1] -a[n-2] +2*a[n-3] -a[n-4]] -a[n-3] -1];
Table[a[n], {n, 100}] (* G. C. Greubel, Jun 16 2021 *)
nxt[{a_, b_, c_, d_}]:={b, c, d, Abs[d-c+2b-a]-b-1}; NestList[nxt, {0, 0, 0, 0}, 100][[All, 1]] (* Harvey P. Dale, Sep 01 2021 *)
PROG
(Sage)
@CachedFunction
def a(n): return 0 if (n<5) else abs(a(n-1) -a(n-2) +2*a(n-3) -a(n-4)) -a(n-3) -1
[a(n) for n in (1..100)] # a=A156748 # G. C. Greubel, Jun 16 2021
CROSSREFS
KEYWORD
sign
AUTHOR
Benoit Cloitre, Feb 14 2009
STATUS
approved