OFFSET
1,1
EXAMPLE
81 = 32 + 7^2, so 81 is in the sequence.
169 = 25 + 12^2, so 169 is in the sequence.
MAPLE
for n from 1 do
if isA025475(n) then
for j from 1 do
pj := n-j^2 ;
if pj < 0 then
break;
elif isA025475(pj) then
printf("%d, \n", n);
break ;
end if;
end do:
end if:
end do: # R. J. Mathar, Jun 06 2013
PROG
(C)
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define TOP (1ULL<<32)
typedef unsigned long long U64;
int compare64(const void *p1, const void *p2) {
if (*(U64*)p1== *(U64*)p2) return 0;
return (*(U64*)p1 < *(U64*)p2) ? -1 : 1;
}
int main() {
U64 i, j, p, t, r, n=0, *pp = (U64*)malloc(TOP/2);
unsigned char *c = (unsigned char *)malloc(TOP/8);
memset(c, 0, TOP/8);
for (pp[n++] = i = 1; i < TOP; i+=2)
if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
for (p=i+(i==1), j = p*p; ; j*=p) {
pp[n++] = j;
double k = ((double)j) * ((double)p);
if (k >= ((double)(1ULL<<62)*4.0)) break;
}
if(i>1) for (j=i*i>>1; j<TOP; j+=i) c[j>>3]|= 1<<(j&7);
}
qsort(pp, n, 8, compare64);
for (i = 0; i < n; i++)
for (p=pp[i], j=0; j < i; j++) {
t = p - pp[j];
r = sqrt(t);
if (r*r==t) { printf("%llu, ", p); break; }
}
return 0;
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, May 31 2013
STATUS
approved