A227910 The number of necklaces with n beads of white and red colors, including at least three white ones.
1, 2, 4, 8, 13, 24, 40, 71, 119, 216, 372, 678, 1215, 2240, 4102, 7674, 14299, 27000, 50952, 96896, 184397, 352684, 675174, 1296843, 2493711, 4806062, 9272764, 17920843, 34669585, 67159032, 130216106, 252745349, 490984469, 954637538, 1857545280, 3617214660, 7048675939, 13744694906
Offset: 3
Keywords
Examples
a(4)=2 because there are exactly 2 necklaces with 4 beads of white and red colors, including at least three white ones: 1) all beads are white; 2) one bead is red.
Links
- Andrew Howroyd, Table of n, a(n) for n = 3..200
- Peter Kagey, Examples of classes of n-gons for a(4), a(5), and a(6)
- Vladimir Letsko, Mathematical Marathon, Problem 150 (in Russian)
Programs
-
Maple
g:=(n,m)->add(phi(d)*binomial(n/d,m/d),d in divisors(igcd(n,m)))/2/n+1/2*binomial(floor(m/2)+floor((n-m)/2),floor(m/2)); for n from 3 do s:=0:for m from 3 to n dos:=s+g(n,m) od: print(n,s) od:
-
Mathematica
g[n_, m_] := Sum[EulerPhi[d]*Binomial[n/d, m/d], {d , Divisors[GCD[n, m]]}]/2/n + 1/2*Binomial[Floor[m/2] + Floor[(n - m)/2], Floor[m/2]]; A227910 = Table[Sum[g[n, m], {m, 3, n}], {n, 3, 40}] (* Jean-François Alcover, Jul 02 2018, from Maple *)
-
PARI
a(n) = (sum(m=3, n, (1/n*sumdiv(gcd(m,n), d, eulerphi(d)*binomial(n/d,m/d))) + binomial(m\2+(n-m)\2, m\2) ))/2; \\ Andrew Howroyd, Oct 11 2017
Formula
a(n) = (Sum_{m=3..n} (1/n*sum_{d|gcd(m,n)} phi(d)*binomial(n/d,m/d)) + binomial(floor(m/2)+floor((n-m)/2), floor(m/2)))/2.
Comments