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 A009087 #40 Feb 22 2025 12:08:18 %S A009087 2,3,4,5,7,9,11,13,16,17,19,23,25,29,31,37,41,43,47,49,53,59,61,64,67, %T A009087 71,73,79,81,83,89,97,101,103,107,109,113,121,127,131,137,139,149,151, %U A009087 157,163,167,169,173,179,181,191,193,197,199,211,223,227,229,233,239 %N A009087 Numbers whose number of divisors is prime (i.e., numbers of the form p^(q-1) for primes p,q). %C A009087 Invented by the HR Automatic Concept Formation Program. If the sum of divisors is prime, then the number of divisors is prime, i.e., this is a supersequence of A023194. %C A009087 A010055(a(n)) * A010051(A100995(a(n))+1) = 1. - _Reinhard Zumkeller_, Jun 06 2013 %D A009087 S. Colton, Automated Theory Formation in Pure Mathematics. New York: Springer (2002) %H A009087 Indranil Ghosh, <a href="/A009087/b009087.txt">Table of n, a(n) for n = 1..12546</a> (terms 1..1000 from T. D. Noe) %H A009087 S. Colton, <a href="http://www.cs.uwaterloo.ca/journals/JIS/colton/joisol.html">Refactorable Numbers - A Machine Invention</a>, J. Integer Sequences, Vol. 2, 1999, #2. %F A009087 p^(q-1), p, q primes. %e A009087 tau(16)=5 and 5 is prime. %t A009087 Select[Range[250],PrimeQ[DivisorSigma[0,#]]&] (* _Harvey P. Dale_, Sep 28 2011 *) %o A009087 (Haskell) %o A009087 a009087 n = a009087_list !! (n-1) %o A009087 a009087_list = filter ((== 1) . a010051 . (+ 1) . a100995) a000961_list %o A009087 -- _Reinhard Zumkeller_, Jun 05 2013 %o A009087 (PARI) is(n)=isprime(isprimepower(n)+1) \\ _Charles R Greathouse IV_, Sep 16 2015 %o A009087 (Python) %o A009087 from sympy import primepi, integer_nthroot, primerange %o A009087 def A009087(n): %o A009087 def bisection(f,kmin=0,kmax=1): %o A009087 while f(kmax) > kmax: kmax <<= 1 %o A009087 kmin = kmax >> 1 %o A009087 while kmax-kmin > 1: %o A009087 kmid = kmax+kmin>>1 %o A009087 if f(kmid) <= kmid: %o A009087 kmax = kmid %o A009087 else: %o A009087 kmin = kmid %o A009087 return kmax %o A009087 def f(x): return int(n+x-sum(primepi(integer_nthroot(x,k-1)[0]) for k in primerange(x.bit_length()+1))) %o A009087 return bisection(f,n,n) # _Chai Wah Wu_, Feb 22 2025 %Y A009087 Subsequence of A000961. %Y A009087 Cf. A023194, A036454, A203967. %K A009087 nice,nonn,easy %O A009087 1,1 %A A009087 Simon Colton (simonco(AT)cs.york.ac.uk)