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.

A085971 Union of primes and numbers that are not prime powers (A000040, A024619).

This page as a plain text file.
%I A085971 #12 Aug 20 2024 13:19:50
%S A085971 2,3,5,6,7,10,11,12,13,14,15,17,18,19,20,21,22,23,24,26,28,29,30,31,
%T A085971 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,51,52,53,54,55,56,
%U A085971 57,58,59,60,61,62,63,65,66,67,68,69,70,71,72,73,74,75,76,77,78
%N A085971 Union of primes and numbers that are not prime powers (A000040, A024619).
%C A085971 Complement of A025475;
%C A085971 A085972(n) = Max{k: a(k)<=n};
%C A085971 different from A007916 and A052485, as a(28)=36;
%C A085971 A085818(a(n)) = A000040(n).
%F A085971 a(n) = n + o(sqrt n). - _Charles R Greathouse IV_, Oct 19 2015
%t A085971 With[{nn=100},Union[Join[Prime[Range[PrimePi[nn]]],DeleteCases[Range[2,80], _?(PrimePowerQ[#]&)]]]] (* _Harvey P. Dale_, May 15 2019 *)
%o A085971 (PARI) is(n)=isprimepower(n)<2 && n>1 \\ _Charles R Greathouse IV_, Oct 19 2015
%o A085971 (Python)
%o A085971 from sympy import primepi, integer_nthroot
%o A085971 def A085971(n):
%o A085971     def f(x): return int(n+sum(primepi(integer_nthroot(x,k)[0]) for k in range(2,x.bit_length())))
%o A085971     kmin, kmax = 1,2
%o A085971     while f(kmax) >= kmax:
%o A085971         kmax <<= 1
%o A085971     while True:
%o A085971         kmid = kmax+kmin>>1
%o A085971         if f(kmid) < kmid:
%o A085971             kmax = kmid
%o A085971         else:
%o A085971             kmin = kmid
%o A085971         if kmax-kmin <= 1:
%o A085971             break
%o A085971     return kmax # _Chai Wah Wu_, Aug 20 2024
%K A085971 nonn,easy
%O A085971 1,1
%A A085971 _Reinhard Zumkeller_, Jul 06 2003