Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #5 May 10 2013 14:07:39
%S 0,0,0,0,1,4,5,15,22,43,65,131,204,387,635,1136,2048,3727,6794,12296,
%T 22601,41746,76778,141923,263414,491925,917269,1718985,3225496,
%U 6067030,11435208,21593415,40858139
%N Numbers of triples {x, y, z} such that z >= y > 1 and prime(x) + prime(y) * prime(z) = 2^n.
%e 2^4 = 16 = 7 + 3*3, so a(4) = 1.
%e 2^5 = 32 = 7 + 5*5 = 11 + 3*7 = 17 + 3*5 = 23 + 3*3, so a(5) = 4.
%o (C)
%o #include <stdio.h>
%o #include <math.h>
%o #define TOP (1ULL<<32)
%o int main() {
%o unsigned long long i, j, k, n, pp = 0, x, px, y, py, sr;
%o unsigned int *primes = (unsigned int*)malloc(TOP/4);
%o char *c = (char*)malloc(TOP/2);
%o memset(c, 0, TOP/2);
%o for (c[0] = i = 3; i < TOP; i+=2)
%o if (c[i>>1]==0)
%o for (primes[pp++]=i, j=i*i>>1; j<TOP/2; j+=i) c[j]=1;
%o for (n = 1; n <= TOP; n+=n) {
%o for (k = x = 0; x < pp && (px = primes[x]) < n; ++x) {
%o for (i=n-px, sr=sqrt(i), y=0; (py=primes[y])<=sr; ++y)
%o if (i % py == 0) { if (c[i/py>>1] == 0) ++k; break; }
%o }
%o printf("%llu, ", k);
%o }
%o }
%Y Cf. A000040, A006307, A225437.
%K nonn,more
%O 0,6
%A _Alex Ratushnyak_, May 10 2013