OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..5000
MAPLE
seq(coeff(convert(series(add(-(-1)^k*x^(k*(k+1)/2), k=1..100)/(mul(1-x^k, k=1..100))^2, x, 100), polynom), x, 2*n+1), n=0..45); # (C. Ronaldo)
# second Maple program:
b:= proc(n, i) option remember;
`if`(i>n, 0, `if`(irem(n, i)=0, 1, 0)+
add(b(n-i*j, i+1)*(j+1), j=0..n/i))
end:
a:= n-> `if`(n=0, 1, b(2*n+1, 1)):
seq(a(n), n=0..60); # Alois P. Heinz, Mar 26 2014
MATHEMATICA
b[n_, i_]:= b[n, i]= If[i>n, 0, If[Mod[n, i]==0, 1, 0] + Sum[b[n-i*j, i + 1]*(j+1), {j, 0, n/i}]];
a[n_]:= If[n==0, 1, b[2*n+1, 1]];
Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Jun 18 2018, after Alois P. Heinz *)
PROG
(Magma)
m:=200;
R<x>:=PowerSeriesRing(Integers(), m);
b:= Coefficients(R!( 1 + (&+[ x^n*(1-x^n)/(&*[(1-x^j)^2: j in [1..n]]): n in [1..m+2]]) ));
A100506:= func< n | b[2*n+2] >;
[A100506(n): n in [0..80]]; // G. C. Greubel, Apr 03 2023
(SageMath)
@CachedFunction
def b(n, k): # Indranil Ghosh's code of A001523
if k>n: return 0
if n%k==0: x=1
else: x=0
return x + sum(b(n-k*j, k+1)*(j+1) for j in range(n//k + 1))
def A100506(n): return 1 if n==0 else b(2*n+1, 1)
[A100506(n) for n in range(41)] # G. C. Greubel, Apr 03 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Nov 24 2004
EXTENSIONS
More terms from C. Ronaldo (aga_new_ac(AT)hotmail.com), Jan 19 2005
STATUS
approved