cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A091878 a(n) can be expressed as the difference of the squares of consecutive primes in just four distinct ways.

This page as a plain text file.
%I A091878 #7 Mar 31 2012 14:11:24
%S A091878 4920,801528,1484280,5351640,7257720,7647360,12168912,12302472,
%T A091878 15540360,17348520,21623160,25639320,27285048,27462840,27470352,
%U A091878 34714680,35684040,38466288,48449640,49936152,51272760,54037368,60948888
%N A091878 a(n) can be expressed as the difference of the squares of consecutive primes in just four distinct ways.
%e A091878 4920=211^2-199^2=251^2-241^2=617^2-613^2=1231^2-1229^2
%o A091878 (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
%Y A091878 Cf. A078667, A090783, A090784, A090785.
%K A091878 nonn
%O A091878 1,1
%A A091878 _Ray G. Opao_ and _Ray Chandler_, Feb 11 2004
%E A091878 More terms from _R. J. Mathar_, Oct 05 2006