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-6 of 6 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

A117490 Number of primes between n and n^2 (with n and n^2 excluded).

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 11, 14, 18, 21, 25, 29, 33, 38, 42, 48, 54, 59, 64, 70, 77, 84, 90, 96, 105, 113, 120, 128, 136, 144, 151, 161, 170, 180, 189, 199, 207, 216, 228, 239, 250, 261, 269, 281, 292, 305, 314, 327, 342, 352, 363, 378, 393, 405, 418, 429, 441, 458, 470
Offset: 1

Views

Author

Keywords

Comments

A famous Japanese mathematics book states that this sequence is nonzero (for n>1) if the Riemann Hypothesis is true, but this statement seems to be false.
If the n-th prime is denoted by p(n) then a(j) = number of nonzero values of floor (j^2/p(n)), over all n >= 1, (derived from A165974). - Christopher Hunt Gribble, Oct 03 2009

Examples

			For n = 5: between 5+1 = 6 and 5^2-1 = 24 there are the following six primes: 7, 11, 13, 17, 19, 23.
		

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,j,np; for i from 1 by 1 to n do np:=0; for j from i+1 by 1 to i^2-1 do if isprime(j) then np:=np+1; fi; od; print(np); od; end: P(100);
  • Mathematica
    a[n_] := PrimePi[n^2 - 1] - PrimePi[n]; Array[a, 59] (* Robert G. Wilson v, Apr 06 2006 *)

Formula

a(n) = pi(n^2) - pi(n), cf. A000720.
a(n) = A038107(n) - A000720(n) = A073882(n) - A010051(n). - Reinhard Zumkeller, May 20 2010

A220492 Number of primes p between quarter-squares, Q(n) < p <= Q(n+1), where Q(n) = A002620(n).

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Feb 04 2013

Keywords

Comments

It appears that a(n) > 0, if n > 1.
Apparently the above comment is equivalent to the Oppermann's conjecture. - Omar E. Pol, Oct 26 2013
For n > 0, also the number of primes per quarter revolution of the Ulam Spiral. The conjecture implies that there is at least one prime in every turn after the first. - Ruud H.G. van Tol, Jan 30 2024

Examples

			When the nonnegative integers are written as an irregular triangle in which the right border gives the quarter-squares without repetitions, a(n) is the number of primes in the n-th row of triangle. See below (note that the prime numbers are in parenthesis):
---------------------------------------
Triangle                          a(n)
---------------------------------------
0;                                 0
1;                                 0
(2);                               1
(3),   4;                          1
(5),   6;                          1
(7),   8,   9;                     1
10,  (11), 12;                     1
(13), 14,  15,   16;               1
(17), 18, (19),  20;               2
21,   22, (23),  24,  25;          1
26,   27,  28,  (29), 30;          1
...
		

Crossrefs

Programs

A109819 Product of primes between n and n^2.

Original entry on oeis.org

1, 6, 105, 5005, 37182145, 6685349671, 20496326086283047, 558516101711461766587, 15322117939717490037614688353, 10978895066407230594062391177770267, 150524069716274322800691458531160297587022319, 4335344870389259769484516507207766258600144871515339
Offset: 1

Views

Author

Rick L. Shepherd, Jul 02 2005

Keywords

Examples

			a(3) = 105 because 3, 5 and 7 are the A073882(3) = 3 primes in the interval from 3 to 3^2 inclusive and 3 * 5 * 7 = 105.
		

Crossrefs

Cf. A109818 (sum of same primes), A073882 (number of primes between n and n^2).

Programs

  • Mathematica
    Join[{1},Table[Product[Prime[i],{i,If[PrimeQ[n],PrimePi[n],PrimePi[n]+1],PrimePi[n^2]}],{n,2,10}]] (* James C. McMahon, Apr 01 2024 *)
  • PARI
    for(n=1,15,print1(prod(k=n,n^2,if(isprime(k),k,1)),","))

Formula

log(a(n)) ~ n^2 by the Prime Number Theorem. - Charles R Greathouse IV, Feb 05 2025

Extensions

More terms from Michel Marcus, Apr 02 2024

A098598 Number of primes in sequences formed from the t digits of n where the latter terms are given by rule b(i)=sum of t previous terms; primes are counted from initial t digits up to the largest term < n^2.

Original entry on oeis.org

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

Views

Author

Jason Earls, Sep 17 2004

Keywords

Examples

			a(21)=7 because there are 7 primes in the sequence
2,1,3,4,7,11,18,29,47,76,123,199,322.
		

Crossrefs

A109818 Sum of primes between n and n^2.

Original entry on oeis.org

0, 5, 15, 36, 95, 150, 318, 484, 774, 1043, 1576, 2099, 2886, 3790, 4620, 6040, 7941, 9465, 11541, 13810, 16763, 19982, 23515, 26840, 32253, 37461, 42368, 48394, 55737, 62668, 70112, 80029, 89512, 100678, 111427, 124051, 135954, 148630, 166354
Offset: 1

Views

Author

Rick L. Shepherd, Jul 02 2005

Keywords

Examples

			a(3) = 15 because 3, 5 and 7 are the A073882(3) = 3 primes in the interval from 3 to 3^2 inclusive and 3 + 5 + 7 = 15.
		

Crossrefs

Cf. A109819 (product of same primes), A073882 (number of primes between n and n^2).

Programs

  • Mathematica
    Join[{0},Table[Sum[Prime[i],{i,If[PrimeQ[n],PrimePi[n],PrimePi[n]+1],PrimePi[n^2]}],{n,2,39}]] (* James C. McMahon, Apr 02 2024 *)
  • PARI
    for(n=1,50,print1(sum(k=n,n^2,if(isprime(k),k)),","))
Showing 1-6 of 6 results.