OFFSET
0,6
EXAMPLE
2^4 = 16 = 7 + 3*3, so a(4) = 1.
2^5 = 32 = 7 + 5*5 = 11 + 3*7 = 17 + 3*5 = 23 + 3*3, so a(5) = 4.
PROG
(C)
#include <stdio.h>
#include <math.h>
#define TOP (1ULL<<32)
int main() {
unsigned long long i, j, k, n, pp = 0, x, px, y, py, sr;
unsigned int *primes = (unsigned int*)malloc(TOP/4);
char *c = (char*)malloc(TOP/2);
memset(c, 0, TOP/2);
for (c[0] = i = 3; i < TOP; i+=2)
if (c[i>>1]==0)
for (primes[pp++]=i, j=i*i>>1; j<TOP/2; j+=i) c[j]=1;
for (n = 1; n <= TOP; n+=n) {
for (k = x = 0; x < pp && (px = primes[x]) < n; ++x) {
for (i=n-px, sr=sqrt(i), y=0; (py=primes[y])<=sr; ++y)
if (i % py == 0) { if (c[i/py>>1] == 0) ++k; break; }
}
printf("%llu, ", k);
}
}
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Alex Ratushnyak, May 10 2013
STATUS
approved