OFFSET
2,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..10000
FORMULA
a(p) = 0 for p prime.
a(2n) > a(2n + 1) for all n > 2.
EXAMPLE
a(4) = 1 because 3! = 6 = 2 * 3, which has one prime factor (2) in common with 4.
a(5) = 0 because gcd(4!, 5) = 1.
a(6) = 4 because 5! = 120 = 2^3 * 3 * 5, which has four factors (2 thrice and 3 once) in common with 6.
MAPLE
with(numtheory):
a:= n-> add(add(`if`(i[1] in factorset(n), i[2], 0),
i=ifactors(j)[2]), j=1..n-1):
seq(a(n), n=2..100); # Alois P. Heinz, Mar 17 2014
MATHEMATICA
cmpf[n_]:=Count[Flatten[Table[#[[1]], {#[[2]]}]&/@FactorInteger[ (n-1)!]], _?( MemberQ[Transpose[FactorInteger[n]][[1]], #]&)]; Array[cmpf, 80] (* Harvey P. Dale, Jan 23 2016 *)
PROG
(Sage)
m=100 # change n for more terms
[sum(valuation(factorial(n-1), p) for p in prime_divisors(n) if p in prime_divisors(factorial(n-1))) for n in [2..m]] # Tom Edgar, Mar 14 2014
(PARI) a(n) = {nm = (n-1)!; fn = factor(n); sum (i=1, #fn~, valuation(nm, fn[i, 1])); } \\ Michel Marcus, Mar 15 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alonso del Arte, Feb 16 2014
STATUS
approved