OFFSET
1,3
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..80
FORMULA
a(n) = (1/n) * Sum_{d | n} totient(n/d) * ((n-1)*(-1)^d + (n-1)^d) for n > 1. - Andrew Howroyd, Mar 12 2017
EXAMPLE
All solutions for n=4:
..2....1....1....1....1....1....2....1....1....3....1....1....1....2....1....1
..3....2....4....4....4....3....4....4....3....4....3....4....2....3....2....2
..2....4....2....3....2....2....3....1....1....3....4....3....1....4....3....1
..4....2....4....2....3....3....4....4....3....4....2....4....4....3....2....2
..
..1....1....2....1....2....1....1....1
..2....3....3....3....4....2....2....3
..1....4....2....1....2....4....3....2
..3....3....3....4....4....3....4....4
MATHEMATICA
a[1] = 1; a[n_] = (1/n)*DivisorSum[n, EulerPhi[n/#]*((n-1)*(-1)^# + (n-1)^#)& ]; Array[a, 20] (* Jean-François Alcover, Nov 01 2017, after Andrew Howroyd *)
PROG
(PARI) a(n) = if (n==1, 1, (1/n) * sumdiv(n, d, eulerphi(n/d) * ((n-1)*(-1)^d + (n-1)^d))); \\ Michel Marcus, Nov 01 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
R. H. Hardin, Feb 27 2012
EXTENSIONS
a(14)-a(20) from Andrew Howroyd, Mar 12 2017
STATUS
approved