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-4 of 4 results.

A088192 Distance between prime(n) and the largest quadratic residue modulo prime(n).

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 1, 2, 5, 1, 3, 1, 1, 2, 5, 1, 2, 1, 2, 7, 1, 3, 2, 1, 1, 1, 3, 2, 1, 1, 3, 2, 1, 2, 1, 3, 1, 2, 5, 1, 2, 1, 7, 1, 1, 3, 2, 3, 2, 1, 1, 7, 1, 2, 1, 5, 1, 3, 1, 1, 2, 1, 2, 11, 1, 1, 2, 1, 2, 1, 1, 7, 3, 1, 2, 5, 1, 1, 1, 1, 2, 1, 7, 1, 3, 2, 1, 1, 1, 3, 2, 13, 3, 2, 2, 5, 1, 1, 2, 1
Offset: 1

Views

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu), Sep 22 2003

Keywords

Comments

a(n) = smallest m>0 such that -m is a quadratic residue modulo prime(n).
a(n) = smallest m>0 such that prime(n) either splits or ramifies in the imaginary quadratic field Q(sqrt(-m)). Equals -A220862(n) except when n = 1. Cf. A220861, A220863. - N. J. A. Sloane, Dec 26 2012
The values are 1 or a prime number (easily provable!). The maximum occurring prime values increase very slowly: up to 10^5 terms the largest prime is 43. The primes do not appear in order.

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989, Cor. 5.17, p. 105. - From N. J. A. Sloane, Dec 26 2012

Crossrefs

Records are (essentially) given by A147971.

Programs

  • Mathematica
    a[n_] := With[{p = Prime[n]}, If[JacobiSymbol[-1, p] > 0, 1, For[d = 2, True, d = NextPrime[d], If[JacobiSymbol[-d, p] >= 0, Return[d]]]]]; Array[a, 100] (* Jean-François Alcover, Feb 16 2018, after Charles R Greathouse IV *)
  • PARI
    qrp_pm(fr,to)= {/* The distance of largest QR modulo the primes from the primes */ local(m,p,v=[]); for(i=fr,to,m=1; p=prime(i); j=2; while((j<=(p-1)/2)&&(m
    				
  • PARI
    do(p)=if(kronecker(-1,p)>0, 1, forprime(d=2, p, if(kronecker(-d, p) >= 0, return(d))))
    apply(do, primes(100)) \\ Charles R Greathouse IV, Oct 31 2012

Formula

a(n) = A053760(n) unless -1 is a quadratic residue mod prime(n). - Charles R Greathouse IV, Oct 31 2012

Extensions

Edited by Max Alekseyev, Oct 29 2012

A162299 Faulhaber's triangle: triangle T(k,y) read by rows, giving denominator of the coefficient [m^y] of the polynomial Sum_{x=1..m} x^(k-1).

Original entry on oeis.org

1, 2, 2, 6, 2, 3, 1, 4, 2, 4, 30, 1, 3, 2, 5, 1, 12, 1, 12, 2, 6, 42, 1, 6, 1, 2, 2, 7, 1, 12, 1, 24, 1, 12, 2, 8, 30, 1, 9, 1, 15, 1, 3, 2, 9, 1, 20, 1, 2, 1, 10, 1, 4, 2, 10, 66, 1, 2, 1, 1, 1, 1, 1, 6, 2, 11, 1, 12, 1, 8, 1, 6, 1, 8, 1, 12, 2, 12, 2730, 1, 3, 1, 10, 1, 7, 1, 6, 1, 1, 2, 13, 1, 420, 1, 12, 1, 20, 1, 28, 1, 60, 1, 12, 2, 14, 6, 1, 90, 1, 6, 1, 10, 1, 18, 1, 30, 1, 6, 2, 15
Offset: 0

Views

Author

Juri-Stepan Gerasimov, Jun 30 2009 and Jul 02 2009

Keywords

Comments

There are many versions of Faulhaber's triangle: search the OEIS for his name. For example, A220862/A220963 is essentially the same as this triangle, except for an initial column of 0's. - N. J. A. Sloane, Jan 28 2017

Examples

			The first few polynomials:
    m;
   m/2  + m^2/2;
   m/6  + m^2/2 + m^3/3;
    0   + m^2/4 + m^3/2 + m^4/4;
  -m/30 +   0   + m^3/3 + m^4/2 + m^5/5;
  ...
Initial rows of Faulhaber's triangle of fractions H(n, k) (n >= 0, 1 <= k <= n+1):
    1;
   1/2,  1/2;
   1/6,  1/2,  1/3;
    0,   1/4,  1/2,  1/4;
  -1/30,  0,   1/3,  1/2,  1/5;
    0,  -1/12,  0,   5/12, 1/2,  1/6;
   1/42,  0,  -1/6,   0,   1/2,  1/2,  1/7;
    0,   1/12,  0,  -7/24,  0,   7/12, 1/2,  1/8;
  -1/30,  0,   2/9,   0,  -7/15,  0,   2/3,  1/2,  1/9;
  ...
The triangle starts in row k=1 with columns 1<=y<=k as
     1
     2   2
     6   2  3
     1   4  2  4
    30   1  3  2  5
     1  12  1 12  2  6
    42   1  6  1  2  2  7
     1  12  1 24  1 12  2  8
    30   1  9  1 15  1  3  2  9
     1  20  1  2  1 10  1  4  2 10
    66   1  2  1  1  1  1  1  6  2 11
     1  12  1  8  1  6  1  8  1 12  2 12
  2730   1  3  1 10  1  7  1  6  1  1  2 13
     1 420  1 12  1 20  1 28  1 60  1 12  2 14
     6   1 90  1  6  1 10  1 18  1 30  1  6  2 15
  ...
Initial rows of triangle of fractions:
    1;
   1/2, 1/2;
   1/6, 1/2,  1/3;
    0,  1/4,  1/2,  1/4;
  -1/30, 0,   1/3,  1/2,  1/5;
    0, -1/12,  0,   5/12, 1/2,  1/6;
   1/42, 0,  -1/6,   0,   1/2,  1/2,  1/7;
    0,  1/12,  0,  -7/24,  0,   7/12, 1/2,  1/8;
  -1/30, 0,   2/9,   0,  -7/15,  0,   2/3,  1/2,  1/9;
  ...
		

Crossrefs

Cf. A000367, A162298 (numerators).
See also A220962/A220963.

Programs

  • Maple
    A162299 := proc(k,y) local gf,x; gf := sum(x^(k-1),x=1..m) ; coeftayl(gf,m=0,y) ; denom(%) ; end proc: # R. J. Mathar, Jan 24 2011
    # To produce Faulhaber's triangle of fractions H(n,k) (n >= 0, 1 <= k <= n+1):
    H:=proc(n,k) option remember; local i;
    if n<0 or k>n+1 then 0;
    elif n=0 then 1;
    elif k>1 then (n/k)*H(n-1,k-1);
    else 1 - add(H(n,i),i=2..n+1); fi; end;
    for n from 0 to 10 do lprint([seq(H(n,k),k=1..n+1)]); od:
    for n from 0 to 12 do lprint([seq(numer(H(n,k)),k=1..n+1)]); od: # A162298
    for n from 0 to 12 do lprint([seq(denom(H(n,k)),k=1..n+1)]); od: # A162299 # N. J. A. Sloane, Jan 28 2017
  • Mathematica
    H[n_, k_] := H[n, k] = Which[n < 0 || k > n+1, 0, n == 0, 1, k > 1, (n/k)* H[n - 1, k - 1], True, 1 - Sum[H[n, i], {i, 2, n + 1}]];
    Table[H[n, k] // Denominator, {n, 0, 14}, {k, 1, n + 1}] // Flatten (* Jean-François Alcover, Aug 04 2022 *)

Formula

Faulhaber's triangle of fractions H(n,k) (n >= 0, 1 <= k <= n+1) is defined by: H(0,1)=1; for 2<=k<=n+1, H(n,k) = (n/k)*H(n-1,k-1) with H(n,1) = 1 - Sum_{i=2..n+1}H(n,i). - N. J. A. Sloane, Jan 28 2017
Sum_{x=1..m} x^(k-1) = (Bernoulli(k,m+1)-Bernoulli(k))/k.

Extensions

Offset set to 0 by Alois P. Heinz, Feb 19 2021

A220861 Choose smallest m>0 such that the n-th rational prime p ramifies in the imaginary quadratic extension field K = Q(sqrt(-m)); a(n) = discriminant(K).

Original entry on oeis.org

-4, -3, -20, -7, -11, -52, -68, -19, -23, -116, -31, -148, -164, -43, -47, -212, -59, -244, -67, -71, -292, -79, -83, -356, -388, -404, -103, -107, -436, -452, -127, -131, -548, -139, -596, -151, -628, -163, -167, -692, -179, -724, -191, -772, -788, -199
Offset: 1

Views

Author

N. J. A. Sloane, Dec 26 2012

Keywords

Comments

m=1 if p=2, otherwise m=p.

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989, Cor. 5.17, p. 105.

Crossrefs

Formula

Let p = prime(n). Then a(n) = -4 if p = 2, -p if p == 3 mod 4, -4p if p == 1 mod 4.

A220863 Choose smallest m>0 such that the n-th rational prime p splits in the imaginary quadratic extension field K = Q(sqrt(-m)); a(n) = discriminant(K).

Original entry on oeis.org

-7, -8, -4, -3, -8, -4, -4, -8, -20, -4, -3, -4, -4, -8, -20, -4, -8, -4, -8, -7, -4, -3, -8, -4, -4, -4, -3, -8, -4, -4, -3, -8, -4, -8, -4, -3, -4, -8, -20, -4, -8, -4, -7, -4, -4, -3, -8, -3, -8, -4, -4, -7, -4, -8, -4, -20, -4, -3, -4, -4, -8, -4, -8, -11, -4, -4, -8, -4, -8, -4, -4, -7, -3, -4, -8
Offset: 1

Views

Author

N. J. A. Sloane, Dec 26 2012

Keywords

Comments

a(n) = discriminant of extension field defined in A220862.

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989, Cor. 5.17, p. 105.

Crossrefs

Formula

Let i = A220862(n). Then a(n) = i if i == 1 (mod 4), otherwise 4i.
Showing 1-4 of 4 results.