OFFSET
1,3
COMMENTS
T(n,k) is the number of n-bead necklaces with up to k different colored beads. - Yves-Loic Martin, Sep 29 2020
LINKS
Seiichi Manyama, Rows n = 1..140, flattened
Wikipedia, Necklace (combinatorics)
FORMULA
T(n,k) = Sum_{j=1..k} binomial(k,j) * A087854(n, j). - Yves-Loic Martin, Sep 29 2020
T(n,k) = (1/n) * Sum_{j=1..n} k^gcd(j, n). - Seiichi Manyama, Mar 10 2021
EXAMPLE
MAPLE
A054631 := proc(n, k) add( numtheory[phi](d)*k^(n/d), d=numtheory[divisors](n) ) ; %/n ; end proc: # R. J. Mathar, Aug 30 2011
MATHEMATICA
Needs["Combinatorica`"]; Table[Table[NumberOfNecklaces[n, k, Cyclic], {k, 1, n}], {n, 1, 8}] //Grid (* Geoffrey Critzer, Oct 07 2012, after code by T. D. Noe in A027671 *)
t[n_, k_] := Sum[EulerPhi[d]*k^(n/d)/n, {d, Divisors[n]}]; Table[t[n, k], {n, 1, 9}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jan 20 2014 *)
PROG
(PARI) T(n, k) = sumdiv(n, d, eulerphi(d)*k^(n/d))/n; \\ Seiichi Manyama, Mar 10 2021
(PARI) T(n, k) = sum(j=1, n, k^gcd(j, n))/n; \\ Seiichi Manyama, Mar 10 2021
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
N. J. A. Sloane, Apr 16 2000, revised Mar 21 2007
STATUS
approved