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

A341862 a(n) is the even term in the linear recurrence signature for numerators and denominators of continued fraction convergents to sqrt(n), or 0 if n is a square.

Original entry on oeis.org

0, 0, 2, 4, 0, 4, 10, 16, 6, 0, 6, 20, 14, 36, 30, 8, 0, 8, 34, 340, 18, 110, 394, 48, 10, 0, 10, 52, 254, 140, 22, 3040, 34, 46, 70, 12, 0, 12, 74, 50, 38, 64, 26, 6964, 398, 322, 48670, 96, 14, 0, 14, 100, 1298, 364, 970, 178, 30, 302, 198, 1060, 62, 59436
Offset: 0

Views

Author

Georg Fischer, Feb 22 2021

Keywords

Comments

The Everest et al. link states that "the continued fraction expansion of a quadratic irrational is eventually periodic, which implies that the numerators px and denominators qx of its convergents satisfy linear recurrence relations".
Let k be the period length minus one of the continued fraction of sqrt(n). Then the linear recurrence signatures with constant coefficients have the form (0, 0, ..., 0, a(n), 0, 0, ..., 0, (-1)^(n+1)), with k zeroes before and behind a(n).
a(n) is twice the numerator of the convergent to sqrt(n) with index k (starting with 0).
These properties result from the mirrored structure of the period of such continued fractions.
The sequence has remarkably many terms in common with A180495 and with 2*A033313.

Examples

			The numerators for sqrt(13) begin with 3, 4, 7, 11, 18, 119, ... (A041018) and have the signature (0,0,0,0,36,0,0,0,0,1). The continued fraction has period [1,1,1,1,6], so k=4 and a(13) = 2*A041018(4) = 2*18 = 36. The signature ends with (-1)^4.
The numerators for sqrt(19) begin with 4, 9, 13, 48, 61, 170, 1421, ... (A041028) and have the signature (0,0,0,0,0,340,0,0,0,0,0,-1). The continued fraction has period [2,1,3,1,2,8], so k=5 and a(19) = 2*A041028(5) = 2*170 = 340. The signature ends with (-1)^5.
		

Crossrefs

Formula

a(n) = 2*A006702(n) if n is not square, otherwise 0.

A225835 Smallest prime p such that there is a prime q satisfying (2*n + 1)*p^2 - (2*n-1)*q^2 = 2, or 0 if no such p exists.

Original entry on oeis.org

3, 26839, 11, 239, 379
Offset: 1

Views

Author

Irina Gerasimova, May 16 2013

Keywords

Comments

Smallest prime p such that there is a prime q satisfying n*p^2 - (n-1)*q^2 = 1, or 0 if no such p exists: 5, 89,...
Primes p such that there is a prime q satisfying 5*p^2 - 3*q^2 = 2: 26839, 6391493137, 2540081 3820758542 5442608775 1898667220 6441480372 8945619713, ...
Primes q such that there is a prime p satisfying 5*p^2 - 3*q^2 = 2: 34649, 8251382159, 32792309 6359710073 4829167292 2880944251 7973351812 0308284159, ...
a(8) = 22656451 0158169057 8396614544 8202266647 1482614443 0220423848 3659973753 8209021958 1071702657 4442008471 0041419367 4411846431 - Giovanni Resta, May 16 2013
Conjecture: a(6) = a(7) = 0. Charles R Greathouse IV reports that a(6) must have thousands of digits. - Michael B. Porter, May 19 2013

Examples

			(2*2+1)*26839^2 - (2*2-1)*34649^2 = 3601659605 - 3601659603 = 2 and 26839, 34649 are primes, so a(2) = 26839.
		

Crossrefs

Extensions

a(2) from Giovanni Resta, May 15 2013

A290284 Number of pairs of integers (x,y) satisfying the Diophantine equation x^2 - A000037(n)*y^2 = m such that x/y gives a convergent series towards sqrt(A000037(n)).

Original entry on oeis.org

3, 3, 5, 4, 5, 4, 7, 6, 5, 15, 8, 5, 9, 7, 12, 6, 10, 12, 9, 6, 11, 9, 12, 21, 7, 17, 9, 10, 11, 7, 13, 10, 9, 9, 19, 8, 20, 15, 13, 24, 12, 8, 15, 12, 16, 27, 16, 13, 9, 14, 27, 17, 12
Offset: 1

Views

Author

A.H.M. Smeets, Jul 25 2017

Keywords

Comments

If (x(0),y(0)) and (x(1),y(1)) are solutions of the Diophantine equation x^2 - A000037(n)*y^2 = m, then (x(i),y(i)) with x(i) = A*x(i-1) - x(i-2) and y(i) = A*y(i-1) - y(i-2) are also solutions for i > 1. The sequence represents the number of different integer pair sequences where in all cases A = 2*A033313(A000037(n)). Each contributing sequences has to satisfy the condition that for all x < x(i) and all y < y(i), |x/y - sqrt(A000037(n))| > |x(i)/y(i) - sqrt(A000037(n))|.
a(A000037(n)) is not equal to the number of all sequences of pairs (x(i),y(i)) that are solutions of a Diophantine equation x^2 - D*y^2 = m, with -D <= m < D and D = A000037(n). For example for D = 5 we obtain two other sequences from Fibonacci sequence: (first) x(i) = 2*Fib(6i)-Fib(6i-1) and y(i) = Fib(6i-1) satisfy x^2 - D*y^2 = -4 and (second) x(i) = 2*Fib(6i+3) - Fib(6i+2) and y(i) = Fib(6i+2) satisfy x^2 - D*y^2 = 4; but neither of these satisfy the restriction that, for all x < x(i) and all y < y(i), |x/y - sqrt(D)| > |x(i)/y(i) - sqrt(D)|.
A good approximation for the order of magnitude of a(n) is given by 2*log(2*A033313(n)).
For a lower bound, all values m satisfying either m = -D + k^2 for k^2 < D or m = 1, D = A000037(n), contribute with a sequence to the convergent series of sqrt(D), so a(n) > floor(sqrt(D)) + 1.

Examples

			For A000037(4) = 6, a(4) = 4 we have the following sequences of pairs (x,y):
m = 1: x(0) = 1, x(1) = 5, x(i) = 10*x(i-1) - x(i-2) as in A001079(i) and y(0) = 0, y(1) = 2, y(i) = 10*y(i-1) - y(i-2) as in A001078(i);
m = -6: x(0) = 0, x(1) = 12, x(i) = 10*x(i-1) - x(i-2) as in A004291(i) (for i > 0) and y(0) = 1, y(1) = 5, y(i) = 10*y(i-1) - y(i-2) as in A001079(i);
m = -5: x(0) = 1, x(1) = 17, x(i) = 10*x(i-1) - x(i-2) and y(0) = 1, y(1) = 7, y(i) = 10*y(i-1) - y(i-2);
m = -2: x(0) = 2, x(1) = 22, x(i) = 10*x(i-1) - x(i-2) and y(0) = 1, y(1) = 9, y(i) = 10*y(i-1) - y(i-2) as in A072256(i+1).
In some cases a combination of A000037(n) and m has more than one integer pair sequence, for example A000037(5) = 7 and m = -3 has two integer pair sequences:
x(0) = 2, x(1) = 37, x(i) = 16*x(i-1) - x(i-2) and y(0) = 1, y(1) = 14, y(i) = 16*y(i-1) - y(i-2);
x(0) = -2, x(1) = 5, x(i) = 16*x(i-1) - x(i-2) and y(0) = 1, y(1) = 2, y(i) = 16*y(i-1) - y(i-2).
For A000037(4) = 6, the sequence observed from x^2 - 6y^2 = 3 is not in the convergent series of sqrt(6) due to for example x1/y1 = 2643/1079 = sqrt(6) + 5.259842e-7 while the smaller x,y pair, x2/y2 = 2158/881 from x^2 - 6y^2 = -2 is a fraction closer to sqrt(5), 2158/881 = sqrt(6) - 5.259841e-7.
		

Crossrefs

Programs

  • Python
    from fractions import Fraction
    def FracSqrt(p):
        a = Fraction(p/1)
        b = Fraction(1/1)
        e = Fraction(10**(-200))
        while a-b > e:
            a = (a+b)/2
            b = p/a
        return a
    print("number: ")
    pp = int(input())
    p = FracSqrt(pp)
    n = 0
    while n >= 0:
        n = n+1
        q = p.limit_denominator(n)
        if (n == 1) or (q != q0):
            t = q*n
            m = t*t-pp*n*n
            print(n,q,m)
        q0 = q

A303604 Numbers n such that both n-1 and n are nonsquares and the least positive solutions to the Pell equations x1^2 - n*y1^2 =1 and x0^2-(n-1)*y0^2 = 1 have a record for rho(n)=log(x1)/log(x0).

Original entry on oeis.org

3, 6, 7, 13, 61, 157, 241, 409, 421, 1321, 1621, 3541, 4129, 5209, 5701, 8269, 9241, 9769, 11701, 12601, 13729, 18181, 27061, 32341, 39901, 78121, 78541, 118681, 129361, 153469, 189661, 207481, 314161, 431869, 451669, 455701, 507301, 655561, 842521, 979969
Offset: 1

Views

Author

Amiram Eldar, Apr 26 2018

Keywords

Comments

Jacobson & Williams proved that rho(n) can be arbitrarily large, therefore this sequence is infinite.
Of the first 40 terms only 6 is composite.

Examples

			n = 61 is in the sequence since the least positive solution to x^2-60*y^2 = 1 has x = 31, and the least positive solution to x^2-61*y^2 = 1 has x = 1766319049, so rho(61) = log(1766319049)/log(31) = 6.200... larger than for any smaller n.
		

Crossrefs

Programs

  • Mathematica
    $MaxExtraPrecision= 1000; a[n_]:=If[IntegerQ[Sqrt[n]],0,For[y=1, !IntegerQ[ Sqrt[n*y^2+1]], y++, Null]; y];PellSolve[(m_Integer)?Positive] := Module[ {cf, n, s}, cof = ContinuedFraction[Sqrt[m]]; n = Length[ Last[cof]]; If[ OddQ[n], n = 2*n]; s = FromContinuedFraction[ ContinuedFraction[ Sqrt[m], n]]; {Numerator[s], Denominator[s]}]; f[n_] := If[ !IntegerQ[ Sqrt[n]], PellSolve[n][[1]], 0]; rho[x0_,x1_]:=If[x0==0||x1==0,0,Log[x1]/Log[x0]]; x0=2; n=3; rhom=0; seq={};Do[x1=f[n]; rho1 = rho[x0,x1]; If[rho1 > rhom, AppendTo[seq, n];rhom=rho1];x0=x1;n++,{k,1,1000}]; seq
Previous Showing 21-24 of 24 results.