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”).

A077150
Number of composite numbers between n and 2n that are coprime to n.
2
0, 0, 1, 0, 3, 0, 4, 2, 3, 0, 7, 0, 9, 3, 4, 3, 12, 2, 14, 4, 7, 4, 17, 2, 14, 6, 11, 5, 22, 1, 23, 9, 13, 8, 16, 3, 27, 9, 15, 6, 31, 2, 33, 11, 14, 12, 37, 7, 32, 10, 21, 12, 41, 6, 27, 11, 22, 14, 45, 3, 48, 18, 24, 19, 35, 6, 53, 19, 30, 9, 56, 10, 59, 23, 26
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
Sequence in context: A081170 A201291 A272192 * A065453 A152770 A098601
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, Oct 30 2002
EXTENSIONS
More terms from Ralf Stephan, Mar 18 2003
STATUS
approved