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.

A094757 Least positive k <= n such that n*pi(k) = k*pi(n), where pi(n) is the number of primes <= n (A000720).

Original entry on oeis.org

1, 2, 3, 2, 5, 2, 7, 2, 9, 10, 11, 12, 13, 14, 10, 16, 17, 18, 19, 10, 21, 22, 23, 16, 25, 26, 27, 28, 29, 27, 31, 32, 27, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 40, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 56, 64, 65, 66, 67, 68, 69, 70, 71, 72
Offset: 1

Views

Author

Amarnath Murthy, May 30 2004

Keywords

Comments

Conjecture: For every n there exists a k different from n (possibly k > n) such that n*pi(k) = k*pi(n).
From David A. Corneth, Nov 15 2019: (Start)
If n*pi(k) = k*pi(n) then n/pi(n) = k/pi(k). So to find terms, one can make a list of pairs (k/pi(k), k) and sort them.
Then if for two such pairs (m/pi(m), m) and (k/pi(k), k), m > k have the same first element, i.e., m/pi(m) = k/pi(k) then a(m) = k for the least k with that ratio.
Amarnath Murthy's conjecture above is false. For n = 3 we have pi(n)/n = 2/3. For no other k we have pi(k)/k = 2/3. Therefore the conjecture is false. (End)

Examples

			a(15) = 10 as 15*pi(10) = 15*4 = 60 = 10*pi(15) = 10*6.
For k in {2, 4, 6, 8} we have pi(k)/k = 1/2 and for no k < 2 this holds. So for all these values a(k) = 2. - _David A. Corneth_, Nov 15 2019
		

Crossrefs

Cf. A095299 for n such that a(n) < n.

Programs

  • Mathematica
    Table[SelectFirst[Range[n], n PrimePi[#] == # PrimePi[n] &], {n, 72}] (* Michael De Vlieger, Dec 14 2019 *)
  • PARI
    {m=72;pi=vector(m,n,omega(n!));for(n=1,m,k=1;while(n*pi[k]!=k*pi[n],k++);print1(k,","))}
    
  • PARI
    first(n) = {n = nextprime(n); my(v = vector(n), t = -1, q = 1, res = vector(n), m); v[1] = [0, 1]; v[2] = [1/2, 2]; forprime(p = 2, n, t++; for(c = q, p - 1, v[c] = [t/c, c]; ); q = p ); v[n] = [t/n,n]; v = vecsort(v); res[1] = 1; for(i = 2, #v, if(v[i-1][1] != v[i][1], m = v[i][2]; ); res[v[i][2]] = m ); res } \\ David A. Corneth, Nov 15 2019

Extensions

Edited and extended by Klaus Brockhaus, Jun 01 2004