login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A065371
a(1) = 1, a(prime(i)) = prime(i) - i for i > 0 and a(u * v) = a(u) * a(v) for u, v > 0.
4
1, 1, 1, 1, 2, 1, 3, 1, 1, 2, 6, 1, 7, 3, 2, 1, 10, 1, 11, 2, 3, 6, 14, 1, 4, 7, 1, 3, 19, 2, 20, 1, 6, 10, 6, 1, 25, 11, 7, 2, 28, 3, 29, 6, 2, 14, 32, 1, 9, 4, 10, 7, 37, 1, 12, 3, 11, 19, 42, 2, 43, 20, 3, 1, 14, 6, 48, 10, 14, 6, 51, 1, 52, 25, 4, 11, 18, 7, 57, 2, 1, 28, 60, 3, 20, 29
OFFSET
1,5
COMMENTS
a(n) > 0 and a(n) < n for all n > 1.
LINKS
FORMULA
a(1) = 1; for n > 1, a(n) = (A020639(n)-A055396(n)) * a(A032742(n)). - Antti Karttunen, Jan 12 2017
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
KEYWORD
mult,nonn
AUTHOR
Reinhard Zumkeller, Nov 01 2001
STATUS
approved