OFFSET
0,3
COMMENTS
For all n, n! = A108951(k) for some unique k. This sequence gives that k for each n. In some sense this sequence tells how to factor factorials into primorials.
Represent n! as a product of primorials p#. Then replace each primorial with its base prime to calculate a(n).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1911 (terms n = 1..1000 from Vaclav Kotesovec)
FORMULA
a(n) = n! / Product_{k=1..n} A064989(k). - Vaclav Kotesovec, Mar 21 2019
EXAMPLE
Represent 7! as a product of primorials:
7! = 2^4 * 3^2 * 5 * 7 = (2#)^2 * 3# * 7#
Replace primorials by primes:
2^2 * 3 * 7 = 84.
So a(7) = 84.
MAPLE
f:= proc(n) option remember; `if`(n<2, 0, f(n-1)+add(
i[2]*x^numtheory[pi](i[1]), i=ifactors(n)[2]))
end:
a:= proc(n) local d, p, r; p, r:= f(n), 1;
do d:= degree(p); if d<1 then break fi;
p, r:= p-add(x^i, i=1..d), ithprime(d)*r
od: r
end:
seq(a(n), n=0..35); # Alois P. Heinz, Mar 21 2019
MATHEMATICA
q[n_] := Apply[Times, Table[Prime[i], {i, 1, PrimePi[n]}]]; Flatten[{1, 1, Table[val = 1; fak = n!; Do[If[PrimeQ[k], Do[If[Divisible[fak, q[k]], val = val*k; fak = fak/q[k]], {j, 1, n}]], {k, n, 2, -1}]; val, {n, 2, 30}]}] (* Vaclav Kotesovec, Mar 21 2019 *)
PROG
(PARI)
g(n) = my(f=factor(n)); prod(k=1, #f~, my(p=f[k, 1]); (p/if(p>2, precprime(p-1), 1))^f[k, 2]); \\ A319626/A319627
a(n) = prod(k=1, n, g(k)); \\ Daniel Suteu, Mar 21 2019
(PARI) A307035(n) = { my(m=1, pp=1); n=n!; while(1, forprime(p=2, , if(n%p, if(2==p, return(m), break), n /= p; pp = p)); m *= pp); }; \\ Antti Karttunen, Dec 29 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Allan C. Wechsler, Mar 20 2019
EXTENSIONS
a(12)-a(13) from Michel Marcus, Mar 21 2019
a(14)-a(15) from Vaclav Kotesovec, Mar 21 2019
a(0), a(16)-a(30) from Alois P. Heinz, Mar 21 2019
STATUS
approved