OFFSET
0,37
COMMENTS
EXAMPLE
12 = 2^2 + 2^3, so a(12) = 1.
36 = 32 + 4 = 27 + 9, so a(36) = 2.
MATHEMATICA
nn = 100; p = Sort[Flatten[Table[Prime[n]^i, {n, PrimePi[Sqrt[nn]]}, {i, 2, Log[Prime[n], nn]}]]]; t =Sort[Select[Flatten[Table[p[[i]] + p[[j]], {i, Length[p] - 1}, {j, i + 1, Length[p]}]], # <= nn &]]; Table[Count[t, n], {n, 0, nn}] (* T. D. Noe, Apr 29 2013 *)
PROG
(C)
#include <stdio.h>
#include <stdlib.h>
#define TOP (1ULL<<17)
unsigned long long *powers, pwFlat[TOP], primes[TOP] = {2};
int main() {
unsigned long long a, c, i, j, k, n, p, r, pp = 1, pfp = 0;
powers = (unsigned long long*)malloc(TOP * TOP/8);
memset(powers, 0, TOP * TOP/8);
for (a = 3; a < TOP; a += 2) {
for (p = 0; p < pp; ++p) if (a % primes[p] == 0) break;
if (p == pp) primes[pp++] = a;
}
for (k = i = 0; i < pp; ++i)
for (j = primes[i]*primes[i]; j < TOP*TOP; j *= primes[i])
powers[j/64] | = 1ULL << (j & 63), ++k;
if (k > TOP) exit(1);
for (n = 0; n < TOP * TOP; ++n)
if (powers[n/64] & (1ULL << (n & 63))) pwFlat[pfp++] = n;
for (n = 0; n < TOP * TOP; ++n) {
for (c = i = 0; pwFlat[i] * 2 < n; ++i)
r=n-pwFlat[i], c+= (powers[r/64] & (1ULL <<(r&63))) > 0;
printf("%llu, ", c);
}
return 0;
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Apr 27 2013
STATUS
approved