OFFSET
1,3
COMMENTS
See A317420 for similar sequences.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, Colored scatterplot of the first 100000 terms (where the color is function of the parity of n)
FORMULA
For n = 5:
- |a(1) - a(4)| = |0 - 3| = 3 > 2,
- |a(2) - a(3)| = |1 - 2| = 1 <= 2,
- |a(3) - a(2)| = |2 - 1| = 1 <= 2,
- |a(4) - a(1)| = |3 - 0| = 3 > 2,
- hence a(5) = 2.
PROG
(PARI) a = vector(75); for (n=1, #a, a[n] = sum(k=1, n-1, abs(a[k]-a[n-k])<=2); print1 (a[n] ", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Aug 01 2018
STATUS
approved