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.
%I A089237 #42 Oct 13 2024 02:39:49 %S A089237 0,1,2,3,4,5,7,9,11,13,16,17,19,23,25,29,31,36,37,41,43,47,49,53,59, %T A089237 61,64,67,71,73,79,81,83,89,97,100,101,103,107,109,113,121,127,131, %U A089237 137,139,144,149,151,157,163,167,169,173,179,181,191,193,196,197,199,211,223,225,227 %N A089237 List of primes and squares. %C A089237 Starting at a(1) = 1, this is the lexicographically earliest sequence of distinct numbers whose partial products are all exponentially odd numbers (A268335). - _Amiram Eldar_, Sep 24 2024 %H A089237 Zak Seidov, <a href="/A089237/b089237.txt">Table of n, a(n) for n = 1..1000</a> %F A089237 a(A161187(n)+1) = A000290(n); a(A161188(n)+1) = A000040(n). - _Reinhard Zumkeller_, Dec 18 2012 %F A089237 A010051(a(n)) + A010052(a(n)) = 1. - _Reinhard Zumkeller_, Jul 07 2014 %F A089237 a(n) ~ n log n. - _Charles R Greathouse IV_, Oct 14 2016 %t A089237 m=100; Sort[Flatten[{Range[0,m]^2, Prime[Range[PrimePi[m^2]]]}]] (* _Zak Seidov_, Nov 05 2009 *) %o A089237 (Haskell) %o A089237 a089237 n = a089237_list !! (n-1) %o A089237 a089237_list = merge a000040_list a000290_list where %o A089237 merge xs'@(x:xs) ys'@(y:ys) = %o A089237 if x < y then x : merge xs ys' else y : merge xs' ys %o A089237 -- _Reinhard Zumkeller_, Dec 18 2012 %o A089237 (PARI) is(n)=isprime(n) || issquare(n) \\ _Charles R Greathouse IV_, Oct 14 2016 %o A089237 (PARI) {A89237=List([0..5]); A089237(n)=while(#A89237<n, my(t=A89237[#A89237]); forprime(p=t+1, t=(sqrtint(t)+1)^2, listput(A89237, p)); listput(A89237, t)); A89237[n]} \\ For use in other functions, e.g., A340389. - _M. F. Hasler_, Jul 24 2021, edited Sep 01 2021 %o A089237 (Python) %o A089237 from math import isqrt %o A089237 from sympy import primepi %o A089237 def A089237(n): %o A089237 def bisection(f,kmin=0,kmax=1): %o A089237 while f(kmax) > kmax: kmax <<= 1 %o A089237 while kmax-kmin > 1: %o A089237 kmid = kmax+kmin>>1 %o A089237 if f(kmid) <= kmid: %o A089237 kmax = kmid %o A089237 else: %o A089237 kmin = kmid %o A089237 return kmax %o A089237 def f(x): return int(n-1+x-primepi(x)-isqrt(x)) %o A089237 return bisection(f,n-1,n-1) # _Chai Wah Wu_, Oct 12 2024 %Y A089237 Complement of A089229. %Y A089237 Cf. A000040, A000290, A010051, A010052, A161187, A161188, A268335. %K A089237 nonn %O A089237 1,3 %A A089237 _N. J. A. Sloane_, Dec 11 2003