cp's OEIS Frontend

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.

Showing 1-8 of 8 results.

A038107 Number of primes < n^2.

Original entry on oeis.org

0, 0, 2, 4, 6, 9, 11, 15, 18, 22, 25, 30, 34, 39, 44, 48, 54, 61, 66, 72, 78, 85, 92, 99, 105, 114, 122, 129, 137, 146, 154, 162, 172, 181, 191, 200, 210, 219, 228, 240, 251, 263, 274, 283, 295, 306, 319, 329, 342, 357, 367, 378, 393, 409, 421, 434, 445, 457, 474
Offset: 0

Views

Author

Joe K. Crump (joecr(AT)carolina.rr.com)

Keywords

Comments

Also number of primes <= n^2 since n^2 is not prime.
Also the number of primes contained within an n X n square spiral. - William A. Tedeschi, Mar 03 2008
For large n, these numbers closely approximate the sum of primes less than n. For example, n = 10^10, sum of primes < n = 2220822432581729238. The number of primes < (10^10)^2 = 10^20 = 2220819602560918840. The error is 0.0000012743... The derivation of this is in the link Sum of Primes. - Cino Hilliard, Jun 09 2008
a(n) - A000720(n) = A073882(n) - A010051(n) = A117490(n). - Reinhard Zumkeller, May 20 2010
A061265(a(n)) = 1 for n > 1. - Reinhard Zumkeller, Apr 15 2013
From Zhi-Wei Sun, Feb 17 2014: (Start)
Conjecture:
(i) The sequence a(n)^(1/n) (n = 3, 4, ...) is strictly decreasing (to the limit 1).
(ii) If n > 0 is not among 25, 35, 44, 46, 105, then the interval [a(n), a(n+1)] contains at least one prime. (End)
A classical conjecture of Legendre asserts that a(n) < a(n+1) for all n > 0.
Conjecture: All the numbers Sum_{i=j,...,k} 1/a(i) with 1 < j <= k have pairwise distinct fractional parts. - Zhi-Wei Sun, Sep 24 2015

Examples

			a(2)=2 because the only primes < 4 are 2 and 3.
		

References

  • Zhi-Wei Sun, Problems on combinatorial properties of primes, in: M. Kaneko, S. Kanemitsu and J. Liu (eds.), Number Theory: Plowing and Starring through High Wave Forms, Proc. 7th China-Japan Seminar (Fukuoka, Oct. 28 - Nov. 1, 2013), Ser. Number Theory Appl., Vol. 11, World Sci., Singapore, 2015, pp. 169-187. (See Conjectures 2.14-2.16.)

Crossrefs

Cf. A014085 (first differences), A111208, A194189, A262408, A262443, A262447, A262462.

Programs

  • Haskell
    a038107 0 = 0
    a038107 n = a000720 $ a000290 n
    -- Reinhard Zumkeller, Apr 15 2013, Nov 01 2011
    
  • Maple
    A038107 := proc(n) numtheory[pi]( n^2) ; end: seq(A038107(n),n=0..100) ; # R. J. Mathar, Jun 22 2009
  • Mathematica
    Table[PrimePi[n^2], {n, 0, 100}] (* Ray Chandler, Oct 22 2005 *)
  • PARI
    a(n)=primepi(n^2) \\ Charles R Greathouse IV, Apr 26 2012
  • Sage
    [prime_pi(n^2) for n in range(0, 59)] # Zerinvary Lajos, Jun 06 2009
    

Formula

a(n) = A000720(A000290(n)).
a(n) ~ 1/2 * n^2/log n. - Charles R Greathouse IV, Apr 26 2012

Extensions

Extended by Ray Chandler, Oct 22 2005

A262403 Number of ways to write pi(T(n)) = pi(T(k)) + pi(T(m)) with 1 < k < m < n, where T(x) is the triangular number x*(x+1)/2, and pi(x) is the number of primes not exceeding x.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 2, 2, 1, 2, 1, 3, 4, 4, 4, 3, 3, 3, 3, 5, 4, 3, 4, 6, 4, 5, 2, 3, 6, 4, 1, 5, 8, 3, 2, 6, 1, 4, 5, 4, 2, 7, 2, 4, 5, 5, 5, 3, 4, 9, 9, 4, 5, 4, 8, 7, 6, 9, 4, 7, 5, 6, 2, 5, 9, 3, 8, 5, 6, 8, 5, 4, 3, 8, 4, 8, 7, 8, 5, 7, 8, 7, 4, 6, 2, 7, 7, 8, 7, 4, 5, 6, 4, 6, 4, 6, 4, 6, 6
Offset: 1

Views

Author

Zhi-Wei Sun, Sep 21 2015

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 4, and a(n) = 1 only for n = 5, 6, 7, 10, 12, 32, 38, 445, 727.
(ii) All those numbers pi(T(n)) (n = 1,2,3,...) are pairwise distinct. Moreover, if sum_{i=j,...,k}1/pi(T(i)) and sum_{r=s,...,t}1/pi(T(r)) with 1 < j <= k and j <= s <= t have the same fractional part but the ordered pairs (j,k) and (s,t) are different, then j = 2, k = 5 and s = t = 4.
Clearly, part (i) is related to addition chains, and the first assertion in part (ii) is an analog of Legendre's conjecture that pi(n^2) < pi((n+1)^2) for all n = 1,2,3,....
See also A262408 and A262409 for related conjectures involving powers.

Examples

			a(5) = 1 since pi(T(5)) = pi(15) = 6 = 2 + 4 = pi(3) + pi(10) = pi(T(2)) + pi(T(4)).
a(6) = 1 since pi(T(6)) = pi(21) = 8 = 2 + 6 = pi(3) + pi(15) = pi(T(2)) + pi(T(5)).
a(7) = 1 since pi(T(7)) = pi(28) = 9 = 3 + 6 = pi(6) + pi(15) = pi(T(3)) + pi(T(5)).
a(10) = 1 since pi(T(10)) = pi(55) = 16 = 2 + 14 = pi(3) + pi(45) = pi(T(2)) + pi(T(9)).
a(12) = 1 since pi(T(12)) = pi(78) = 21 = 3 + 18 = pi(6) + pi(66) = pi(T(3)) + pi(T(11)).
a(32) = 1 since pi(T(32)) = pi(528) = 99 = 9 + 90 = pi(28) + pi(465) = pi(T(7)) + pi(T(30)).
a(38) = 1 since pi(T(38)) = pi(741) = 131 = 32 + 99 = pi(136) + pi(528) = pi(T(16)) + pi(T(32)).
a(445) = 1 since pi(T(445)) = pi(99235) = 9526 = 2963 + 6563 = pi(27028) + pi(65703) = pi(T(232)) + pi(T(362)).
a(727) = 1 since pi(T(727)) = pi(264628) = 23197 = 10031 + 13166 = pi(105111) + pi(141778) = pi(T(458)) + pi(T(532)).
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004. (Cf. Section C6 on addition chains.)
  • Zhi-Wei Sun, Problems on combinatorial properties of primes, in: M. Kaneko, S. Kanemitsu and J. Liu (eds.), Number Theory: Plowing and Starring through High Wave Forms, Proc. 7th China-Japan Seminar (Fukuoka, Oct. 28 - Nov. 1, 2013), Ser. Number Theory Appl., Vol. 11, World Sci., Singapore, 2015, pp. 169-187.

Crossrefs

Programs

  • Mathematica
    f[n_]:=PrimePi[n(n+1)/2]
    T[m_,n_]:=Table[f[k],{k,m,n}]
    Do[r=0;Do[If[MemberQ[T[k+1,n-1],f[n]-f[k]],r=r+1];Continue,{k,2,n-2}];Print[n," ",r];Continue,{n,1,100}]

A262995 Number of ordered pairs (k,m) with k > 0 and m > 0 such that n = pi(k*(k+1)/2) + pi(1+m*(m+1)/2), where pi(x) denotes the number of primes not exceeding x.

Original entry on oeis.org

1, 1, 1, 3, 3, 3, 3, 5, 3, 6, 3, 6, 4, 6, 4, 7, 4, 6, 6, 6, 4, 8, 5, 6, 6, 7, 5, 8, 4, 9, 5, 7, 9, 5, 7, 8, 6, 9, 5, 9, 7, 7, 8, 8, 6, 8, 8, 8, 6, 7, 10, 8, 4, 12, 6, 8, 7, 9, 6, 10, 6, 8, 10, 8, 6, 12, 4, 12, 6, 11, 6, 11, 6, 9, 10, 8, 7, 11, 7, 10, 8, 9, 7, 10, 7, 13, 5, 7, 11, 9, 6, 8, 12, 8, 7, 11, 7, 12, 5
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 07 2015

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0.
This has been verified for n up to 10^5. See also A262999 for a similar conjecture.
By Chebyshev's inequality, pi(n*(n+1)/2) > n-1 for all n > 1.
In A262403 and A262439, the author conjectured that the sequences pi(n*(n+1)/2) (n = 1,2,3,...) and pi(1+n*(n+1)/2) (n = 1,2,3,...) are both strictly increasing.

Examples

			a(1) = 1 since 1 = pi(1*2/2) + pi(1+1*2/2).
a(2) = 1 since 2 = pi(1*2/2) + pi(1+2*3/2).
a(3) = 1 since 3 = pi(2*3/2) + pi(1+1*2/2).
a(4) = 3 since 4 = pi(1*2/2) + pi(1+3*4/2) = pi(2*3/2) + pi(1+2*3/2) = pi(3*4/2) + pi(1+1*2/2).
		

Crossrefs

Programs

  • Mathematica
    s[k_]:=s[k]=PrimePi[k(k+1)/2+1]
    t[n_]:=t[n]=PrimePi[n(n+1)/2]
    Do[r=0;Do[If[s[k]>n,Goto[bb]];Do[If[t[j]>n-s[k],Goto[aa]];If[t[j]==n-s[k],r=r+1];Continue,{j,1,n-s[k]+1}];Label[aa];Continue,{k,1,n}];Label[bb];Print[n," ",r];Continue,{n,1,100}]

A262999 Number of ordered pairs (k, m) with k > 0 and m > 0 such that n = pi(k*(k+1)/2) + pi(m^2), where pi(x) denotes the number of primes not exceeding x.

Original entry on oeis.org

0, 2, 1, 3, 1, 4, 1, 4, 3, 3, 4, 3, 4, 3, 5, 2, 4, 6, 2, 6, 3, 5, 3, 5, 5, 4, 6, 3, 5, 5, 4, 5, 6, 6, 1, 10, 1, 6, 7, 3, 6, 6, 6, 3, 6, 6, 4, 9, 2, 8, 4, 7, 3, 8, 5, 4, 8, 6, 2, 7, 6, 6, 4, 8, 5, 7, 3, 7, 7, 6, 4, 10, 3, 5, 8, 8, 4, 6, 4, 10, 7, 3, 5, 9, 6, 5, 5, 9, 4, 8
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 07 2015

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1, and a(n) = 1 only for n = 3, 5, 7, 35, 37, 217, 7439, 10381.
We have verified this for n up to 120000.
See also A262995, A263001 and A263020 for similar conjectures.

Examples

			a(2) = 2 since 2 = pi(1*2/2) + pi(2^2) = pi(2*3/2) + pi(1^2).
a(3) = 1 since 3 = pi(3*4/2) + pi(1^2).
a(5) = 1 since 5 = pi(3*4/2) + pi(2^2).
a(7) = 1 since 7 = pi(3*4/2) + pi(3^2).
a(35) = 1 since 35 = pi(13*14/2) + pi(6^2).
a(37) = 1 since 37 = pi(3*4/2) + pi(12^2).
a(217) = 1 since 217 = pi(17*18/2) + pi(33^2).
a(590) = 1 since 590 = 58 + 532 = pi(23*24/2) + pi(62^2).
a(7439) = 1 since 7439 = 3854 + 3585 = pi(269*270/2) + pi(183^2).
a(10381) = 1 since 10381 = 1875 + 8506 = pi(179*180/2) + pi(296^2).
		

Crossrefs

Programs

  • Mathematica
    s[n_]:=s[n]=PrimePi[n^2]
    t[n_]:=t[n]=PrimePi[n(n+1)/2]
    Do[r=0;Do[If[s[k]>n,Goto[bb]];Do[If[t[j]>n-s[k],Goto[aa]];If[t[j]==n-s[k],r=r+1];Continue,{j,1,n-s[k]+1}];Label[aa];Continue,{k,1,n}];Label[bb];Print[n," ",r];Continue,{n,1,100}]

A263001 Number of ordered pairs (k, m) with k > 0 and m > 0 such that n = pi(k*(k+1)) + pi(m*(m+1)/2), where pi(x) denotes the number of primes not exceeding x.

Original entry on oeis.org

1, 0, 2, 1, 3, 1, 3, 2, 3, 3, 3, 4, 3, 4, 2, 5, 4, 2, 7, 2, 4, 5, 2, 7, 2, 5, 4, 4, 5, 3, 5, 6, 4, 5, 6, 3, 6, 6, 2, 9, 3, 5, 5, 5, 6, 5, 6, 5, 4, 7, 4, 7, 4, 5, 6, 7, 3, 5, 6, 7, 4, 7, 7, 5, 3, 9, 5, 7, 3, 8, 7, 5, 4, 8, 6, 6, 3, 10, 7, 3, 3, 11, 5, 7, 4, 8, 5, 4, 7, 7, 5, 8, 3, 8, 7, 4, 5, 9, 6, 9
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 07 2015

Keywords

Comments

Conjecture: a(n) > 0 for all n > 2, and a(n) = 1 only for n = 1, 4, 6.
We have verified this for n up to 10^5.
See also A262995, A262999 and A263020 for similar conjectures.

Examples

			a(1) = 1 since 1 = pi(1*2) + pi(1*2/2).
a(4) = 1 since 4 = pi(1*2) + pi(3*4/2).
a(6) = 1 since 6 = pi(2*3) + pi(3*4/2).
		

Crossrefs

Programs

  • Mathematica
    s[n_]:=s[n]=PrimePi[n(n+1)]
    t[n_]:=t[n]=PrimePi[n(n+1)/2]
    Do[r=0;Do[If[s[k]>n,Goto[bb]];Do[If[t[j]>n-s[k],Goto[aa]];If[t[j]==n-s[k],r=r+1];Continue,{j,1,n-s[k]+1}];Label[aa];Continue,{k, 1, n}];Label[bb];Print[n," ",r];Continue,{n,1,100}]

A263020 Number of ordered pairs (k, m) with k > 0 and m > 0 such that n = pi(k*(k+1)/2) + pi(m*(3*m-1)/2), where pi(x) denotes the number of primes not exceeding x.

Original entry on oeis.org

0, 1, 2, 1, 2, 2, 2, 3, 3, 1, 5, 2, 2, 5, 2, 3, 4, 2, 6, 1, 5, 3, 3, 5, 2, 4, 5, 2, 4, 5, 1, 6, 5, 2, 6, 4, 3, 5, 4, 5, 3, 6, 4, 4, 4, 5, 4, 5, 4, 5, 6, 2, 3, 7, 5, 3, 6, 5, 2, 3, 8, 5, 3, 5, 5, 6, 5, 1, 8, 8, 2, 4, 6, 6, 3, 5, 8, 4, 4, 5, 3, 9, 2, 6, 8, 3, 3, 6, 4, 7, 3, 6, 6, 5, 5, 5, 3, 7, 6, 6
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 07 2015

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1.
We have verified this for n up to 3*10^5. It seems that a(n) = 1 only for n = 2, 4, 10, 20, 31, 68, 147, 252, 580, 600, 772, 1326, 1381, 2779, 3136, 3422, 3729, 7151, 9518, 13481, 18070, 18673, 36965, 48181, 69250, 91130, 93580, 99868.
Note that n*(n+1)/2 (n = 0,1,2,...) are the triangular numbers while n*(3n-1)/2 (n = 0,1,2,...) are the pentagonal numbers.

Examples

			a(2) = 1 since 2 = 2 + 0 = pi(2*3/2) + pi(1*(3*1-1)/2).
a(4) = 1 since 4 = 4 + 0 = pi(4*5/2) + pi(1*(3*1-1)/2).
a(10) = 1 since 10 = 2 + 8 = pi(2*3/2) + pi(4*(3*4-1)/2).
a(20) = 1 since 20 = 9 + 11 = pi(7*8/2) + pi(5*(3*5-1)/2).
a(31) = 1 since 31 = 16 + 15 = pi(10*11/2) + pi(6*(3*6-1)/2).
a(68) = 1 since 68 = 2 + 66 = pi(2*3/2) + pi(15*(3*15-1)/2).
a(147) = 1 since 147 = pi(31*32/2) + pi(13*(3*13-1)/2).
a(252) = 1 since 252 = pi(29*30/2) + pi(26*(3*26-1)/2).
a(580) = 1 since 580 = pi(5*6/2) + pi(53*(3*53-1)/2).
a(600) = 1 since 600 = pi(42*43/2) + pi(46*(3*46-1)/2).
a(772) = 1 since 772 = pi(107*108/2) + pi(6*(3*6-1)/2).
a(1326) = 1 since 1326 = pi(139*140/2) + pi(22*(3*22-1)/2).
a(1381) = 1 since 1381 = pi(145*146/2) + pi(18*(3*18-1)/2).
a(2779) = 1 since 2779 = pi(212*213/2) + pi(33*(3*33-1)/2).
a(3136) = 1 since 3136 = pi(147*148/2) + pi(102*(3*102-1)/2).
a(3422) = 1 since 3422 = pi(151*152/2) + pi(109*(3*109-1)/2).
a(3729) = 1 since 3729 = pi(29*30/2) + pi(151*(3*151-1)/2).
a(7151) = 1 since 7151 = pi(100*101/2) + pi(208*(3*208-1)/2).
a(9518) = 1 since 9518 = pi(82*83/2) + pi(250*(3*250-1)/2).
a(13481) = 1 since 13481 = pi(539*540/2) + pi(6*(3*6-1)/2).
a(18070) = 1 since 18070 = pi(632*633/2) + pi(17*(3*17-1)/2).
a(18673) = 1 since 18673 = 14493 + 4180 = pi(561*562/2) + pi(163*(3*163-1)/2).
a(36965) = 1 since 36965 = 3780 + 33185 = pi(266*267/2) + pi(511*(3*511-1)/2).
a(48181) = 1 since 48181 = 30755 + 17426 = pi(848*849/2) + pi(359*(3*359-1)/2).
a(69250) = 1 since 69250 = 20669 + 48581 = pi(682*683/2) + pi(629*(3*629-1)/2).
a(91130) = 1 since 91130 = 81433 + 9697 = pi(1442*1443/2) + pi(260*(3*260-1)/2).
a(93580) = 1 since 93580 = 91865 + 1715 = pi(1539*1540/2) + pi(99*(3*99-1)/2).
a(99868) = 1 since 99868 = 66079 + 33789 = pi(1287*1288/2) + pi(516*(3*516-1)/2).
		

Crossrefs

Programs

  • Mathematica
    s[n_]:=s[n]=PrimePi[n(3n-1)/2]
    t[n_]:=t[n]=PrimePi[n(n+1)/2]
    Do[r=0;Do[If[s[k]>n,Goto[bb]];Do[If[t[j]>n-s[k],Goto[aa]];If[t[j]==n-s[k],r=r+1];Continue,{j,1,n-s[k]+1}];Label[aa];Continue,{k, 1, n}];Label[bb];Print[n," ",r];Continue,{n,1,100}]

A194189 Number of primes between the n-th triangular number and the n-th square.

Original entry on oeis.org

0, 0, 1, 2, 3, 3, 6, 7, 8, 9, 12, 13, 15, 17, 18, 22, 25, 27, 30, 32, 35, 38, 41, 43, 48, 52, 55, 58, 62, 64, 68, 73, 79, 83, 86, 89, 93, 97, 103, 110, 114, 120, 123, 129, 132, 139, 141, 149, 157, 162, 162, 173, 183, 186, 192, 195, 198, 207, 213, 222, 229
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 01 2011

Keywords

Comments

a(n) = A038107(n) - A111208(n).

Examples

			a(10) = #{59,61,67,71,73,79,83,89,97} = 9;
a(11) = #{67,71,73,79,83,89,97,101,103,107,109,113} = 12;
a(12) = #{79,83,89,97,101,103,107,109,113,127,131,137,139} = 13.
		

Crossrefs

Programs

  • Haskell
    a194189 n = sum $ map a010051 [n*(n+1) `div` 2 + 1 .. n^2 - 1]
  • Mathematica
    Table[PrimePi[n^2] - PrimePi[n*(n+1)/2], {n, 100}] (* T. D. Noe, Nov 01 2011 *)
    PrimePi[#[[2]]]-PrimePi[#[[1]]]&/@Module[{nn=70},Thread[{Accumulate[ Range[ nn]],Range[nn]^2}]] (* Harvey P. Dale, Aug 21 2019 *)

A220506 Number of primes <= n-th quarter-square.

Original entry on oeis.org

0, 0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 13, 15, 16, 18, 20, 22, 24, 25, 29, 30, 32, 34, 36, 39, 42, 44, 46, 48, 52, 54, 58, 61, 62, 66, 68, 72, 75, 78, 81, 85, 89, 92, 96, 99, 101, 105, 109, 114, 118, 122, 126, 129, 133, 137, 141, 146, 150, 154, 158, 162, 167, 172, 177, 181, 187, 191, 195, 200
Offset: 1

Views

Author

Omar E. Pol, Feb 05 2013

Keywords

Crossrefs

Partial sums of A220492. A bisection is A038107, n >= 1.

Programs

  • Mathematica
    Table[PrimePi[n^2/4], {n, 75}] (* Alonso del Arte, Feb 05 2013 *)

Formula

a(n) = A000720(A002620(n)), n >= 1.
Showing 1-8 of 8 results.