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.

Previous Showing 21-30 of 39 results. Next

A144954 a(n) = start of a sequence of at least n consecutive primes, p_1, p_2, ..., p_n (say), all == 1 mod 4, such that A(p_1) > A(p_2) > ... > A(p_n), where A(p) (see A145010) is the area of the Pythagorean triangle with hypotenuse p.

Original entry on oeis.org

5, 37, 157, 1277, 4441, 8669, 14533, 883241, 10006957, 530551397, 931953301, 931953301
Offset: 1

Views

Author

David Broadhurst, Feb 24 2009

Keywords

Comments

Prompted by a question from Shiv K. Gupta to the Number Theory mailing list.

Examples

			Comment from _M. F. Hasler_, Feb 24 2009:
The first sequence of 12 such primes is the one starting at a(12) =
931953301 = [27050, 14151]^2 ; area = 203431499448450450
931953389 = [26050, 15917]^2 ; area = 176325413694076350
931953397 = [25239, 17174]^2 ; area = 148267841956285170
931953409 = [24528, 18175]^2 ; area = 120941067830427600
931953433 = [30332, 3453 ]^2 ; area = 95111855933417940
931953437 = [23846, 19061]^2 ; area = 93319265825216970
931953469 = [30462, 2005 ]^2 ; area = 56429222392003890
931953509 = [30478, 1745 ]^2 ; area = 49241224048436490
931953569 = [30487, 1580 ]^2 ; area = 44651199683914740
931953637 = [22166, 20991]^2 ; area = 23594434443844350
931953709 = [30525 , 422 ]^2 ; area = 12000420304268550
931953733 = [21793, 21378]^2 ; area = 8346882442487610
		

Crossrefs

Cf. A145010, A002144, A002330, A002331. See A144960 for the actual primes.

Programs

  • PARI
    A144954( n, p=5, verbose=0, L=[0])={ for( i=1,n-1, while(( p=nextprime(p+2)) % 4 !=1,); mn=sum2sqr_prime(p); L=if( L[i] > A=mn[1]*mn[2]*abs(mn[1]^2-mn[2]^2), concat( L, A), i=0; [A]) ); for( i=0,n-1, i & while( 1 != (p=precprime(p-2)) % 4,); verbose & print( p" = " sum2sqr_prime(p) "^2 ; area = " L[n-i])); p} \\ M. F. Hasler, Feb 24 2009

Formula

a(n) = min { A002144(k) | A145010(k) > A145010(k+1) > ... > A145010(k+n-1)}. - M. F. Hasler, Feb 26 2009

A178786 Express n as the sum of four squares, x^2+y^2+z^2+w^2, with x>=y>=z>=w>=0, maximizing the value of x. Then a(n) is that x.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 3, 4, 5, 5, 5, 5, 5, 5, 5, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 7, 8, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 9, 10, 10, 10, 10, 10, 10, 10, 9, 10
Offset: 0

Views

Author

Sébastien Dumortier, Jun 24 2011

Keywords

Comments

Lagrange's theorem tells us that each positive integer can be written as a sum of four squares.

Crossrefs

Analogs for 3 squares: A261904 and A261915.

Programs

  • Python
    from math import *
    for nbre in range(0, 500): # or more than 500 !
        maxc4=0
        for c1 in range(0, int(sqrt(nbre/4))+1):
            for c2 in range(c1, int(sqrt(nbre/3))+1):
                for c3 in range(c2, int(sqrt(nbre/2))+1):
                    s3=c3**2+c2**2+c1**2
                    if s3<=nbre:
                        c4=sqrt(nbre-s3)
                        if int(c4)==c4 and c4>=c3:
                            if c4>maxc4:
                                maxc4=int(c4)
        print(maxc4, end=', ')

A002338 x such that p = (x^2 + 27*y^2)/4, where p is the n-th prime of the form 3k+1.

Original entry on oeis.org

1, 5, 7, 4, 11, 8, 1, 5, 7, 17, 19, 13, 2, 20, 23, 19, 14, 25, 7, 23, 11, 13, 28, 22, 17, 29, 26, 32, 16, 35, 1, 5, 37, 35, 13, 29, 34, 31, 19, 2, 28, 10, 23, 25, 32, 43, 29, 1, 31, 11, 26, 49, 47, 17, 43, 40, 49, 37, 8, 53, 44, 50, 16, 41, 29, 49, 31, 56, 5, 7, 35, 13, 59, 47, 19, 52, 61, 41, 61, 10, 43, 14, 53, 59, 64, 65, 62, 55, 22, 65, 35, 67, 7
Offset: 1

Views

Author

Keywords

Comments

A123489 is a signed version. - Michael Somos, Aug 27 2012

References

  • A. J. C. Cunningham, Quadratic Partitions. Hodgson, London, 1904, p. 1.
  • B. Engquist and Wilfried Schmid, Mathematics Unlimited - 2001 and Beyond, Chapter on Error-correcting codes and curves over finite fields, see pp. 1118-1119. [From Neven Juric, Oct 16 2008.]
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 55.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Reap[For[p = 2, p<2000, p = NextPrime[p], For[x = 1, x <= Floor[2Sqrt[p]], x++, px = 4p - x^2; If[Mod[px, 27] == 0, If[IntegerQ[Sqrt[px/27]], Sow[x] ]]]]][[2, 1]] (* Jean-François Alcover, Sep 06 2018, after Ruperto Corso *)
  • PARI
    forprime(p=2,10000,for(x=1,floor(2*sqrt(p)),px=4*p-x^2;if(px%27==0,if(issquare(px/27,&y),print1(x","))))) /* Ruperto Corso, Dec 14 2011 */

Extensions

Corrected and extended by Ruperto Corso, Dec 14 2011

A002339 Positive y such that p = (x^2 + 27y^2)/4 where p is the n-th prime of the form 6k+1.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 3, 3, 1, 1, 3, 4, 2, 1, 3, 4, 1, 5, 3, 5, 5, 2, 4, 5, 3, 4, 2, 6, 1, 7, 7, 1, 3, 7, 5, 4, 5, 7, 8, 6, 8, 7, 7, 6, 3, 7, 9, 7, 9, 8, 1, 3, 9, 5, 6, 3, 7, 10, 1, 6, 4, 10, 7, 9, 5, 9, 2, 11, 11, 9, 11, 1, 7, 11, 6, 1, 9, 3, 12, 9, 12, 7, 5, 2, 1, 4, 7, 12, 3, 11, 1, 13, 13, 7, 13, 13, 11, 9, 11, 5, 13, 9, 3, 14, 13, 6, 14, 5, 13, 7, 10, 2, 13, 1, 15, 3, 15
Offset: 1

Views

Author

Keywords

Comments

Given a prime p = 6k+1, then there exists a unique pair of integers (x, y) such that 4p = x^2 + 27y^2, x == 1 (mod 3), and y>0. - Michael Somos, Jul 10 2022

Examples

			The 7th prime of the form 6k+1 (A002476) is 61 and 4*61 = 244 = 1^2 + 27*3^2 gives a(7) = 3. The 8th prime of the form 6k+1 is 67 and 4*67 = 268 = (-5)^2 + 27*3^2 gives a(8) = 3. - _Michael Somos_, Jul 10 2022
		

References

  • A. J. C. Cunningham, Quadratic Partitions. Hodgson, London, 1904, p. 1.
  • B. Engquist and Wilfried Schmid, Mathematics Unlimited - 2001 and Beyond, Chapter on Error-correcting codes and curves over finite fields, see pp. 1118-1119. [From Neven Juric, Oct 16 2008.]
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 55.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Reap[For[p = 2, p<2000, p = NextPrime[p], For[x = 1, x <= Floor[2*Sqrt[p]], x++, px = 4*p - x^2; If[Mod[px, 27] == 0, If[IntegerQ[y = Sqrt[px/27]], Sow[y]]]]]][[2, 1]] (* Jean-François Alcover, Sep 06 2018, after Ruperto Corso *)
  • PARI
    forprime(p=2,10000,for(x=1,floor(2*sqrt(p)),px=4*p-x^2; if(px%27==0,if(issquare(px/27,&y),print1(y","))))) /* Ruperto Corso, Dec 14 2011 */

Extensions

Corrected and extended by Ruperto Corso, Dec 14 2011
Name clarified by Michael Somos, Jul 10 2022

A002344 Numbers x such that p = x^2 + 7y^2, with prime p = A033207(n).

Original entry on oeis.org

0, 2, 4, 1, 3, 6, 5, 2, 8, 4, 10, 9, 1, 8, 5, 11, 12, 10, 2, 4, 9, 13, 6, 11, 8, 16, 5, 13, 17, 18, 15, 2, 4, 11, 6, 19, 17, 13, 16, 10, 1, 3, 20, 12, 22, 18, 17, 22, 23, 11, 2, 16, 19, 13, 8
Offset: 1

Views

Author

Keywords

References

  • A. J. C. Cunningham, Quadratic Partitions. Hodgson, London, 1904, p. 1.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 55.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A002345.

A002345 Numbers y such that p = x^2 + 7y^2, with prime p = A033207(n).

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 2, 3, 1, 3, 1, 2, 4, 3, 4, 2, 1, 3, 5, 5, 4, 2, 5, 4, 5, 1, 6, 4, 2, 1, 4, 7, 7, 6, 7, 2, 4, 6, 5, 7, 8, 8, 3, 7, 1, 5, 6, 3, 2, 8, 9, 7, 6, 8, 9, 4, 2, 5, 8, 1, 10, 10, 3, 7, 5, 2, 8, 10, 9, 7
Offset: 1

Views

Author

Keywords

References

  • A. J. C. Cunningham, Quadratic Partitions. Hodgson, London, 1904, p. 1.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 55.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A002344.

A145010 a(n) = area of Pythagorean triangle with hypotenuse p, where p = A002144(n) = n-th prime == 1 (mod 4).

Original entry on oeis.org

6, 30, 60, 210, 210, 180, 630, 330, 1320, 1560, 2340, 990, 2730, 840, 4620, 3570, 5610, 4290, 1710, 7980, 2730, 6630, 10920, 12540, 4080, 8970, 14490, 18480, 9690, 3900, 11550, 25200, 26910, 30600, 34650, 32130, 37050, 7980, 23460, 6090, 29580, 49140, 35700
Offset: 1

Views

Author

M. F. Hasler, Feb 24 2009

Keywords

Comments

Pythagorean primes, i.e., primes of the form p = 4k+1 = A002144(n), have exactly one representation as sum of two squares: A002144(n) = x^2+y^2 = A002330(n+1)^2+A002331(n+1)^2. The corresponding (primitive) integer-sided right triangle with sides { 2xy, |x^2-y^2| } = { A002365(n), A002366(n) } has area xy|x^2-y^2| = a(n). For n>1 this is a(n) = 30*A068386(n).

Examples

			The following table shows the relationship between several closely related sequences:
Here p = A002144 = primes == 1 (mod 4), p = a^2+b^2 with a < b;
a = A002331, b = A002330, t_1 = ab/2 = A070151;
p^2 = c^2+d^2 with c < d; c = A002366, d = A002365,
t_2 = 2ab = A145046, t_3 = b^2-a^2 = A070079,
with {c,d} = {t_2, t_3}, t_4 = cd/2 = ab(b^2-a^2).
  ---------------------------------
   p  a  b  t_1  c   d t_2 t_3  t_4
  ---------------------------------
   5  1  2   1   3   4   4   3    6
  13  2  3   3   5  12  12   5   30
  17  1  4   2   8  15   8  15   60
  29  2  5   5  20  21  20  21  210
  37  1  6   3  12  35  12  35  210
  41  4  5  10   9  40  40   9  180
  53  2  7   7  28  45  28  45  630
		

Crossrefs

Programs

  • Mathematica
    Reap[For[p = 2, p < 500, p = NextPrime[p], If[Mod[p, 4] == 1, area = x*y/2 /. ToRules[Reduce[0 < x <= y && p^2 == x^2 + y^2, {x, y}, Integers]]; Sow[area]]]][[2, 1]] (* Jean-François Alcover, Feb 04 2015 *)
  • PARI
    forprime(p=1,499, p%4==1 | next; t=[p,lift(-sqrt(Mod(-1,p)))]; while(t[1]^2>p,t=[t[2],t[1]%t[2]]); print1(t[1]*t[2]*(t[1]^2-t[2]^2)","))
    
  • PARI
    {Q=Qfb(1,0,1);forprime(p=1,499,p%4==1|next;t=qfbsolve(Q,p); print1(t[1]*t[2]*(t[1]^2-t[2]^2)","))} \\ David Broadhurst

Formula

a(n) = A002365(n)*A002366(n)/2.
a(n) = x*y*(x^2-y^2), where x = A002330(n+1), y = A002331(n+1).

A002346 Consider all primes of form p = (x^2 + 11y^2 )/4; sequence gives values of x.

Original entry on oeis.org

1, 3, 0, 9, 5, 7, 12, 6, 15, 13, 3, 9, 17, 4, 21, 3, 23, 16, 21, 25, 15, 20, 1, 5, 27, 18, 30, 12, 19, 27, 35, 9, 37, 25, 39, 15, 2, 30, 24, 10, 29, 21, 39, 31, 3, 43, 40, 45, 15, 47, 48, 36, 42, 1, 7, 45, 41, 27, 51, 13, 24, 17, 19, 51, 53, 23, 38, 54, 3, 49, 29, 45
Offset: 1

Views

Author

Keywords

References

  • A. J. C. Cunningham, Quadratic Partitions. Hodgson, London, 1904, p. 1.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 55.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Extensions

Offset corrected by Mohammed Yaseen, Jul 24 2023

A002347 Consider all primes of form p = (x^2 + 11y^2 )/4; sequence gives values of y.

Original entry on oeis.org

1, 1, 2, 1, 3, 3, 2, 4, 1, 3, 5, 5, 3, 6, 1, 7, 3, 6, 5, 3, 7, 6, 9, 9, 5, 8, 4, 10, 9, 7, 3, 11, 3, 9, 1, 11, 12, 8, 10, 12, 9, 11, 5, 9, 13, 3, 6, 1, 13, 3, 2, 10, 8, 15, 15, 7, 9, 13, 1, 15, 14, 15, 15, 5, 3, 15, 12, 4, 17, 9, 15, 11, 15, 14, 5, 6, 18, 2, 16, 7, 13, 17, 11, 18
Offset: 1

Views

Author

Keywords

References

  • A. J. C. Cunningham, Quadratic Partitions. Hodgson, London, 1904, p. 1.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 55.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Extensions

Offset corrected by Mohammed Yaseen, Jul 24 2023

A217503 Squared distance between consecutive primes of the form 4k+1 (see below).

Original entry on oeis.org

1, 2, 2, 2, 2, 10, 8, 10, 8, 4, 2, 10, 4, 20, 18, 10, 2, 20, 58, 8, 40, 2, 40, 20, 10, 90, 2, 20, 10, 116, 2, 8, 20, 10, 2, 10, 20, 26, 4, 146, 8, 34, 10, 40, 34, 40, 2, 20, 2, 160, 50, 10, 180, 2, 180, 90, 58, 40, 130, 16, 116, 194, 50, 136, 74, 34, 52, 40
Offset: 1

Views

Author

Thomas Ordowski, Oct 05 2012

Keywords

Comments

Every prime p of the form 4k+1 has a unique solution p = x^2 + y^2. This sequence gives the squared distance between points (x,y) for consecutive primes of this form.
The squares mutual distance consecutive points with coordinates x(n) = A002331(n) and y(n) = A002330(n), where x(n)^2 + y(n)^2 = A002313(n) is prime.
Theorem: a(n) =/= A082073(n-1) for all n > 1. Generally, it can be shown that there is no pair of primes p = a^2 + b^2 and q = x^2 + y^2 such that (a - x)^2 + (b - y)^2 = |p - q| > 0.

Examples

			5 = 1^2 + 2^2 and 13 = 2^2 + 3^2. The squared distance between the points (1,2) and (2,3) is 2, the second term of this sequence.
		

Crossrefs

Programs

  • Mathematica
    nn = 200; p = Select[Prime[Range[nn]], Mod[#, 4] == 1 &]; q = {1, 1}; Table[pp = PowersRepresentations[p[[i]], 2, 2][[1]]; d = pp - q; q = pp; d[[1]]^2 + d[[2]]^2, {i, Length[p] - 1}] (* T. D. Noe, Oct 19 2012 *)
Previous Showing 21-30 of 39 results. Next