OFFSET
1,1
EXAMPLE
4920=211^2-199^2=251^2-241^2=617^2-613^2=1231^2-1229^2
PROG
(C) #define NMAX 200000000 #include <stdlib.h> #include <stdio.h> #include <limits.h> int isprime(const int n) { for(int i=2 ; i*i <= n ; i++) if( n % i == 0) return(0) ; return 1 ; } int main(int argc, char *argv[]) { short * n= (short*)calloc(NMAX, sizeof(short)) ; int wm=0; for(int p=2 ; ; ) { int np=p+1 ; while( !isprime(np) ) np++ ; if(np<0) break ; if ( p+np < INT_MAX/(np-p) ) { const int i=(p+np)*(np-p) ; const int nw= p+np ; if( i < NMAX ) n[i]++ ; for(int j=wm ; j < nw ; j++) if ( n[j] == 4) printf("%d ", j) ; wm=nw ; } p=np ; if( p > INT_MAX-np ) break ; } free(n) ; } - R. J. Mathar, Oct 05 2006
CROSSREFS
KEYWORD
nonn
AUTHOR
Ray G. Opao and Ray Chandler, Feb 11 2004
EXTENSIONS
More terms from R. J. Mathar, Oct 05 2006
STATUS
approved