OFFSET
0,4
COMMENTS
a(n) = p if n = p^k and p odd prime, k >= 1, otherwise 1.
REFERENCES
Tom M. Apostol, Introduction to analytic number theory, Springer-Verlag, 1976.
LINKS
Manjul Bhargava, The factorial function and generalizations, Amer. Math. Monthly, 107 (Nov. 2000), 783-799.
Angelo B. Mingarelli, Abstract factorials, Notes on Number Theory and Discrete Mathematics, Vol. 19, 2013, No. 4, 43-76, (page 44).
Wikipedia, Von Mangoldt function
FORMULA
a(n) = 1 + Sum_{k=3..n} (k-1)*A010051(k)*(floor(k^n/n)-floor((k^n -1)/n)). - Anthony Browne, Jun 16 2016
EXAMPLE
a(8) = 1 because 8 = 2^3 is not the power of an odd prime, a(49) = 7 because 49 = 7^2.
MAPLE
a := proc(n) local lcm; lcm := n -> ilcm(seq(i, i = 1..n)); if type(n, even) then 1 else lcm(n)/lcm(n-1) fi end;
MATHEMATICA
a[n_] := If[IntegerQ[Log[2, n]], 1, Exp[MangoldtLambda[n]]]; Table[a[n], {n, 0, 89}] (* Jean-François Alcover, Jan 27 2014 *)
PROG
(SageMath)
def A155457(n: int) -> int:
b, e = is_prime_power(n, get_data=True)
return b if e != 0 and b % 2 == 1 else 1
print([A155457(n) for n in range(0, 90)]) # Peter Luschny, Jan 03 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Jan 22 2009, Jan 25 2009
EXTENSIONS
a(0)=1 prepended by Peter Luschny, Jan 03 2026
STATUS
approved
