OFFSET
1,4
LINKS
Matthew Niemiro, Table of n, a(n) for n = 1..1000
FORMULA
a(1), a(2), a(3) = 1; a(n) = (a(n-1) mod a(n-3)) + a(n-2) + 1.
Conjectures from Colin Barker, Dec 28 2019: (Start)
G.f.: x*(1 - x - x^2 + 2*x^3 - x^4 + x^6 - 2*x^7 + 2*x^8) / ((1 - x)^3*(1 + x)).
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n>9.
a(n) = (99 - 3*(-1)^n - 24*n + 2*n^2) / 8 for n>5.
(End)
MATHEMATICA
Nest[Append[#, Mod[#[[-1]], #[[-3]] ] + #[[-2]] + 1] &, {1, 1, 1}, 57] (* Michael De Vlieger, Dec 27 2019 *)
PROG
(Python)
x = 1
y = 1
z = 1
for i in range(4, 1001):
new = z % x + y + 1
print(str(i) +" " + str(new))
x = y
y = z
z = new
CROSSREFS
KEYWORD
nonn,hear
AUTHOR
Matthew Niemiro, Dec 27 2019
EXTENSIONS
More terms from Michael De Vlieger, Dec 27 2019
STATUS
approved