login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A033500
a(n) = a(n-1) + a(round(2*(n-1)/3)) + a(round((n-1)/3)) with a(1)=1, a(2)=2.
3
1, 2, 4, 7, 12, 18, 27, 41, 57, 79, 110, 144, 192, 256, 325, 416, 538, 666, 828, 1038, 1257, 1540, 1892, 2258, 2715, 3294, 3889, 4612, 5497, 6404, 7521, 8857, 10224, 11874, 13876, 15912, 18314, 21173, 24080
OFFSET
1,2
LINKS
MAPLE
A033500 := proc(n) option remember; if n <= 2 then n else A033500(n-1)+A033500(round(2*(n-1)/3))+A033500(round((n-1)/3)); fi; end;
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
Sequence in context: A002621 A343657 A363211 * A003318 A329398 A353150
KEYWORD
nonn
STATUS
approved