OFFSET
1,6
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
FORMULA
EXAMPLE
phi(6) = 2 and there are 2 primes between 2 and 6 (endpoints are excluded), namely 3, 5. Hence a(6) = 2.
MATHEMATICA
(*gives number of primes < n*) f[n_] := Module[{r, i}, r = 0; i = 1; While[Prime[i] < n, i++ ]; i - 1]; (*gives number of primes between m and n with endpoints excluded*) g[m_, n_] := Module[{r}, r = f[m] - f[n]; If[PrimeQ[n], r = r - 1]; r]; Table[g[n, EulerPhi[n]], {n, 1, 100}]
(* Second program: *)
Array[PrimePi@ # - PrimePi@ EulerPhi@ # - Boole@ PrimeQ@ # &, 96] (* or *) Array[Count[Range[EulerPhi@ # + 1, # - 1], _?PrimeQ] &, 96] (* Michael De Vlieger, Dec 16 2017 *)
PROG
(PARI) A074398(n) = (primepi(n) - primepi(eulerphi(n)) - isprime(n)); \\ Antti Karttunen, Dec 16 2017
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Joseph L. Pe, Sep 24 2002
EXTENSIONS
Name clarified by Antti Karttunen, Dec 16 2017
STATUS
approved