OFFSET
1,3
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..200
Wikipedia, Cactus graph
EXAMPLE
a(3) = 2 because there are two cacti on 5 nodes which are a pentagon and 2 triangles joined at a node.
PROG
(PARI) \\ Here UCacti gives number of unrooted cacti with restricted polygons.
EulerT(v)={Vec(exp(x*Ser(dirmul(v, vector(#v, n, 1/n))))-1, -#v)}
RCacti(u)={my(v=[1]); while(#v<#u, my(g=x*Ser(v), g2=subst(g, x, x^2) + O(x^2*x^#v), r=sum(k=1, #u-1, my(c=u[k+1]); if(c, c*(g^k + g^(k%2)*g2^(k\2))))/2 + O(x^#u)); v=concat([1], EulerT(Vec(r, 1-serprec(r, x))))); v}
UCacti(u)={my(p=x*Ser(RCacti(u))); my(g(d)=subst(p + O(x*x^(#u\d)), x, x^d)); Vec(g(1) + sum(k=1, #u, my(c=u[k]); if(c, sumdiv(k, d, eulerphi(d)*g(d)^(k/d))/(2*k) - (g(1)^k)/2 + if(k%2==0, g(2)^(k/2) - g(1)^2*g(2)^(k/2-1))/4)))}
seq(n)={my(v=UCacti(vector(2*n-1, i, i>2 && isprime(i)))); vector(n, i, v[2*i-1])}
CROSSREFS
KEYWORD
nonn
AUTHOR
Andrew Howroyd, Feb 18 2020
STATUS
approved