OFFSET
1,1
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..100
Marko Riedel et al., math.stackexchange, Proper colorings of necklaces
Marko Riedel et al., math.stackexchange, Proper colorings of bracelets
FORMULA
a(2*n+1) = A106365(2*n+1)/2 for n > 0, a(2*n) = (A106365(2*n) + 3*2^(n-1))/2. - Andrew Howroyd, Mar 12 2017
EXAMPLE
All solutions for n=4:
..1....1....1....1....1....2
..3....2....3....2....2....3
..2....3....1....1....1....2
..3....2....3....2....3....3
MATHEMATICA
T[n_, k_] := If[n == 1, k, (DivisorSum[n, EulerPhi[n/#]*(k - 1)^# &]/n + If[OddQ[n], 1 - k, k*(k - 1)^(n/2)/2])/2]; a[n_] = T[n, 3]; Array[a, 34] (* Jean-François Alcover, Nov 01 2017, after Andrew Howroyd *)
CROSSREFS
KEYWORD
nonn
AUTHOR
R. H. Hardin, Feb 27 2012
STATUS
approved