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.

A225533 Numbers expressible as p^2 + 2^q where p and q are primes.

This page as a plain text file.
%I A225533 #9 May 15 2013 19:29:54
%S A225533 8,12,13,17,29,33,36,41,53,57,81,125,129,132,137,153,173,177,201,249,
%T A225533 293,297,321,365,369,393,417,489,533,537,561,657,845,849,873,965,969,
%U A225533 993,1089,1373,1377,1401,1497,1685,1689,1713,1809,1853,1857,1881,1977,2052
%N A225533 Numbers expressible as p^2 + 2^q where p and q are primes.
%C A225533 a(n) ~ n^2. For n > 468, the formula .358*n^2.085 provides an estimate of a(n) accurate to within 11%.
%C A225533 a(10) = 57 is the first term that meets the criterion in two ways (5^2 + 2^5 and 7^2 + 2^3). In the first 10000 terms, there are 30 terms expressible in two ways, but none expressible in three ways.
%H A225533 Christian N. K. Anderson, <a href="/A225533/b225533.txt">Table of n, a(n) for n = 1..10000</a>
%H A225533 Christian N. K. Anderson, <a href="/A225533/a225533.gif">Ulam Spiral of a(n)</a> for n = 1..10000.
%H A225533 Christian N. K. Anderson, <a href="/A225533/a225533.txt">Table of n, a(n), and all values of (p,q) producing a(n)</a> for n = 1..10000.
%e A225533 29 = 5^2 + 2^2, and both 5 and 2 are prime.
%t A225533 nn = 15; ps = Prime[Range[nn]]; p2 = Prime[Range[PrimePi[2*Log[2, ps[[-1]]]]]]; t = Table[p^2 + 2^q, {p, ps}, {q, p2}]; Union[Select[Flatten[t], # < ps[[-1]]^2 &]] (* _T. D. Noe_, May 15 2013 *)
%o A225533 (R) library(gmp); x=y=as.bigz(2); maxval=10000; sol=as.bigz(matrix(0,nc=3,nr=1000)); len=0
%o A225533 while(len<1000 & x^2+2^y<maxval) {
%o A225533 while(len<1000 & (k=x^2+2^y)<maxval) {
%o A225533     sol[(len=len+1),]=c(k,x,y)
%o A225533     y=nextprime(y)
%o A225533 }
%o A225533 x=nextprime(x); y=2
%o A225533 }
%o A225533 sol=sol[1:len,]; sort(unique(as.numeric(sol[,1])))
%Y A225533 Cf. A000040, A001248, A034785.
%K A225533 nonn
%O A225533 1,1
%A A225533 _Kevin L. Schwartz_ and _Christian N. K. Anderson_, May 09 2013