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 A078687 #16 Jul 08 2014 00:40:28 %S A078687 0,1,1,2,2,2,1,3,2,1,2,2,1,2,2,1,1,3,2,2,2,2,3,1,1,2,2,2,2,2,0,3,1,4, %T A078687 0,2,2,1,3,2,1,4,1,1,2,4,2,1,3,3,1,1,3,0,2,2,1,3,2,1,2,3,1,1,2,2,0,0, %U A078687 2,2,3,1,2,0,2,3,1,2,2,2,1,3,1,2,2,2,2,1,2,2,2,2,2,1,2,3,0,1,3,2,1,1,3,1,4 %N A078687 Number of x>=0 such that prime(n)-2^x is prime. %H A078687 T. D. Noe, <a href="/A078687/b078687.txt">Table of n, a(n) for n = 1..1000</a> %F A078687 a(A049084(A065381(n)))=0, a(A049084(A065380(n)))=1; A118953(n)<=a(n); a(n)=A109925(A000040(n)). - _Reinhard Zumkeller_, May 07 2006 %e A078687 prime(17)=59 and only 59-2^3 = 53 is prime hence a(17)=1 %t A078687 f[p_] := Block[{c = exp = 0, lmt = 1 + Floor@ Log2@ p}, While[exp < lmt, If[ PrimeQ[p - 2^exp], c++]; exp++]; c]; Array[ f@ Prime@# &, 105] (* _Robert G. Wilson v_, Jul 07 2014 *) %o A078687 (PARI) a(n)=sum(i=0,floor(log(prime(n))/log(2)),if(isprime(prime(n)-2^i),1,0)) %Y A078687 Cf. A156695. %K A078687 nonn %O A078687 1,4 %A A078687 _Benoit Cloitre_, Dec 17 2002