OFFSET
1,2
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..449
FORMULA
a(n) = n! * Sum_{d|n} A000111(d) / d!.
MATHEMATICA
nmax = 20; CoefficientList[Series[Sum[(Sec[x^k] + Tan[x^k] - 1), {k, 1, nmax}], {x, 0, nmax}], x] Range[0, nmax]! // Rest
Table[n! DivisorSum[n, If[EvenQ[#], Abs[EulerE[#]], Abs[(2^(# + 1) (2^(# + 1) - 1) BernoulliB[# + 1])/(# + 1)]]/#! &], {n, 1, 20}]
PROG
(Python)
from math import factorial
from itertools import accumulate
def A330527(n):
c = a = factorial(n)
blist = (0, 1)
for d in range(2, n+1):
blist = tuple(accumulate(reversed(blist), initial=0))
if n % d == 0:
c += a*blist[-1]//factorial(d)
return c # Chai Wah Wu, Apr 19 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Dec 17 2019
STATUS
approved