OFFSET
1,5
COMMENTS
It can be proved that 12 is the largest number n such that a(n) = 0.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = phi(n) + Pi(n) - Pi(2n). - Charles R Greathouse IV, May 18 2011
EXAMPLE
a(5) = 3 as there are 3 coprime (to 5) composite numbers between 5 and 10, i.e., 6, 8 and 9.
MAPLE
A077150 := proc(n) local k, s: s:=0: for k from n+1 to 2*n-1 do if(not isprime(k) and gcd(k, n)=1)then s:=s+1: fi: od: return s: end: seq(A077150(n), n=1..100); # Nathaniel Johnston, May 18 2011
PROG
(PARI) for(k=1, 100, s=0:for(n=k+1, 2*k-1, if(!isprime(n), if(gcd(n, k)==1, s=s+1))):print1(s", "))
(PARI) a(n)=eulerphi(n)+primepi(n)-primepi(2*n) \\ Charles R Greathouse IV, May 18 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, Oct 30 2002
EXTENSIONS
More terms from Ralf Stephan, Mar 18 2003
STATUS
approved