OFFSET
1,4
LINKS
Robert Israel, Table of n, a(n) for n = 1..449
FORMULA
E.g.f.: -Sum_{p prime} log(1-x^p)/p!.
a(n) = 1 if and only if n is prime.
MAPLE
f:= proc(n) local p;
add( (n-1)!/(p-1)!, p = numtheory:-factorset(n))
end proc:
map(f, [$1..30]): # Robert Israel, Nov 14 2024
MATHEMATICA
a[1] = 0; a[n_] := (n - 1)! * Plus @@ (1/(FactorInteger[n][[;; , 1]] - 1)!); Array[a, 25] (* Amiram Eldar, Mar 01 2022 *)
PROG
(PARI) a(n) = sumdiv(n, d, isprime(d)*(n-1)!/(d-1)!);
(PARI) my(N=40, x='x+O('x^N)); concat(0, Vec(serlaplace(-sum(k=1, N, isprime(k)*log(1-x^k)/k!))))
(PARI) a(n) = my(f=factor(n)); sum(k=1, #f~, (n-1)!/(f[k, 1]-1)!); \\ Michel Marcus, Mar 01 2022
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Seiichi Manyama, Feb 28 2022
STATUS
approved