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.

Previous Showing 31-40 of 43 results. Next

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

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Oct 09 2015

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 0, and a(n) = 1 only for n = 1, 3, 28.
(ii) Any integer n > 0 can be written as pi(k^2) + pi((m^2+1)/2) with k and m positive integers.
(iii) Each n = 1,2,3,... can be written as pi(k^2/2) + pi((m^2+1)/2) with k and m positive integers.
See also A262995, A262999, A263001 and A263020 for similar conjectures.

Examples

			a(1) = 1 since 1 = 0 + 1 = pi(1^2) + pi(2^2/2).
a(3) = 1 since 3 = 2 + 1 = pi(2^2) + pi(2^2/2).
a(28) = 1 since 28 = 11 + 17 = pi(6^2) + pi(11^2/2).
		

Crossrefs

Programs

  • Mathematica
    s[n_]:=s[n]=PrimePi[n^2]
    t[n_]:=t[n]=PrimePi[n^2/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}]

A263321 Least positive integer m such that the numbers phi(k)*pi(k^2) (k = 1..n) are pairwise incongruent modulo m.

Original entry on oeis.org

1, 3, 5, 7, 11, 13, 16, 19, 19, 19, 29, 29, 29, 37, 37, 59, 59, 59, 59, 59, 59, 59, 59, 101, 101, 101, 133, 133, 133, 133, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 175, 245, 269, 269, 269, 269, 379, 379
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 14 2015

Keywords

Comments

Part (i) of the conjecture in A263319 implies that a(n) exists for any n > 0.
Conjecture: a(n) <= n^2 for all n > 0, and the only even term is a(7) = 16.

Examples

			a(7) = 16 since the 7 numbers phi(1)*pi(1^2) = 0, phi(2)*pi(2^2) = 2, phi(3)*pi(3^2) = 8, phi(4)*pi(4^2) = 12, phi(5)*pi(5^2) = 36, phi(6)*pi(6^2) = 22 and phi(7)*pi(7^2) = 90 are pairwise incongruent modulo 16, but not so modulo any positive integer smaller than 16.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=EulerPhi[n]*PrimePi[n^2]
    Le[n_,m_]:=Le[m,n]=Length[Union[Table[Mod[f[k],m],{k,1,n}]]]
    Do[n=1;m=1;Label[aa];If[Le[n,m]==n,Goto[bb],m=m+1;Goto[aa]];
    Label[bb];Print[n," ",m];If[n<50,n=n+1;Goto[aa]]]

A380331 a(n) = number of primes < n^4.

Original entry on oeis.org

0, 0, 6, 22, 54, 114, 210, 357, 564, 847, 1229, 1715, 2334, 3107, 4052, 5191, 6542, 8152, 10022, 12187, 14683, 17531, 20768, 24421, 28546, 33118, 38236, 43934, 50203, 57097, 64683, 72992, 82025, 91932, 102588, 114204, 126726, 140235, 154787, 170426, 187134
Offset: 0

Views

Author

Clark Kimberling, Jan 21 2025

Keywords

Examples

			a(2) = 6 because there are 6 primes < 16.
		

Crossrefs

Subsequence of A038107, and hence of A000720.

Programs

  • Mathematica
    Table[PrimePi[n^4], {n, 0, 60}]
  • PARI
    a(n)=primepi(n^4) \\ Charles R Greathouse IV, Jan 21 2025
    
  • Python
    from sympy import primepi
    def A380331(n): return primepi(n**4) # Chai Wah Wu, Jan 23 2025

Formula

a(n) = A000720(A000583(n)). - Pontus von Brömssen, Jan 21 2025
a(n) ~ (1/4)*n^4/log n. - Charles R Greathouse IV, Jan 23 2025

A060304 Number of primes below n^3 does not exceed n times the number of primes below n^2.

Original entry on oeis.org

0, 0, 3, 6, 15, 19, 37, 47, 69, 82, 113, 139, 180, 216, 244, 300, 381, 423, 486, 553, 638, 726, 820, 887, 1029, 1152, 1256, 1376, 1527, 1659, 1794, 1992, 2156, 2357, 2517, 2739, 2909, 3085, 3365, 3627, 3933, 4200, 4380, 4687, 4960, 5313, 5547, 5917, 6395
Offset: 0

Views

Author

Labos Elemer, Mar 26 2001

Keywords

Examples

			n=10, 10*pi(100)=250, pi(1000)=168, a(10)=250-168=82.
		

Crossrefs

Programs

  • Mathematica
    Table[n*PrimePi[n^2]-PrimePi[n^3], {n, 1, 100}]

Formula

a(n) = n*pi(n*n) - pi(n*n*n). - Jonathan Sondow, Feb 17 2014
a(n) = n*A038107(n) - A038098(n). - Michel Marcus, Feb 17 2014

A163516 a(n) = floor( Sum_{x=2..n} x/log(x) ).

Original entry on oeis.org

0, 2, 5, 8, 11, 14, 18, 22, 26, 30, 35, 40, 45, 50, 56, 61, 67, 74, 80, 87, 94, 101, 108, 116, 123, 131, 140, 148, 157, 165, 175, 184, 193, 203, 213, 223, 233, 243, 254, 265, 276, 287, 299, 310, 322, 334, 346, 359, 371, 384, 397, 410, 424, 437, 451, 465, 479, 493
Offset: 1

Views

Author

Cino Hilliard, Jul 30 2009

Keywords

Comments

a(n) closely approximates the number of primes < n^2, that is, A038107(n) = Pi(n^2).
In fact, the sum is as good as Li(n^2). For n = 10^9,
a(n) = 24739954333817884.
Pi(n^2) = 24739954287740860 = A006880(18).
Li(n^2) = 24739954309690415 = A057754(18) = A089896(18).
R(n^2) = 24739954284239494 = A057793(18).
Now x/(log(x)-1) is a much better approximation of Pi(x) than x/log(x).
10^18/(log(10^18)-1) = 24723998785919976 and
10^18/log(10^18) = 24127471216847323.
Ironically though, a(n) = Sum_{x=2..n} x/(log(x)-1) is far from Pi(n^2), see A058290.

Examples

			For n = 10, floor(Sum_{x=2..n} x/log(x)) = 30, the 10th term.
		

Programs

  • Mathematica
    Table[Floor[Sum[j/Log[j], {j, 2, n}]], {n,1,50}] (* G. C. Greubel, Jul 27 2017 *)
    Join[{0},Floor[Accumulate[Table[x/Log[x],{x,2,60}]]]] (* Harvey P. Dale, May 22 2021 *)
  • PARI
    nthsum(n) = for(j=1,n,print1(floor(sum(x=2,j,x/log(x)))","));

Formula

a(10^n) = A163521(n).

Extensions

Offset corrected, definition detailed, 7 references to other sequences added by R. J. Mathar, Aug 29 2009

A213649 Smallest k such that there exists a square between prime(n) and prime(n+k).

Original entry on oeis.org

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

Views

Author

Michel Lagneau, Jun 17 2012

Keywords

Comments

a(A038107(n)) = 1 for n >= 2.
a(n) is of the form {S1} union {S2} union ... union {Sk} union ... where a subset Sk is of the form {xk, xk - 1, xk - 2, …, 1 }. We obtain a subsequence Max {Sn} = {xn} = {2, 2, 2, 3, 2, 4, 3, 4, 3, 5, 4, 5, 5, 4, 6, 7, 5, 6, 6, 7, 7, 7, 6, 9, …}.

Examples

			a(7)=3 because prime(7) = 17, prime(7+3) = 29 and  17 < 25 < 29 where 25 is square.
		

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 1 to 100 do:ii:=0:for k from 1 to 100 while(ii=0) do:p1:=ithprime(n):p2:=ithprime(n+k):i:=0:for m from p1+1 to p2-1 do:c:=sqrt(m):if c=floor(c) then i:=i+1:else fi:od: if i<>0 then ii:=1:printf(`%d, `,k):else fi:od:od:

A307533 Primes p such that p+2 has exactly two distinct prime factors.

Original entry on oeis.org

13, 19, 31, 37, 43, 53, 61, 67, 73, 83, 89, 97, 109, 113, 127, 131, 139, 151, 157, 173, 181, 199, 211, 223, 233, 251, 257, 263, 277, 293, 307, 317, 331, 337, 349, 353, 367, 373, 379, 389, 401, 409, 421, 439, 443, 449, 457, 467, 479, 487, 491, 499, 503, 509, 541
Offset: 1

Views

Author

Paolo Galliani, Apr 13 2019

Keywords

Comments

(13,31), (37,73), (157,751), (199,991) are pairs of emirps belonging to this sequence such that the lesser term of the pair is the reverse of the greater. Are there infinitely many such pairs?
Are there infinitely many triples in the sequence like (61,67,73) and (251,257,263), that is, infinitely many a(n) such that a(n+1)=a(n)+6 and a(n+2)=a(n)+12?
The triples found so far are (61,67,73), (251,257,263) and (367,373,379). The first terms of the triples found are 61, 251 and 367, which belong to the sequence A038107.

Examples

			61 is in the sequence because 61 + 2 = 63 has exactly two distinct prime factors (3 and 7).
		

Programs

  • Maple
    filter:= proc(n) isprime(n) and nops(numtheory:-factorset(n+2))=2 end proc:
    select(filter, [seq(i,i=3..1000,2)]); # Robert Israel, Jul 28 2019
  • Mathematica
    Select[Range[500], PrimeQ[#] && PrimeNu[# + 2] == 2 &] (* Amiram Eldar, Apr 14 2019 *)
  • PARI
    isok(p) = isprime(p) && (omega(p+2) == 2); \\ Michel Marcus, May 02 2019

A370796 Number of primes between (prime(n)+1)^2 and (prime(n+1)-1)^2.

Original entry on oeis.org

2, 0, 0, 7, 0, 10, 0, 14, 32, 0, 38, 23, 0, 24, 51, 53, 0, 62, 30, 0, 71, 33, 76, 124, 44, 0, 42, 0, 51, 301, 48, 114, 0, 233, 0, 122, 126, 59, 135, 133, 0, 283, 0, 66, 0, 386, 396, 77, 0, 86, 173, 0, 349, 177, 187, 198, 0, 199, 100, 0, 412, 636, 113, 0, 114, 668, 224, 463, 0, 119, 236, 359
Offset: 1

Views

Author

Rafik Khalfi, Mar 02 2024

Keywords

Comments

If (prime(n),prime(n+1)) is a twin prime pair, then a(n)=0.

Examples

			For n=1, (prime(1+1)-1)^2 = 4, (prime(1)+1)^2 = 9 and we have two primes between 4 and 9, so a(1)=2.
		

Crossrefs

Cf. A050216.

Programs

  • Maple
    A370796:= proc (n)
    local count, a, b, p:
    count := 0:
    a := (ithprime(n)+1)^2:
    b := (ithprime(n+1)-1)^2:
    p := n:
    while ithprime(p) <= b do if a <= ithprime(p) then count := count+1 end if:
    p := p+1 end do:
    return count end proc:
    A370796(1) := 2:
    map(A370796, [$1 .. 100]);
  • Mathematica
    Table[Abs[ PrimePi[(Prime[n+1]-1)^2]- PrimePi[(Prime[n]+1)^2]],{n,72}] (* James C. McMahon, Mar 02 2024 *)
  • Python
    from sympy import primepi, prime, nextprime
    def A370796(n): return -primepi(((p:=prime(n))+1)**2)+primepi((nextprime(p)-1)**2) if n>1 else 2 # Chai Wah Wu, Mar 27 2024

Formula

a(n) = A038107(A000040(n+1)-1) - A038107(A000040(n)+1) for all n > 1;
a(n) = A038107(A000040(n)+1) - A038107(A000040(n+1)-1) for n=1.

A380332 a(n) = number of primes between n^2 and n^4.

Original entry on oeis.org

0, 0, 4, 18, 48, 105, 199, 342, 546, 825, 1204, 1685, 2300, 3068, 4008, 5143, 6488, 8091, 9956, 12115, 14605, 17446, 20676, 24322, 28441, 33004, 38114, 43805, 50066, 56951, 64529, 72830, 81853, 91751, 102397, 114004, 126516, 140016, 154559, 170186, 186883, 204880, 224009, 244527, 266283, 289506, 314148, 340292, 368114, 397407
Offset: 0

Views

Author

Clark Kimberling, Jan 26 2025

Keywords

Comments

p(2) = 4 because there are 4 primes between 4 and 16.

Crossrefs

Programs

  • Mathematica
    Table[PrimePi[n^4] - PrimePi[n^2], {n, 0, 60}]
  • PARI
    a(n) = primepi(n^4) - primepi(n^2); \\ Michel Marcus, Jan 27 2025
    
  • Python
    from sympy import primepi
    def A380332(n): return -primepi(m:=n**2)+primepi(m**2) # Chai Wah Wu, Jan 27 2025

Formula

a(n) = PrimePi(n^4) - PrimePi(n^2).

A132635 Number of primes, 0's, and 1's in [0, n^2).

Original entry on oeis.org

0, 1, 4, 6, 8, 11, 13, 17, 20, 24, 27, 32, 36, 41, 46, 50, 56, 63, 68, 74, 80, 87, 94, 101, 107, 116, 124, 131, 139, 148, 156, 164, 174, 183, 193, 202, 212, 221, 230, 242, 253, 265, 276, 285, 297, 308, 321, 331, 344, 359, 369, 380, 395, 411, 423, 436, 447, 459, 476
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Aug 26 2008

Keywords

Comments

Number of p-adic cyclotomic type levels in A_n-1 or SU(n).

Examples

			SU(5) at n^2-1=24 is exactly inside SU(9) at n^2-1=80.
		

Programs

  • Mathematica
    Table[Sum[If[m == 0 || m == 1, 1, If[PrimeQ[m], 1, 0]], {m, 0,n^2 - 1}], {n, 0, 30}]
  • PARI
    a(n)=if(n<2,n,primepi(n^2)+2) \\ Charles R Greathouse IV, Nov 07 2011

Formula

a(n) = pi(n^2) + 2 = A038107(n) + 2, n > 1. [Charles R Greathouse IV, Nov 07 2011]
Previous Showing 31-40 of 43 results. Next