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 11-20 of 2214 results. Next

A237705 Number of primes p < n with pi(n-p) prime, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 11 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 4, and a(n) = 1 only for n = 5, 12, 26, 27, 32, 68.
(ii) For any integer n > 5, there is a prime p <= n with pi(n+p) prime.
(iii) If n > 32, then pi((n-p)^2) is prime for some prime p < n. Also, for each n > 6 there is an odd prime p < 2*n with pi((n - (p-1)/2)^2) prime.
(iv) Any integer n > 11 can be written as p + q with p and pi(q^2 + q + 1) both prime.
(v) Each integer n > 34 can be written as k + m with k and m positive integers such that pi(k^2) and pi(2*m^2) are both prime.

Examples

			a(5) = 1 since 2 and pi(5-2) = pi(3) = 2 are both prime.
a(12) = 1 since 7 and pi(12-7) = pi(5) = 3 are both prime.
a(15) = 2 since 3 and pi(15-3) = pi(12) = 5 are both prime, and 11 and pi(15-11) = pi(4) = 2 are both prime.
a(26) = 1 since 23 and pi(26-23) = 2 are both prime.
a(27) = 1 since 23 and pi(27-23) = 2 are both prime.
a(32) = 1 since 29 and pi(32-29) = 2 are both prime.
a(68) = 1 since 37 and pi(68-37) = pi(31) = 11 are both prime.
		

Crossrefs

Programs

  • Mathematica
    q[n_]:=PrimeQ[PrimePi[n]]
    a[n_]:=Sum[If[q[n-Prime[k]],1,0],{k,1,PrimePi[n-1]}]
    Table[a[n],{n,1,70}]

A328846 The second Fibonacci based variant of arithmetic derivative: a(p) = A000045(2+A000720(p)) for prime p, a(u*v) = a(u)*v + u*a(v), with a(0) = a(1) = 0. Also called PrimePi-Fibonacci variant of the arithmetic derivative.

Original entry on oeis.org

0, 0, 2, 3, 8, 5, 12, 8, 24, 18, 20, 13, 36, 21, 30, 30, 64, 34, 54, 55, 60, 45, 48, 89, 96, 50, 68, 81, 88, 144, 90, 233, 160, 72, 102, 75, 144, 377, 148, 102, 160, 610, 132, 987, 140, 135, 224, 1597, 240, 112, 150, 153, 188, 2584, 216, 120, 232, 222, 346, 4181, 240, 6765, 528, 198, 384, 170, 210, 10946, 272, 336, 220, 17711, 360
Offset: 0

Views

Author

Antti Karttunen, Oct 28 2019

Keywords

Crossrefs

Cf. also A003415, A258851, A328768, A328769, A328845 for other arithmetic derivatives, and also A371192 for another PrimePi-Fibonacci variant.
Cf. A374035 [= gcd(a(n), A328845(n))], A374048 (antiparity of this sequence), A374049 (indices of even terms), A374050 (of odd terms).

Programs

  • PARI
    A328846(n) = if(n<=1, 0, my(f=factor(n)); n*sum(i=1, #f~, f[i, 2]*fibonacci(2+primepi(f[i,1]))/f[i, 1]));

Formula

a(n) = n * Sum e_j * A000045(2+A000720(p_j))/p_j for n = Product p_j^e_j.
a(A000040(n)) = A000045(2+n).
A007895(a(n)) = A328848(n).

A237598 a(n) = |{0 < k < prime(n): pi(k*n) is a square}|, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 10 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 0.
(ii) For each n > 9, there is a positive integer k < prime(n)/2 such that pi(k*n) is a triangular number.
See also A237612 for the least k > 0 with pi(k*n) a square.

Examples

			a(3) = 1 since pi(3*3) = 2^2 with 3 < prime(3) = 5.
a(6) = 2 since pi(4*6) = 3^2 with 4 < prime(6) = 13, and pi(9*6) =  4^2 with 9 < prime(6) = 13.
a(15) = 1 since pi(28*15) = 9^2 with 28 < prime(15) = 47.
a(62) = 1 since pi(68*62) = 24^2 with 68 < prime(62) = 293.
a(459) = 1 since pi(2544*459) = 301^2 with 2544 < prime(459) = 3253.
		

Crossrefs

Programs

  • Mathematica
    sq[n_]:=IntegerQ[Sqrt[PrimePi[n]]]
    a[n_]:=Sum[If[sq[k*n],1,0],{k,1,Prime[n]-1}]
    Table[a[n],{n,1,70}]

A065358 The Jacob's Ladder sequence: a(n) = Sum_{k=1..n} (-1)^pi(k), where pi = A000720.

Original entry on oeis.org

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

Views

Author

Jason Earls, Oct 31 2001

Keywords

Comments

Partial sums of A065357.

Crossrefs

Cf. A000720, A065357, A064940 (the zero terms).

Programs

  • Maple
    with(numtheory): f:=n->add((-1)^pi(k),k=1..n); [seq(f(n),n=0..60)]; # N. J. A. Sloane, Feb 20 2018
  • Mathematica
    Table[Sum[(-1)^(PrimePi[k]), {k,1,n}], {n,0,100}] (* G. C. Greubel, Feb 20 2018 *)
    a[0] = 0; a[n_] := a[n] = a[n - 1] + (-1)^PrimePi[n]; Array[a, 105, 0] (* Robert G. Wilson v, Feb 20 2018 *)
  • PARI
    { a=0; for (n=1, 1000, a+=(-1)^primepi(n); write("b065358.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 30 2009
    [0] cat [(&+[(-1)^(#PrimesUpTo(k)):k in [1..n]]): n in [1..100]];  // G. C. Greubel, Feb 20 2018

Extensions

Edited by Frank Ellermann, Feb 02 2002
Edited by N. J. A. Sloane, Feb 20 2018 (added initial term a(0)=0, added name suggested by the Fraile et al. paper)

A179196 Number of primes up to the n-th Ramanujan prime: A000720(A104272(n)).

Original entry on oeis.org

1, 5, 7, 10, 13, 15, 17, 19, 20, 25, 26, 28, 31, 35, 36, 39, 41, 42, 49, 50, 51, 52, 53, 56, 57, 60, 63, 64, 69, 70, 73, 74, 79, 80, 81, 83, 84, 85, 89, 93, 94, 96, 104, 105, 107, 108, 109, 110, 111, 116, 117, 118, 119, 120, 123, 128, 129, 131, 133, 136, 140, 142, 143
Offset: 1

Views

Author

John W. Nicholson, Jul 02 2010

Keywords

Comments

a(n) = k = pi(p_k) = pi(R_n), where pi is the prime number counting function and R_n is the n-th Ramanujan prime. I.e., p_k, the k-th prime, is the n-th Ramanujan prime.
Prime index of A168421(n), that is A000720(A168421(n)), is equal to a(n) - n + 1. - John W. Nicholson, Sep 16 2015

Examples

			The 10th Ramanujan prime is 97, and pi(97) = 25, so a(10) = 25.
		

Crossrefs

Programs

Formula

a(n) = A000720(A104272(n)).
a(n) = rho(n) in the paper by Sondow, Nicholson, and Noe.
prime(a(n)) = R_n = A104272(n).
a(n) = A000720(A168421(n)) + n - 1. - John W. Nicholson, Sep 16 2015

A095691 Multiplicative with a(p^e) = A000720(e)+1.

Original entry on oeis.org

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

Views

Author

Vladeta Jovovic, Jul 06 2004

Keywords

Comments

The number of divisors of n that are terms of A056166. - Amiram Eldar, Oct 31 2023

Crossrefs

Programs

  • Mathematica
    Array[Times @@ Map[PrimePi@# + 1 &, FactorInteger[#][[All, -1]] ] &, 120] (* Michael De Vlieger, Jul 19 2017 *)
  • PARI
    A095691(n) = { my(f = factor(n), m = 1); for (k=1, #f~, m *= (1+primepi(f[k, 2])); ); m; } \\ Antti Karttunen, Jul 19 2017
    
  • Python
    from sympy import factorint, primepi, prod
    def a(n): return 1 if n==1 else prod(primepi(e) + 1 for e in factorint(n).values())
    print([a(n) for n in range(1, 51)]) # Indranil Ghosh, Jul 19 2017

Formula

Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Product_{p prime} (1 + Sum_{q prime} 1/p^q) = Sum_{n>=1} 1/A056166(n) = 1.80728269690724154161... . - Amiram Eldar, Oct 31 2023

A237706 Number of primes p < n with pi(n-p) a square, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 11 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 2, and a(n) = 1 only for n = 3, 5, 6, 7, 8, 16, 17, 22, 23, 148, 149.
(ii) For any integer n > 2, there is a prime p < n with pi(n-p) a triangular number.
We have verified that a(n) > 0 for every n = 3, ..., 1.5*10^7. See A237710 for the least prime p < n with pi(n-p) a square.
See also A237705, A237720 and A237721 for similar conjectures.

Examples

			a(8) = 1 since 7 is prime with pi(8-7) = 0^2.
a(16) = 1 since 7 is prime with pi(16-7) = 2^2.
a(149) = 1 since 139 is prime with pi(149-139) = pi(10) = 2^2.
a(637) = 2 since 409 is prime with pi(637-409) = pi(228) = 7^2, and 613 is prime with pi(637-613) = pi(24) = 3^2.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=IntegerQ[Sqrt[n]]
    q[n_]:=SQ[PrimePi[n]]
    a[n_]:=Sum[If[q[n-Prime[k]],1,0],{k,1,PrimePi[n-1]}]
    Table[a[n],{n,1,70}]

A276077 Number of distinct prime factors p of n such that p^(1+A000720(p)) is a divisor of n, where A000720(p) gives the index of prime p, 1 for 2, 2 for 3, 3 for 5, and so on.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1
Offset: 1

Views

Author

Antti Karttunen, Aug 18 2016

Keywords

Examples

			For n = 2 (= prime(1)), 2 is not divisible by 2^(1+1), thus a(2) = 0.
For n = 3 (= prime(3)), 3 is not divisible by 3^(2+1), thus a(3) = 0.
For n = 4 (= prime(1)^2), 4 is divisible by 2^(1+1), and there are no other prime factors apart from 2, thus a(4) = 1.
For n = 108 = 2^2 * 3^3, it is divisible both by 2^(1+1) and 3^(2+1), thus a(108) = 2.
For n = 625 = prime(3)^4, it is divisible by 5^(3+1), thus a(625) = 1.
		

Crossrefs

Cf. A276078 (positions of zeros), A276079 (nonzeros), also A276076.
Differs from A129251 for the first time at n=625, where a(625) = 1, while A129251(625) = 0.

Programs

  • Mathematica
    f[p_, e_] := If[PrimePi[p] < e, 1, 0]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 30 2023 *)
  • PARI
    a(n) = {my(f = factor(n)); sum(i = 1, #f~, primepi(f[i,1]) < f[i,2]);} \\ Amiram Eldar, Sep 30 2023
  • Python
    from sympy import primepi, isprime, primefactors, factorint
    def a028234(n):
        f=factorint(n)
        return 1 if n==1 else n//(min(f)**f[min(f)])
    def a067029(n):
        f=factorint(n)
        return 0 if n==1 else f[min(f)]
    def a049084(n): return primepi(n)*(isprime(n))
    def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
    def a(n):
        if n==1: return 0
        val = a(a028234(n))
        if a067029(n) > a055396(n):
            val += 1
        return val
    print([a(n) for n in range(1, 201)]) # Indranil Ghosh, Jun 21 2017
    
  • Scheme
    (define (A276077 n) (if (= 1 n) 0 (+ (A276077 (A028234 n)) (if (> (A067029 n) (A055396 n)) 1 0))))
    

Formula

This formula uses Iverson bracket, which gives 1 as its value if the condition given inside [ ] is true and 0 otherwise:
a(1) = 0, for n > 1, a(n) = a(A028234(n)) + [A067029(n) > A055396(n)].
Other identities. For all n >= 1:
a(A276076(n)) = 0.
From Amiram Eldar, Sep 30 2023: (Start)
Additive with a(p^e) = 1 if primepi(p) < e, and 0 otherwise.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{k>=1} 1/prime(k)^(k+1) = 0.2886971166123417096098... . (End)

A060208 a(n) = 2*pi(n) - pi(2*n), where pi(i) = A000720(i).

Original entry on oeis.org

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

Views

Author

Labos Elemer, Mar 19 2001

Keywords

Comments

Rosser & Schoenfeld show 2*pi(x) > pi(2*x) for x > 10. - N. J. A. Sloane, Jul 03 2013, corrected Jul 09 2015

Examples

			n=100, pi(100)=25, pi(200)=46, 2pi(100)-pi(2*100) =4=a(100)
		

References

  • J. Barkley Rosser and Lowell Schoenfeld, Abstracts of Scientific Communications, Internat. Congress Math., Moscow, 1966, Section 3, Theory of Numbers.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section VII.5, p. 235.
  • Sanford Segal, On Pi(x+y)<=Pi(x)+Pi(y). Transactions American Mathematical Society, 104 (1962), 523-527.

Crossrefs

Programs

  • Magma
    [2*#PrimesUpTo(n) -#PrimesUpTo(2*n): n in [1..200]]; // G. C. Greubel, Aug 01 2024
    
  • Mathematica
    f[n_] := 2 PrimePi[n] - PrimePi[2 n]; Array[f, 122] (* Robert G. Wilson v, Aug 12 2011 *)
  • PARI
    a(n)=2*primepi(n)-primepi(2*n) \\ Charles R Greathouse IV, Jul 02 2013
    
  • SageMath
    [2*prime_pi(n) -prime_pi(2*n) for n in range(1,201)] # G. C. Greubel, Aug 01 2024

Formula

a(n) = Mod[2*PrimePi[n], PrimePi[2n]] = 2*A000720(n) - A000720(2n) for n>1.
a(n) ~ 2n log 2 / (log n)^2, by the prime number theorem. - N. J. A. Sloane, Mar 12 2007
a(n) = -A047886(n,n) (see A212210 to A212213). - Reinhard Zumkeller, Apr 15 2008

Extensions

Edited by N. J. A. Sloane, Jul 03 2013

A087235 a(n) is the largest number in the set of solutions to n=x/pi(x), where pi(x)=A000720(x).

Original entry on oeis.org

8, 33, 120, 360, 1134, 3094, 8472, 24300, 64720, 175197, 481452, 1304719, 3524654, 9560100, 25874784, 70119985, 189969354, 514278263, 1394199300, 3779856633, 10246936436, 27788573803, 75370126416, 204475055200, 554805820556, 1505578026105, 4086199303004, 11091501633037
Offset: 2

Views

Author

Labos Elemer, Sep 04 2003

Keywords

Examples

			n=22: list of solutions = {10246935644, 10246935842, 10246935864, 10246935974, 10246936106, 10246936128, 10246936370, 10246936436}, so a(22)=10246936436.
		

Crossrefs

Formula

a(n) = Max{x; n*pi(x)=x}.

Extensions

More terms from David Radcliffe, Sep 10 2014
a(29) corrected and a(30)-a(50) obtained from the values of A038625 computed by Jan Büthe. - Giovanni Resta, Sep 01 2018
Previous Showing 11-20 of 2214 results. Next