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 A065855 #59 Dec 30 2024 12:51:21 %S A065855 0,0,0,1,1,2,2,3,4,5,5,6,6,7,8,9,9,10,10,11,12,13,13,14,15,16,17,18, %T A065855 18,19,19,20,21,22,23,24,24,25,26,27,27,28,28,29,30,31,31,32,33,34,35, %U A065855 36,36,37,38,39,40,41,41,42,42,43,44,45,46,47,47,48,49,50,50,51,51,52,53 %N A065855 Number of composites <= n. %C A065855 Also number of primes between prime(n) and n. - _Joseph L. Pe_, Sep 24 2002 %C A065855 Plot the points (n,a(n)) by, say, appending the line ListPlot[%, PlotJoined -> True] to the Mathematica program. The result is virtually a straight line passing through the origin. For the first thousand points, the slope is approximately = 3/4. (This behavior can be explained by using the prime number theorem.) - _Joseph L. Pe_, Sep 24 2002 %C A065855 Partial sums of A066247, the characteristic function of composites. - _Reinhard Zumkeller_, Oct 14 2014 %C A065855 Appears to be the same as the coefficient h*_1 of the h* polynomial for polytope representing the number n. See Ya-Ping Lu and Shu-Fang Deng (2020), Table 3.1. - _N. J. A. Sloane_, Mar 26 2020 %H A065855 N. J. A. Sloane, <a href="/A065855/b065855.txt">Table of n, a(n) for n = 1..20000</a> [First 1000 terms from T. D. Noe] %H A065855 Ya-Ping Lu and Shu-Fang Deng, <a href="http://arxiv.org/abs/2003.08968">Properties of Polytopes Representing Natural Numbers</a>, arXiv:2003.08968 [math.GM], 2020. %F A065855 a(n) = n - A000720(n) - 1 = A062298(n) - 1. %e A065855 Prime(8) = 19 and there are 3 primes between 8 and 19 (endpoints are excluded), namely 11, 13, 17. Hence a(8) = 3. %p A065855 A065855 := proc(n) if n <= 3 then 0 else n - numtheory:-pi(n) - 1; fi; end; # _N. J. A. Sloane_, Oct 20 2024 %p A065855 a := [seq(A065855(n),n=1..120)]; %t A065855 (*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[Prime[n], n], {n, 1, 1000}] %t A065855 Table[n-PrimePi[n]-1,{n,75}] (* _Harvey P. Dale_, Jun 14 2011 *) %t A065855 Accumulate[Table[If[CompositeQ[n],1,0],{n,100}]] (* _Harvey P. Dale_, Sep 24 2016 *) %o A065855 (PARI) a(n) = { n - primepi(n) - 1 } \\ _Harry J. Smith_, Nov 01 2009 %o A065855 (Haskell) %o A065855 a065855 n = a065855_list !! (n-1) %o A065855 a065855_list = scanl1 (+) (map a066247 [1..]) %o A065855 -- _Reinhard Zumkeller_, Oct 20 2014 %o A065855 (Python) %o A065855 from sympy import primepi %o A065855 def A065855(n): %o A065855 return 0 if n < 4 else n - primepi(n) - 1 # _Chai Wah Wu_, Apr 14 2016 %Y A065855 Cf. A000720, A062298, A002808. %Y A065855 Cf. A066247. %Y A065855 Related sequences: %Y A065855 Primes (p) and composites (c): A000040, A002808, A000720, A065855. %Y A065855 Primes between p(n) and 2*p(n): A063124, A070046; between c(n) and 2*c(n): A376761; between n and 2*n: A035250, A060715, A077463, A108954. %Y A065855 Composites between p(n) and 2*p(n): A246514; between c(n) and 2*c(n): A376760; between n and 2*n: A075084, A307912, A307989, A376759. %K A065855 easy,nonn,nice %O A065855 1,6 %A A065855 _Labos Elemer_, Nov 26 2001