login
A156747
a(1) = a(2) = a(3) = 0, then a(n) = abs(a(n-1) + 2*a(n-2) - a(n-3)) - a(n-2) - 1.
1
0, 0, 0, -1, 0, 2, 2, 3, 2, 2, 0, -1, 2, 0, 2, -1, 0, 4, 4, 7, 6, 8, 6, 7, 4, 4, 0, -1, 4, 2, 6, 3, 6, 2, 4, -1, 0, 6, 6, 11, 10, 14, 12, 15, 12, 14, 10, 11, 6, 6, 0, -1, 6, 4, 10, 7, 12, 8, 12, 7, 10, 4, 6, -1, 0, 8, 8, 15, 14, 20, 18, 23, 20, 24, 20, 23, 18, 20, 14, 15, 8, 8, 0, -1, 8, 6, 14, 11
OFFSET
1,6
COMMENTS
A jumping flea sequence of order 3 (take a look at the graph and see A104156 for a sequence of order 2).
For n>=1, a(n^2 + (3/2)*(1 - (-1)^n)) = -1; for n>=5, a(n^2 - 2 + (1+(-1)^n)/2) = 0; between zeros there are simple patterns.
LINKS
MATHEMATICA
RecurrenceTable[{a[1]==a[2]==a[3]==0, a[n]==Abs[a[n-1]+2a[n-2]-a[n-3]]-a[n-2]-1}, a, {n, 90}] (* Harvey P. Dale, Aug 19 2019 *)
PROG
(Magma)
a:= func< n | n lt 4 select 0 else Abs(Self(n-1) +2*Self(n-2) -Self(n-3)) -Self(n-2) -1 >;
[a(n): n in [1..100]]; // G. C. Greubel, Jun 16 2021
(Sage)
@CachedFunction
def a(n): return 0 if (n<4) else abs(a(n-1) +2*a(n-2) -a(n-3)) -a(n-2) -1
[a(n) for n in (1..100)] # a=A156747 # G. C. Greubel, Jun 16 2021
CROSSREFS
Sequence in context: A305294 A097510 A237619 * A318958 A194827 A335359
KEYWORD
sign
AUTHOR
Benoit Cloitre, Feb 14 2009
STATUS
approved