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.

A230774 Number of primes less than first prime above square root of n.

This page as a plain text file.
%I A230774 #21 Nov 04 2024 17:30:03
%S A230774 1,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,
%T A230774 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
%U A230774 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
%N A230774 Number of primes less than first prime above square root of n.
%C A230774 Or repeat k (prime(k)^2 - prime(k-1)^2) times, with prime(0) set to 0 for k = 1.
%C A230774 This sequence is useful to compute A055399 for prime numbers.
%H A230774 Jean-Christophe Hervé, <a href="/A230774/b230774.txt">Table of n, a(n) for n = 1..10000</a>
%F A230774 Repeat 1 prime(1)^2 = 4 times; for k>1, repeat k (prime(k)^2-prime(k-1)^2) = A050216(k-1) times.
%F A230774 a(n) - A056811(n) = characteristic function of squares of primes.
%e A230774 a(5) = a(6) = a(7) = a(8) = a(9) = 2 because prime(1) = 2 < sqrt(5 to 9) <= prime(2) = 3.
%t A230774 Table[1 + PrimePi[Sqrt[n-1]], {n, 100}] (* _Alonso del Arte_, Nov 01 2013 *)
%o A230774 (Python)
%o A230774 from math import isqrt
%o A230774 from sympy import primepi
%o A230774 def A230774(n): return primepi(isqrt(n-1))+1 # _Chai Wah Wu_, Nov 04 2024
%Y A230774 Cf. A050216, A056811, A055399, A230775.
%K A230774 nonn,easy
%O A230774 1,5
%A A230774 _Jean-Christophe Hervé_, Nov 01 2013