OFFSET
0,5
LINKS
FORMULA
a(n) = [x^n] Product_{d^2|n} 1/(1 - x^(d^2)).
a(n) = 1 if n is a squarefree.
a(n) = 2 if n is a square of prime.
EXAMPLE
a(8) = 3 because 8 has 4 divisors {1, 2, 4, 8} among which 2 are squares {1, 4} therefore we have [4, 4], [4, 1, 1, 1, 1] and [1, 1, 1, 1, 1, 1, 1, 1].
MAPLE
with(numtheory):
a:= proc(n) option remember; local b, l; l, b:=
sort(select(issqr, [divisors(n)[]])),
proc(m, i) option remember; `if`(m=0, 1, `if`(i<1, 0,
b(m, i-1)+`if`(l[i]>m, 0, b(m-l[i], i))))
end; b(n, nops(l))
end:
seq(a(n), n=0..100); # Alois P. Heinz, Mar 30 2017
MATHEMATICA
Join[{1}, Table[d = Divisors[n]; Coefficient[Series[Product[1/(1 - Boole[Mod[DivisorSigma[0, d[[k]]], 2] == 1] x^d[[k]]), {k, Length[d]}], {x, 0, n}], x, n], {n, 1, 100}]]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Mar 25 2017
STATUS
approved