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.

A094049 Let p(n) be the n-th prime congruent to 1 mod 4. Then a(n) = the least k for which m^2+1=p(n)*k^2 has a solution.

Original entry on oeis.org

1, 5, 1, 13, 1, 5, 25, 3805, 125, 53, 569, 1, 851525, 73, 149, 9305, 385645, 85, 82596761, 126985, 1, 113, 1517, 4574225, 1, 5, 535979945, 63445, 145, 7170685, 19805, 55335641, 493, 3793, 265, 65, 1027776565, 1
Offset: 1

Views

Author

Matthijs Coster, Apr 29 2004

Keywords

Crossrefs

Programs

  • Mathematica
     f[n_] := Block[{y = 1}, While[ !IntegerQ[ Sqrt[n*y^2 - 1]], y++]; y]; lst = {}; Do[p = Prime@n; If[Mod[p, 4] == 1, AppendTo[lst, f@p]; Print[{n, f@p}]], {n, 66}]; lst

Extensions

Edited by Don Reble, Apr 30 2004

A191860 First member of a pair of numbers occurring in the definition of 1-happy couples.

Original entry on oeis.org

1, 2, 2, 3, 3, 1, 18, 4, 4, 13, 1, 3, 5, 5, 3, 70, 1, 1, 6, 6, 3, 3, 32, 59, 3, 4, 7, 7, 9, 182, 11, 2, 1, 5, 23, 1, 29718, 8, 8, 221, 2, 13, 7, 1, 1068, 1, 39, 5, 9, 9, 3, 378, 7, 500, 11, 5, 45, 151, 1, 5604, 10, 10, 5, 2, 31, 5, 8890182, 1, 7, 3, 776, 15
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 18 2011

Keywords

Crossrefs

Cf. A007968, A007969, A094048 (subsequence).

Programs

Extensions

Wrong comment and wrong formula removed (thanks to Wolfdieter Lang, who pointed this out) by Reinhard Zumkeller, Oct 11 2015

A130226 Smallest integer x satisfying the Pell equation x^2-k*y^2=-1 for the values of k given in A031396.

Original entry on oeis.org

0, 1, 2, 3, 18, 4, 5, 70, 6, 32, 7, 182, 99, 29718, 8, 1068, 43, 9, 378, 500, 5604, 10, 4005, 8890182, 776, 11, 682, 57, 1744, 12, 113582, 4832118, 13, 1118, 1111225770, 68, 1764132, 14, 3141, 251, 15, 1710, 23156, 71011068, 4443, 16, 6072, 82, 1407
Offset: 1

Views

Author

Colin Barker, Aug 05 2007

Keywords

Examples

			a(5)=18 because A031396(5)=13, and the solution to x^2-13y^2=-1 with smallest possible x has x=18.
		

Crossrefs

Cf. A094048.

Programs

  • Maple
    A130226 := proc(m)
        local xm,x ,i,xmo,y2;
        xm := [] ; # x^2-m*y^2=-1 (mod m) requires x in xm[]
        for x from 0 to m-1 do
            if modp(x^2,m) = modp(-1,m) then
                xm := [op(xm),x] ;
            end if;
        end do:
        for i from 0 do
            for xmo in xm do
                x := i*m+xmo ;
                y2 := (x^2+1)/m ;
                if issqr(y2) then
                    return x ;
                end if;
            end do:
        end do:
    end proc:
    L := BFILETOLIST("b031396.txt") ;
    n := 1:
    for m in L do
        printf("%d %d\n",n,A130226(m)) ;
        n := n+1 ;
    end do: # R. J. Mathar, Oct 19 2014
  • Mathematica
    terms = 1000;
    a031396 = Cases[Import["https://oeis.org/A031396/b031396.txt", "Table"], {, }][[;; terms, 2]];
    sol[n_] := Solve[x > 0 && y > 0 && x^2 - n y^2 == -1, {x, y}, Integers];
    a[1] = 0; a[n_] := a[n] = x /. sol[a031396[[n]]] /. C[1] -> 0 // First // Simplify // Quiet;
    Table[Print[n, " ", a031396[[n]], " ", a[n]]; a[n], {n, 1, terms}] (* Jean-François Alcover, Apr 05 2020 *)

A306529 x-value of the smallest solution to x^2 - p*y^2 = 2*(-1)^((p+1)/4), p = A002145(n).

Original entry on oeis.org

1, 3, 3, 13, 5, 39, 59, 7, 23, 221, 59, 9, 9, 477, 31, 2175, 103, 8807, 41571, 8005, 13, 2047, 2999, 127539, 527593, 15, 15, 2489, 1917, 373, 340551, 11759, 9409, 4109, 52778687, 801, 19, 137913, 113759383, 137, 16437, 12311, 21, 21, 15732537, 1275, 1729, 7204587, 305987, 67
Offset: 1

Views

Author

Jianing Song, Mar 25 2019

Keywords

Comments

a(n) exists for all n.
X = a(n)^2 - (-1)^((p+1)/4), Y = a(n)*A306566(n) gives the smallest solution to x^2 - p*y^2 = 1, p = A002145(n). As a result, all the positive solutions to x^2 - p*y^2 = 2*(-1)^((p+1)/4) are given by (x_n, y_n) where x_n + (y_n)*sqrt(p) = (a(n) + A306566(n)*sqrt(p))*(X + Y*sqrt(p))^n.

Examples

			The smallest solution to x^2 - p*y^2 = 2*(-1)^((p+1)/4) for the first primes congruent to 3 modulo 4:
  n |      Equation     | x_min | y_min
  1 | x^2 -  3*y^2 = -2 |     1 |     1
  2 | x^2 -  7*y^2 = +2 |     3 |     1
  3 | x^2 - 11*y^2 = -2 |     3 |     1
  4 | x^2 - 19*y^2 = -2 |    13 |     3
  5 | x^2 - 23*y^2 = +2 |     5 |     1
  6 | x^2 - 31*y^2 = +2 |    39 |     7
  7 | x^2 - 43*y^2 = -2 |    59 |     9
  8 | x^2 - 47*y^2 = +2 |     7 |     1
  9 | x^2 - 59*y^2 = -2 |    23 |     3
		

Crossrefs

Cf. A002145, A306566 (y-values).
Similar sequences: A094048, A094049 (x^2 - A002144(n)*y^2 = -1); A306618, A306619 (2*x^2 - A002145(n)*y^2 = (-1)^((p+1)/4)).

Programs

  • PARI
    b(p) = if(isprime(p)&&p%4==3, x=1; while(!issquare((x^2 - 2*(-1)^((p+1)/4))/p), x++); x)
    forprime(p=3, 500, if(p%4==3, print1(b(p), ", ")))

Formula

If the continued fraction of sqrt(A002145(n)) is [a_0; {a_1, a_2, ..., a_(k-1), a_k, a_(k-1), ..., a_1, 2*a_0}], where {} is the periodic part, let x/y = [a_0; a_1, a_2, ..., a_(k-1)], gcd(x, y) = 1, then a(n) = x and A306566(n) = y.

A306566 y-value of the smallest solution to x^2 - p*y^2 = 2*(-1)^((p+1)/4), p = A002145(n).

Original entry on oeis.org

1, 1, 1, 3, 1, 7, 9, 1, 3, 27, 7, 1, 1, 47, 3, 193, 9, 747, 3383, 627, 1, 153, 217, 9041, 36321, 1, 1, 161, 121, 23, 20687, 699, 537, 233, 2900979, 43, 1, 7199, 5843427, 7, 803, 593, 1, 1, 731153, 59, 79, 326471, 13809, 3, 7, 12507, 541137, 11, 563210019
Offset: 1

Views

Author

Jianing Song, Mar 25 2019

Keywords

Comments

a(n) exists for all n.
X = A306529(n)^2 - (-1)^((p+1)/4), Y = A306529(n)*a(n) gives the smallest solution to x^2 - p*y^2 = 1, p = A002145(n). As a result, all the positive solutions to x^2 - p*y^2 = 2*(-1)^((p+1)/4) are given by (x_n, y_n) where x_n + (y_n)*sqrt(p) = (A306529(n) + a(n)*sqrt(p))*(X + Y*sqrt(p))^n.

Examples

			The smallest solution to x^2 - p*y^2 = 2*(-1)^((p+1)/4) for the first primes congruent to 3 modulo 4:
  n |      Equation     | x_min | y_min
  1 | x^2 -  3*y^2 = -2 |     1 |     1
  2 | x^2 -  7*y^2 = +2 |     3 |     1
  3 | x^2 - 11*y^2 = -2 |     3 |     1
  4 | x^2 - 19*y^2 = -2 |    13 |     3
  5 | x^2 - 23*y^2 = +2 |     5 |     1
  6 | x^2 - 31*y^2 = +2 |    39 |     7
  7 | x^2 - 43*y^2 = -2 |    59 |     9
  8 | x^2 - 47*y^2 = +2 |     7 |     1
  9 | x^2 - 59*y^2 = -2 |    23 |     3
		

Crossrefs

Cf. A002145, A306529 (x-values).
Similar sequences: A094048, A094049 (x^2 - A002144(n)*y^2 = -1); A306618, A306619 (2*x^2 - A002145(n)*y^2 = (-1)^((p+1)/4)).

Programs

  • PARI
    b(p) = if(isprime(p)&&p%4==3, y=1; while(!issquare(p*y^2 + 2*(-1)^((p+1)/4)), y++); y)
    forprime(p=3, 500, if(p%4==3, print1(b(p), ", ")))

Formula

If the continued fraction of sqrt(A002145(n)) is [a_0; {a_1, a_2, ..., a_(k-1), a_k, a_(k-1), ..., a_1, 2*a_0}], where {} is the periodic part, let x/y = [a_0; a_1, a_2, ..., a_(k-1)], gcd(x, y) = 1, then A306529(n) = x and a(n) = y.

A306618 x-value of the smallest solution to 2*x^2 - p*y^2 = (-1)^((p+1)/4), p = A002145(n).

Original entry on oeis.org

1, 2, 7, 3, 78, 4, 51, 732, 277, 191, 6, 44, 20621, 122, 416941, 8, 5123, 25, 1034, 9, 3993882, 210107, 203100, 10, 1325, 5248, 65030839, 20107956, 30953, 4584105462, 1036, 4889, 295081, 58746, 20725, 98465863939, 1494439626, 1612, 10173, 6040149252, 102607, 9460742124
Offset: 1

Views

Author

Jianing Song, Mar 25 2019

Keywords

Comments

a(n) exists for all n.
X = 4*a(n)^2 - (-1)^((p+1)/4), Y = 2*a(n)*A306619(n) gives the smallest solution to x^2 - 2p*y^2 = 1, p = A002145(n).

Examples

			The smallest solution to 2*x^2 - p*y^2 = (-1)^((p+1)/4) for the first primes congruent to 3 modulo 4:
  n |       Equation      | x_min | y_min
  1 | 2*x^2 -  3*y^2 = -1 |     1 |     1
  2 | 2*x^2 -  7*y^2 = +1 |     2 |     1
  3 | 2*x^2 - 11*y^2 = -1 |     7 |     3
  4 | 2*x^2 - 19*y^2 = -1 |     3 |     1
  5 | 2*x^2 - 23*y^2 = +1 |    78 |    23
  6 | 2*x^2 - 31*y^2 = +1 |     4 |     1
  7 | 2*x^2 - 43*y^2 = -1 |    51 |    11
  8 | 2*x^2 - 47*y^2 = +1 |   732 |   151
  9 | 2*x^2 - 59*y^2 = -1 |   277 |    51
		

Crossrefs

Cf. A002145, A306619 (y-values).
Similar sequences: A094048, A094049 (x^2 - A002144(n)*y^2 = -1); A306529, A306566 (x^2 - A002145(n)*y^2 = 2*(-1)^((p+1)/4)).

Programs

  • PARI
    b(p) = if(isprime(p)&&p%4==3, x=1; while(!issquare((2*x^2 - (-1)^((p+1)/4))/p), x++); x)
    forprime(p=3, 250, if(p%4==3, print1(b(p), ", ")))

Formula

If the continued fraction of sqrt(2*A002145(n)) is [a_0; {a_1, a_2, ..., a_(k-1), a_k, a_(k-1), ..., a_1, 2*a_0}], where {} is the periodic part, let x/y = [a_0; a_1, a_2, ..., a_(k-1)], gcd(x, y) = 1, then a(n) = x/2 and A306619(n) = y.

A306619 y-value of the smallest solution to 2*x^2 - p*y^2 = (-1)^((p+1)/4), p = A002145(n).

Original entry on oeis.org

1, 1, 3, 1, 23, 1, 11, 151, 51, 33, 1, 7, 3201, 17, 57003, 1, 633, 3, 119, 1, 437071, 22209, 20783, 1, 129, 497, 6104097, 1839433, 399752993, 89, 411, 23817, 4711, 1611, 7475426163, 111543983, 119, 739, 436478927, 7089, 644468311, 103, 93487270491, 573497, 57, 4182991
Offset: 1

Views

Author

Jianing Song, Mar 25 2019

Keywords

Comments

a(n) exists for all n.
X = 4*A306618(n)^2 - (-1)^((p+1)/4), Y = 2*A306618(n)*a(n) gives the smallest solution to x^2 - 2p*y^2 = 1, p = A002145(n).

Examples

			The smallest solution to 2*x^2 - p*y^2 = (-1)^((p+1)/4) for the first primes congruent to 3 modulo 4:
  n |       Equation      | x_min | y_min
  1 | 2*x^2 -  3*y^2 = -1 |     1 |     1
  2 | 2*x^2 -  7*y^2 = +1 |     2 |     1
  3 | 2*x^2 - 11*y^2 = -1 |     7 |     3
  4 | 2*x^2 - 19*y^2 = -1 |     3 |     1
  5 | 2*x^2 - 23*y^2 = +1 |    78 |    23
  6 | 2*x^2 - 31*y^2 = +1 |     4 |     1
  7 | 2*x^2 - 43*y^2 = -1 |    51 |    11
  8 | 2*x^2 - 47*y^2 = +1 |   732 |   151
  9 | 2*x^2 - 59*y^2 = -1 |   277 |    51
		

Crossrefs

Cf. A002145, A306618 (x-values).
Similar sequences: A094048, A094049 (x^2 - A002144(n)*y^2 = -1); A306529, A306566 (x^2 - A002145(n)*y^2 = 2*(-1)^((p+1)/4)).

Programs

  • PARI
    b(p) = if(isprime(p)&&p%4==3, y=1; while(!issquare((p*y^2 + (-1)^((p+1)/4))/2), y++); y)
    forprime(p=3, 250, if(p%4==3, print1(b(p), ", ")))

Formula

If the continued fraction of sqrt(2*A002145(n)) is [a_0; {a_1, a_2, ..., a_(k-1), a_k, a_(k-1), ..., a_1, 2*a_0}], where {} is the periodic part, let x/y = [a_0; a_1, a_2, ..., a_(k-1)], gcd(x, y) = 1, then A306618(n) = x/2 and a(n) = y.
Showing 1-7 of 7 results.