OFFSET
1,4
COMMENTS
A meander is a closed curve drawn by arcs of equal length and central angles of equal magnitude, starting with a positively oriented arc.
a(n) = 1 if and only if n is prime.
LINKS
Peter Luschny, Table of n, a(n) for n = 1..1000
Peter Luschny, Meander.
FORMULA
a(n) = Sum_{d|n} A198060(d-1,n/d-1) - 2^(n-1).
EXAMPLE
See the link for n = 6,8,9.
MAPLE
MATHEMATICA
A198060[m_, n_] := Sum[ Sum[ Sum[ (-1)^(j+i)*Binomial[i, j]*Binomial[n, k]^(m+1) * (n+1)^j * (k+1)^(m-j) / (k+1)^m, {i, 0, m}], {j, 0, m}], {k, 0, n}]; a[n_] := Sum[ A198060[d-1, n/d-1], {d, Divisors[n]}] - 2^(n-1); Table[a[n], {n, 1, 41}] (* Jean-François Alcover, Jun 27 2013 *)
PROG
(PARI)
A200062(n) = { D = divisors(n);
sum(m = 2, #D, d = D[m];
sum(k=0, n/d-1, binomial(n/d-1, k)^d*
sum(j=0, d-1, ((n/d)/(k+1))^j*
sum(i=0, d-1, (-1)^(j+i)*binomial(i, j)
))))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Nov 16 2011
STATUS
approved