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
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.
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
(2*2+1)*26839^2 - (2*2-1)*34649^2 = 3601659605 - 3601659603 = 2 and 26839, 34649 are primes, so a(2) = 26839.
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
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.
-
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
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.
-
$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
Comments