login
A101561
a(n) = (-1)^n * [x^n] Sum_{k>=1} x^(k-1)/(1+3*x^k).
4
1, 2, 10, 29, 82, 236, 730, 2216, 6571, 19604, 59050, 177410, 531442, 1593596, 4783060, 14351123, 43046722, 129133838, 387420490, 1162281098, 3486785140, 10460294156, 31381059610, 94143358424, 282429536563, 847288078004, 2541865834900, 7625599078610
OFFSET
0,2
LINKS
FORMULA
a(n) = Sum_{k=0..n} (-1)^(n-k) * 3^k * A051731(n+1, k+1).
a(n) = (-1)^n * Sum_{d|n+1} (-3)^(d-1). - G. C. Greubel, Jun 25 2024
MATHEMATICA
a[n_]:= Sum[(-1)^(n-k) * If[Mod[n+1, k+1]==0, 1, 0] * 3^k, {k, 0, n}];
Table[a[n], {n, 0, 25}] (* James C. McMahon, Jan 01 2024 *)
A101561[n_]:= (-1)^n*DivisorSum[n+1, (-3)^(#-1) &];
Table[A101561[n], {n, 0, 40}] (* G. C. Greubel, Jun 25 2024 *)
PROG
(Magma)
A101561:= func< n | (&+[(-1)^(n-k)*3^k*0^((n+1) mod (k+1)): k in [0..n]]) >;
[A101561(n): n in [0..40]]; // G. C. Greubel, Jun 25 2024
(SageMath)
def A101561(n): return sum((-1)^(n+k)*3^k*0^((n+1)%(k+1)) for k in range(n+1))
[A101561(n) for n in range(41)] # G. C. Greubel, Jun 25 2024
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Dec 07 2004
STATUS
approved