This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A097454 #32 Feb 16 2019 07:16:29 %S A097454 1,0,-1,0,-1,0,-1,0,1,2,1,2,1,2,3,4,3,4,3,4,5,6,5,6,7,8,9,10,9,10,9, %T A097454 10,11,12,13,14,13,14,15,16,15,16,15,16,17,18,17,18,19,20,21,22,21,22, %U A097454 23,24,25,26,25,26,25,26,27,28,29,30,29,30,31,32,31,32,31,32,33,34,35,36,35,36,37,38,37,38,39,40,41,42,41,42,43,44,45 %N A097454 a(n) = (number of nonprimes <= n) - (number of primes <= n). %F A097454 a(n) = 1 + A072731(n). %F A097454 a(n) = n - 2*pi(n) = n - 2*A000720(n). - _Wesley Ivan Hurt_, Jun 16 2013 %F A097454 a(n) - a(n-1) = 1 - 2*A010051(n) for n > 1. - _Wesley Ivan Hurt_, Dec 18 2018 %F A097454 a(n) = A062298(n) - A000720(n). - _Michel Marcus_, Jan 31 2019 %e A097454 a(7) = -1 because there are 3 nonprimes <= 7 (1,4 and 6) and 4 primes <= 7 (2,3,5 and 7). %p A097454 with(numtheory): seq(n-2*pi(n), n=1..93); # _Emeric Deutsch_, Apr 01 2006 %t A097454 qp=0;lst={};Do[If[PrimeQ[n],AppendTo[lst,qp-=1],AppendTo[lst,qp+=1]],{n,6!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Mar 15 2010 *) %t A097454 Accumulate[ -1 + 2 * Boole /@ Not /@ PrimeQ @ Range @ 100] (* _Federico Provvedi_, Oct 06 2013 *) %o A097454 (PARI) %o A097454 compsmprimes(n) = { for(x=1,n, y=composites(x) - pi(x); print1(y",") ) } %o A097454 \\ The number of composite numbers less than or equal to n %o A097454 composites(n) = { my(c,x); c=0; for(x=1,n, if(!isprime(x),c++); ); return(c) } %o A097454 \\ pi(x) prime count function %o A097454 pi(n) = { my(c,x); c=0;forprime(x=1,n,c++);return(c) } %Y A097454 Cf. A000720, A010051, A062298, A072731. %K A097454 sign,easy %O A097454 1,10 %A A097454 _Cino Hilliard_, Aug 23 2004