OFFSET
1,3
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..1000
FORMULA
Let M = an infinite triangular matrix with (1, k, k, 0, 0, 0,...) in the k-th column stepped down twice from the previous column, for k>1.
A176528 = Lim_{n->inf} M^n, the left-shifted vector considered as a sequence.
EXAMPLE
First few rows of the generating triangle M =
1;
1;
1, 1;
0, 2;
0, 2, 1;
0, 0, 3;
0, 0, 3, 1;
0, 0, 0, 4;
0, 0, 0, 4, 1;
...
Examples: a(10) = n * a(5) = 5 * 4 = 20.
a(11) = 5 * a(5) + a(6) = 5 * 4 + 6 = 26.
MAPLE
a:= proc(n) option remember; `if`(n=1, 1, (h->
h*a(h)+`if`(n::odd, a(h+1), 0))(iquo(n, 2)))
end:
seq(a(n), n=1..55); # Alois P. Heinz, Apr 15 2021
MATHEMATICA
a[n_] := a[n] = If[n == 1, 1, With[{h = Quotient[n, 2]}, h*a[h] + If[OddQ[n], a[h+1], 0]]];
Table[a[n], {n, 1, 55}] (* Jean-François Alcover, Feb 13 2023, after Alois P. Heinz *)
PROG
(PARI) a(n) = {if(n<=1, n==1, my(t=n\2); t*a(t) + if(n%2, a(t+1)))} \\ Andrew Howroyd, Apr 15 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Apr 19 2010
EXTENSIONS
Terms a(28) and beyond from Andrew Howroyd, Apr 15 2021
STATUS
approved