OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
MAPLE
MATHEMATICA
a[n_]:= a[n]= If[n<3, n, a[n-1] +a[Round[2*(n-1)/3]] +a[Round[(n-1)/3]]];
Table[a[n], {n, 50}] (* G. C. Greubel, Oct 14 2019 *)
PROG
(PARI) a(n) = if(n<3, n, a(n-1)+a(round(2*(n-1)/3)) +a(round((n-1)/3)) );
vector(50, n, a(n) ) \\ G. C. Greubel, Oct 14 2019
(Magma) a:= func< n | n lt 3 select n else Self(n-1) + Self(Round(2*(n-1)/3)) + Self(Round((n-1)/3)) >;
[a(n): n in [1..50]]; // G. C. Greubel, Oct 14 2019
(Sage)
@CachedFunction
def a(n):
if (n<3): return n
else: return a(n-1) +a(round(2*(n-1)/3)) +a(round((n-1)/3))
[a(n) for n in (1..50)] # G. C. Greubel, Oct 14 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved