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.

A181970 Places of nonprimes in A050376.

This page as a plain text file.
%I A181970 #34 Feb 19 2025 12:34:33
%S A181970 3,6,9,13,20,28,37,47,63,71,83,111,127,160,177,235,280,301,348,377,
%T A181970 430,509,542,633,700,731,838,875,915,1030,1194,1284,1327,1415,1458,
%U A181970 1559,1752,1915,2015,2181,2231,2531,2590,2773,2960,3089,3154,3289,3485,3562,3919,3997,4142
%N A181970 Places of nonprimes in A050376.
%C A181970 Or numbers not expressed in the form pi(p) + pi(sqrt(p)) + pi((sqrt(sqrt(p)))) +... with prime p.
%H A181970 Charles R Greathouse IV, <a href="/A181970/b181970.txt">Table of n, a(n) for n = 1..10000</a>
%F A181970 a(n) ~ 0.5 n^2 log n. - _Charles R Greathouse IV_, Apr 11 2012
%e A181970 Show that 28 not expressed in form pi(p) + pi(sqrt(p)) + pi((sqrt(sqrt(p)))) +... with prime p. Indeed, for p=79, this sum is 22+4+1=27, while for p=83, it is 23+4+2=29.
%o A181970 (PARI) first_few(lim)=my(v=List(apply(n->n^2, primes(primepi(sqrtint(lim))))),u,t); forprime(p=2,(lim+.5)^(1/4),t=p^2;while((t=t^2)<=lim,listput(v,t)));listput(v,1);v=vecsort(Vec(v));u=vector(#v-1,i,sum(j=v[i]+1,v[i+1]-1,isprime(j)));u[1]++;for(i=2, #u, u[i]+=u[i-1]+1);u \\ _Charles R Greathouse IV_, Apr 10 2012
%o A181970 (Python)
%o A181970 from sympy import primepi, integer_nthroot
%o A181970 def A181970(n):
%o A181970     def bisection(f,kmin=0,kmax=1):
%o A181970         while f(kmax) > kmax: kmax <<= 1
%o A181970         kmin = kmax >> 1
%o A181970         while kmax-kmin > 1:
%o A181970             kmid = kmax+kmin>>1
%o A181970             if f(kmid) <= kmid:
%o A181970                 kmax = kmid
%o A181970             else:
%o A181970                 kmin = kmid
%o A181970         return kmax
%o A181970     def f(x): return n+x-sum(primepi(integer_nthroot(x,1<<i)[0]) for i in range(1,x.bit_length().bit_length()))
%o A181970     m = bisection(f,n,n)
%o A181970     return sum(primepi(integer_nthroot(m,1<<i)[0]) for i in range(m.bit_length().bit_length())) # _Chai Wah Wu_, Feb 18-19 2025
%Y A181970 Cf. A050376, A000040, A181962.
%K A181970 nonn
%O A181970 1,1
%A A181970 _Vladimir Shevelev_, Apr 06 2012
%E A181970 a(30)-a(53) from _Charles R Greathouse IV_, Apr 10 2012