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.

Showing 1-7 of 7 results.

A090781 Numbers that can be expressed as the difference of the squares of primes in just one distinct way.

Original entry on oeis.org

5, 16, 21, 24, 40, 45, 48, 96, 112, 117, 144, 160, 165, 192, 264, 280, 285, 288, 336, 352, 357, 504, 520, 525, 648, 816, 832, 837, 936, 952, 957, 1152, 1344, 1360, 1365, 1368, 1440, 1656, 1672, 1677, 1752, 1824, 1840, 1845, 1872, 1968, 2184, 2200, 2205, 2328
Offset: 1

Views

Author

Ray Chandler, Feb 14 2004

Keywords

Examples

			5 = 3^2 - 2^2.
		

Crossrefs

Programs

  • Mathematica
    With[{nn=100},Take[Sort[Transpose[Select[Tally[Last[#]-First[#]&/@ Subsets[ Prime[Range[nn]]^2,{2}]],Last[#]==1&]][[1]]],nn]] (* Harvey P. Dale, Apr 05 2014 *)
  • Python
    from sympy import primerange
    from collections import Counter
    def aupto(limit):
      sqps = [p*p for p in primerange(1, limit//2+1)]
      ways = Counter(b-a for i, a in enumerate(sqps) for b in sqps[i+1:])
      return sorted(k for k in ways if k <= limit and ways[k] == 1)
    print(aupto(2328)) # Michael S. Branicky, May 16 2021

A090782 Numbers that can be expressed as the difference of the squares of primes in just three distinct ways.

Original entry on oeis.org

120, 168, 312, 408, 480, 552, 600, 672, 720, 1008, 1200, 1800, 2160, 2472, 2832, 2880, 3312, 3672, 4560, 5040, 5640, 6120, 6480, 6528, 7248, 7320, 7752, 7872, 8160, 8352, 8400, 8712, 8880, 9048, 9768, 9960, 10032, 10200, 10320, 10488, 10608, 10848
Offset: 1

Views

Author

Ray Chandler, Feb 14 2004

Keywords

Examples

			120 = 13^2-7^2 = 17^2-13^2 = 31^2-29^2.
		

Crossrefs

A090788 Numbers that can be expressed as the difference of the squares of primes in just two distinct ways.

Original entry on oeis.org

72, 360, 432, 528, 768, 888, 960, 1032, 1080, 1128, 1272, 1392, 1488, 1512, 1608, 1632, 1728, 1920, 2088, 2112, 2232, 2352, 2400, 2448, 2568, 2688, 2808, 3048, 3168, 3240, 3288, 3480, 3648, 3768, 4008, 4032, 4128, 4248, 4272, 4392, 4488, 4512, 4992
Offset: 1

Views

Author

Ray Chandler, Feb 14 2004

Keywords

Examples

			72 = 11^2 - 7^2 = 19^2 - 17^2.
		

Crossrefs

Programs

  • PARI
    i=4; while(i<=5000, k=0; m=2; while(m*m<=i, if(i%(2*m)==0, a=(i/m-m)/2; b=a+m; if(isprime(a)&&isprime(b), k+=1)); m+=2); if(k==2, print1(i, ", ")); i+=4) \\ Antonio Roldán, Nov 06 2018

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

Original entry on oeis.org

1848, 6888, 14280, 16008, 19152, 36120, 112728, 116832, 129480, 139080, 176520, 190632, 190968, 199752, 216840, 236208, 252120, 274848, 303960, 314160, 340368, 363720, 435792, 458280, 503160, 513240, 686160, 688680, 698880, 712680, 721560
Offset: 1

Views

Author

Ray G. Opao, Feb 08 2004

Keywords

Examples

			1848 = 463^2 - 461^2 = 233^2 - 229^2 = 157^2 - 151^2.
		

Crossrefs

Programs

  • Maple
    N:= 10^6: # to get all terms <= N
    V:= Vector(N/4):
    p:= 3:
    while p < N/2 do
      q:= p;
      p:= nextprime(p);
      r:= (p^2-q^2)/4;
      if r <= N/4 then
        V[r]:= V[r]+1
      fi
    od:
    map(`*`,select(t -> V[t]=3, [$1..N/4]),4); # Robert Israel, Aug 13 2018
  • PARI
    is(n) = my(i=0, v=[]); forprime(p=5, n, v=[precprime(p-1), p]; if(v[2]^2-v[1]^2==n, i++)); i==3 \\ Felix Fröhlich, Aug 13 2018

Extensions

More terms from Ray Chandler, Feb 11 2004

A090785 Numbers that can be expressed as the difference of the squares of consecutive primes in just one way.

Original entry on oeis.org

5, 16, 24, 48, 240, 288, 360, 432, 648, 672, 720, 840, 888, 960, 1080, 1128, 1248, 1320, 1392, 1488, 1560, 1608, 1680, 1728, 1800, 1920, 2040, 2088, 2112, 2232, 2280, 2400, 2520, 2568, 2640, 2808, 2832, 2880, 3120, 3240, 3312, 3360, 3432, 3672, 3912, 4080
Offset: 1

Views

Author

Ray G. Opao, Feb 08 2004

Keywords

Examples

			5 = 3^2 - 2^2.
		

Crossrefs

Programs

  • Python
    from sympy import primerange
    from collections import Counter
    def aupto(limit):
      sqps = [p*p for p in primerange(1, limit//2+1)]
      ways = Counter(sqps[i+1]-sqps[i] for i in range(len(sqps)-1))
      return sorted(k for k in ways if k <= limit and ways[k] == 1)
    print(aupto(4080)) # Michael S. Branicky, May 16 2021

Extensions

More terms from Ray Chandler, Feb 11 2004

A090784 Numbers that can be expressed as the difference of the squares of consecutive primes in just two distinct ways.

Original entry on oeis.org

72, 120, 168, 312, 408, 552, 600, 768, 792, 912, 1032, 2472, 3048, 3192, 3288, 3528, 3720, 4008, 5160, 5208, 5808, 5928, 6072, 6480, 6792, 6840, 7080, 7152, 7248, 7512, 7728, 7800, 8520, 8760, 9072, 11400, 11880, 11928, 12792, 13200, 13320, 13440
Offset: 1

Views

Author

Ray G. Opao, Feb 08 2004

Keywords

Examples

			72 = 19^2-17^2 = 11^2-7^2.
		

Crossrefs

Extensions

More terms from Ray Chandler, Feb 11 2004

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

Original entry on oeis.org

4920, 801528, 1484280, 5351640, 7257720, 7647360, 12168912, 12302472, 15540360, 17348520, 21623160, 25639320, 27285048, 27462840, 27470352, 34714680, 35684040, 38466288, 48449640, 49936152, 51272760, 54037368, 60948888
Offset: 1

Views

Author

Ray G. Opao and Ray Chandler, Feb 11 2004

Keywords

Examples

			4920=211^2-199^2=251^2-241^2=617^2-613^2=1231^2-1229^2
		

Crossrefs

Programs

  • C
    #define NMAX 200000000 #include  #include  #include  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

Extensions

More terms from R. J. Mathar, Oct 05 2006
Showing 1-7 of 7 results.