OFFSET
1,3
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A005171(n) + n - 1.
a(n) = phi(n!)/phi((n-1)!). - Vladeta Jovovic, Nov 30 2002
a(n) = n - A010051(n). - Reinhard Zumkeller, Sep 10 2013
MATHEMATICA
Table[If[PrimeQ[n], n-1, n], {n, 100}] (* Harvey P. Dale, Aug 27 2015 *)
PROG
(Haskell)
a014684 n = n - fromIntegral (a010051 n)
-- Reinhard Zumkeller, Sep 10 2013
(Magma) [n - (IsPrime(n) select 1 else 0): n in [1..80]]; // Bruno Berselli, Jul 18 2016
(Python)
from sympy import isprime
def A014684(n): return n-int(isprime(n)) # Chai Wah Wu, Oct 14 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Andrew J. Gacek (andrew(AT)dgi.net)
STATUS
approved