OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
MATHEMATICA
f[n_, p_, q_]:= f[n, p, q]= p +Quotient[q +Sum[f[k, p, q], {k, n-1}], 4];
A120166[n_]:= f[n, 8, 2];
Table[A120166[n], {n, 60}] (* G. C. Greubel, Sep 09 2023 *)
PROG
(Magma)
function f(n, a, b)
t:=0;
for k in [1..n-1] do
t+:= a+Floor((b+t)/4);
end for;
return t;
end function;
g:= func< n, a, b | f(n+1, a, b)-f(n, a, b) >;
A120166:= func< n | g(n, 8, 2) >;
[A120166(n): n in [1..60]]; // G. C. Greubel, Sep 09 2023
(SageMath)
@CachedFunction
def f(n, p, q): return p + (q +sum(f(k, p, q) for k in range(1, n)))//4
def A120166(n): return f(n, 8, 2)
[A120166(n) for n in range(1, 61)] # G. C. Greubel, Sep 09 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Graeme McRae, Jun 10 2006
STATUS
approved