OFFSET
1,5
COMMENTS
a(n) > 0 and a(n) < n for all n > 1.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
a(210) = a(2*3*5*7) = a(2)*a(3)*a(5)*a(7) = (prime(1)-1)*(prime(2)-2)*(prime(3)-3)*(prime(4)-4) = (2-1)*(3-2)*(5-3)*(7-4) = 1*1*2*3 = 6.
MATHEMATICA
a[n_] := a[n] =
If[n == 1, 1,
If[PrimeQ[n], n - PrimePi[n],
Product[{p, e} = pe; a[p]^e, {pe, FactorInteger[n]}]]];
Array[a, 100] (* Jean-François Alcover, Nov 20 2021 *)
PROG
(Haskell)
a065371 1 = 1
a065371 n = product $ map (a014689 . a049084) $ a027746_row n
-- Reinhard Zumkeller, Apr 09 2012
(Scheme, with memoization-macro definec)
(definec (A065371 n) (cond ((= 1 n) 1) (else (* (- (A020639 n) (A055396 n)) (A065371 (A032742 n))))))
;; Antti Karttunen, Jan 12 2017
(PARI) a(n) = my(f=factor(n)); for (k=1, #f~, f[k, 1]-=primepi(f[k, 1])); factorback(f); \\ Michel Marcus, Nov 20 2021
CROSSREFS
KEYWORD
mult,nonn
AUTHOR
Reinhard Zumkeller, Nov 01 2001
STATUS
approved