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.

A077233 a(n) is smallest natural number satisfying Pell equation b^2- d(n)*a^2= +1 or = -1, with d(n)=A000037(n) (nonsquare). Corresponding smallest b(n)=A077232(n).

Original entry on oeis.org

1, 1, 1, 2, 3, 1, 1, 3, 2, 5, 4, 1, 1, 4, 39, 2, 12, 42, 5, 1, 1, 5, 24, 13, 2, 273, 3, 4, 6, 1, 1, 6, 4, 3, 5, 2, 531, 30, 24, 3588, 7, 1, 1, 7, 90, 25, 66, 12, 2, 20, 13, 69, 4, 3805, 8, 1, 1, 8, 5967, 4, 936, 30, 413, 2, 125, 5, 3, 6630, 40, 6, 9, 1, 1, 9, 6, 41, 1122, 3, 21, 53, 2, 165, 120, 1260, 221064, 4, 5, 569, 10, 1, 1, 10, 22419
Offset: 1

Views

Author

Wolfdieter Lang, Nov 08 2002

Keywords

Comments

If d(n)=A000037(n) is from A003654 (that is if the regular continued fraction for sqrt(d(n)) has odd (primitive) period length) then the -1 option applies. For such d(n) the minimal b(n) and a(n) numbers for the +1 option are 2*b(n)^2 + 1 and 2*b(n)*a(n), respectively (see Perron I, pp. 94,p5).
For general integer solutions see A077232 comments.
If the trivial solution x=1, y=0 is included, the sequence becomes A006703. - T. D. Noe, May 17 2007

Examples

			d=10=A000037(7)=A003654(3), therefore a(7)=1 and b(7)=A077232(7)=3 give 3^2=10*1^2 -1 and 2*b(7)^2+1=19 and 2*b(7)*a(7)=2*3*1=6 satisfy 19^2 - 10*6^2 = +1.
d=11=A000037(8) is not in A003654, therefore there is no (nontrivial) solution of the b^2 - d*a^2 = -1 Pell equation and a(8)=3 and b(8)=A077232(8)=10 satisfy 10^2 - 11*3^2 = +1. See A077232 for further examples.
		

References

  • T. Nagell, "Introduction to Number Theory", Chelsea Pub., New York, 1964, table p. 301.
  • O. Perron, "Die Lehre von den Kettenbruechen, Bd.I", Teubner, 1954, 1957 (Sec. 26, p. 91 with explanation on pp. 94,95).

Crossrefs

Programs

  • Mathematica
    nmax = 500;
    nconv = 200; (* The number of convergents 'nconv' should be increased if the linear recurrence is not found for some terms. *)
    nonSquare[n_] := n + Round[Sqrt[n]];
    b[n_] := b[n] = Module[{lr}, lr = FindLinearRecurrence[ Numerator[ Convergents[ Sqrt[nonSquare[n]], nconv]]]; (1/2) SelectFirst[lr, #>1&]];
    a[n_] := If[n == 1, 1, SelectFirst[{Sqrt[(b[n]^2 - 1)/nonSquare[n]], Sqrt[(b[n]^2 + 1)/nonSquare[n]]}, IntegerQ]];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, nmax}] (* Jean-François Alcover, Mar 10 2021 *)

Formula

a(n)=sqrt((A077232(n)^2 - (-1)^(c(n)))/A000037(n)) with c(n)=1 if A000037(n)=A003654(k) for some k>=1 else c(n)=0.

A033313 Smallest positive integer x satisfying the Pell equation x^2 - D*y^2 = 1 for nonsquare D and positive y.

Original entry on oeis.org

3, 2, 9, 5, 8, 3, 19, 10, 7, 649, 15, 4, 33, 17, 170, 9, 55, 197, 24, 5, 51, 26, 127, 9801, 11, 1520, 17, 23, 35, 6, 73, 37, 25, 19, 2049, 13, 3482, 199, 161, 24335, 48, 7, 99, 50, 649, 66249, 485, 89, 15, 151, 19603, 530, 31, 1766319049, 63, 8, 129, 65, 48842, 33
Offset: 1

Views

Author

Keywords

Crossrefs

See A033317 (for y's).

Programs

  • Maple
    F:= proc(d) local r,Q; uses numtheory;
      Q:= cfrac(sqrt(d),'periodic','quotients'):
      r:= nops(Q[2]);
      if r::odd then
        numer(cfrac([op(Q[1]),op(Q[2]),op(Q[2][1..-2])]))
      else
        numer(cfrac([op(Q[1]),op(Q[2][1..-2])]));
      fi
    end proc:
    map(F, remove(issqr,[$1..100])); # Robert Israel, May 17 2015
  • Mathematica
    PellSolve[(m_Integer)?Positive] := Module[{cf, n, s}, cf = ContinuedFraction[Sqrt[m]]; n = Length[Last[cf]]; If[n == 0, Return[{}]]; If[OddQ[n], n = 2n]; s = FromContinuedFraction[ContinuedFraction[Sqrt[m], n]]; {Numerator[s], Denominator[s]}];
    A033313 = DeleteCases[PellSolve /@ Range[100], {}][[All, 1]] (* Jean-François Alcover, Nov 21 2020, after N. J. A. Sloane in A002350 *)
    Table[If[! IntegerQ[Sqrt[k]], {k,FindInstance[x^2 - k*y^2 == 1 && x > 0 && y > 0, {x, y},Integers]}, Nothing], {k, 2, 80}][[All, 2, 1, 1, 2]] (* Horst H. Manninger, Mar 28 2021 *)

Formula

a(n) = sqrt(1 + A000037(n)*A033317(n)^2), or
a(n) = sqrt(1 + (n + floor(1/2 + sqrt(n)))*A033317(n)^2). - Zak Seidov, Oct 24 2013

Extensions

Offset switched to 1 by R. J. Mathar, Sep 21 2009
Name corrected by Wolfdieter Lang, Sep 03 2015

A033317 Smallest positive integer y satisfying the Pell equation x^2 - D*y^2 = 1 for nonsquare D.

Original entry on oeis.org

2, 1, 4, 2, 3, 1, 6, 3, 2, 180, 4, 1, 8, 4, 39, 2, 12, 42, 5, 1, 10, 5, 24, 1820, 2, 273, 3, 4, 6, 1, 12, 6, 4, 3, 320, 2, 531, 30, 24, 3588, 7, 1, 14, 7, 90, 9100, 66, 12, 2, 20, 2574, 69, 4, 226153980, 8, 1, 16, 8, 5967, 4, 936, 30, 413, 2, 267000, 430, 3, 6630, 40, 6, 9
Offset: 1

Views

Author

Keywords

Comments

D = D(n) = A000037(n). - Wolfdieter Lang, Oct 04 2015

Crossrefs

Cf. A000037, A033313 (for the x's), A077232, A077233.

Programs

  • Maple
    F:= proc(d) local r,Q; uses numtheory;
      Q:= cfrac(sqrt(d),'periodic','quotients'):
      r:= nops(Q[2]);
      if r::odd then
        denom(cfrac([op(Q[1]),op(Q[2]),op(Q[2][1..-2])]))
      else
        denom(cfrac([op(Q[1]),op(Q[2][1..-2])]));
      fi
    end proc:
    map(F, remove(issqr,[$1..100])); # Robert Israel, May 17 2015
  • Mathematica
    PellSolve[(m_Integer)?Positive] := Module[{cf, n, s}, cf = ContinuedFraction[Sqrt[m]]; n = Length[Last[cf]]; If[n == 0, Return[{}]]; If[OddQ[n], n = 2n]; s = FromContinuedFraction[ContinuedFraction[Sqrt[m], n]]; {Numerator[s], Denominator[s]}];
    A033317 = DeleteCases[PellSolve /@ Range[100], {}][[All, 2]] (* Jean-François Alcover, Nov 21 2020, after N. J. A. Sloane in A002349 *)

Formula

a(n) = sqrt((A033313(n)^2 - 1)/A000037(n)). - Jinyuan Wang, Jul 09 2020

A006702 Solution to a Pellian equation: least x such that x^2 - n*y^2 = +- 1.

Original entry on oeis.org

1, 1, 2, 1, 2, 5, 8, 3, 1, 3, 10, 7, 18, 15, 4, 1, 4, 17, 170, 9, 55, 197, 24, 5, 1, 5, 26, 127, 70, 11, 1520, 17, 23, 35, 6, 1, 6, 37, 25, 19, 32, 13, 3482, 199, 161, 24335, 48, 7, 1, 7, 50, 649, 182, 485, 89, 15, 151, 99, 530, 31, 29718, 63, 8, 1, 8, 65, 48842
Offset: 1

Views

Author

Keywords

Comments

When n is a square, the trivial solution x=1, y=0 is taken; otherwise we take the least x that satisfies either the +1 or -1 equation. - T. D. Noe, May 19 2007
Apparently the generating function of the sequence of the denominators of continued fraction convergents to sqrt(n) is always rational and of form p(x)/[1 - C*x^m + (-1)^m * x^(2m)], or equivalently, the denominators satisfy the linear recurrence b(n+2m) = C*b(n+m) - (-1)^m * b(n). If so, then it seems that a(n) is half the value of C for each nonsquare n, or 1. See A003285 for the conjecture regarding m. The same conjectures apply to the sequences of the numerators of continued fraction convergents to sqrt(n). - Ralf Stephan, Dec 12 2013
The conjecture is true, cf. link. - Jan Ritsema van Eck, Mar 08 2021

References

  • A. Cayley, Report of a committee appointed for the purpose of carrying on the tables connected with the Pellian equation ..., Collected Mathematical Papers. Vols. 1-13, Cambridge Univ. Press, London, 1889-1897, Vol. 13, pp. 430-443.
  • C. F. Degen, Canon Pellianus. Hafniae, Copenhagen, 1817.
  • 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 and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    r[x_, n_] := Reduce[y > 0 && (x^2 - n*y^2 == -1 || x^2 - n*y^2 == 1 ), y, Integers];
    a[n_ /; IntegerQ[ Sqrt[n]]] = 1;
    a[n_] := a[n] = (k = 1; While[ r[k, n] === False, k++]; k);
    Table[ Print[ a[n] ]; a[n], {n, 1, 67}] (* Jean-François Alcover, Jan 30 2012 *)
    nmax = 500;
    nconv = 200; (* The number of convergents 'nconv' should be increased if the linear recurrence is not found for some terms. *)
    a[n_] := a[n] = Module[{lr}, If[IntegerQ[Sqrt[n]], 1, lr = FindLinearRecurrence[Numerator[Convergents[Sqrt[n], nconv]]]; SelectFirst[lr, #>1&]/2]];
    Table[Print[n, " ", a[n] ]; a[n], {n, 1, nmax}] (* Jean-François Alcover, Feb 22 2021 *)

Extensions

Corrected and extended by T. D. Noe, May 19 2007

A078988 Chebyshev sequence with Diophantine property.

Original entry on oeis.org

1, 65, 4289, 283009, 18674305, 1232221121, 81307919681, 5365090477825, 354014663616769, 23359602708228929, 1541379764079492545, 101707704826538279041, 6711167138787446924161, 442835323455144958715585, 29220420180900779828304449, 1928104896615996323709378049
Offset: 0

Views

Author

Wolfdieter Lang, Jan 10 2003

Keywords

Comments

Bisection (even part) of A041025.
(4*A078989(n))^2 - 17*a(n)^2 = -1 (Pell -1 equation, see A077232-3).
Starting with a(1), hypotenuses of primitive Pythagorean triples in A195619 and A195620. - Clark Kimberling, Sep 22 2011

Examples

			(x,y) = (4,1), (268,65), (17684,4289), ... give the positive integer solutions to x^2 - 17*y^2 =-1.
		

Crossrefs

Row 66 of array A094954.
Cf. A097316 for S(n, 66).
Row 4 of array A188647.

Programs

  • GAP
    a:=[1,65];; for n in [3..20] do a[n]:=66*a[n-1]-a[n-2]; od; a; # G. C. Greubel, Aug 01 2019
  • Magma
    I:=[1, 65]; [n le 2 select I[n] else 66*Self(n-1) - Self(n-2): n in [1..20]]; // G. C. Greubel, Aug 01 2019
    
  • Mathematica
    CoefficientList[Series[(1-x)/(1-66x+x^2), {x,0,20}], x] (* Michael De Vlieger, Apr 15 2019 *)
    LinearRecurrence[{66,-1}, {1,65}, 21] (* G. C. Greubel, Aug 01 2019 *)
  • PARI
    Vec((1-x)/(1-66*x+x^2) + O(x^20)) \\ Colin Barker, Jun 15 2015
    
  • Sage
    ((1-x)/(1-66*x+x^2)).series(x, 20).coefficients(x, sparse=False) # G. C. Greubel, Aug 01 2019
    

Formula

G.f.: (1-x)/(1-66*x+x^2).
a(n) = T(2*n+1, sqrt(17))/sqrt(17) = ((-1)^n)*S(2*n, 8*i) = S(n, 66) - S(n-1, 66) with i^2=-1 and T(n, x), resp. S(n, x), Chebyshev's polynomials of the first, resp. second, kind. See A053120 and A049310.
a(n) = A041025(2*n).
a(n) = 66*a(n-1) - a(n-2) for n>1 ; a(0)=1, a(1)=65. - Philippe Deléham, Nov 18 2008

A078989 Chebyshev sequence with Diophantine property.

Original entry on oeis.org

1, 67, 4421, 291719, 19249033, 1270144459, 83810285261, 5530208682767, 364909962777361, 24078527334623059, 1588817894122344533, 104837902484740116119, 6917712746098725319321, 456464203340031130959067, 30119719707695955917979101, 1987445036504593059455661599
Offset: 0

Views

Author

Wolfdieter Lang, Jan 10 2003

Keywords

Comments

One fourth of bisection (even part) of A041024.
(4*a(n))^2 - 17*A078988(n)^2= -1 (Pell -1 equation, see A077232-3).

Examples

			(x,y) = (4,1), (268,65), (17684,4289), ... give the positive integer solutions to x^2 - 17*y^2 =-1.
		

Crossrefs

Cf. A097316 for S(n, 66).
Cf. A041024.
Cf. similar sequences of the type (1/k)*sinh((2*n+1)*arcsinh(k)) listed in A097775.

Programs

  • GAP
    a:=[1,67];; for n in [3..20] do a[n]:=66*a[n-1]-a[n-2]; od; a; # Muniru A Asiru, Apr 05 2018
  • Mathematica
    LinearRecurrence[{66, -1}, {1, 67}, 20] (* Bruno Berselli, Apr 03 2018 *)
  • PARI
    x='x+O('x^99); Vec((1+x)/(1-66*x+x^2)) \\ Altug Alkan, Apr 05 2018
    

Formula

G.f.: (1 + x)/(1 - 66*x + x^2).
a(n) = 66*a(n-1) - a(n-2) for n>=1, a(-1)=-1, a(0)=1.
a(n) = S(2*n, 2*sqrt(17)) = -i*((-1)^n)*T(2*n+1, 4*i)/4 = S(n, 66) + S(n-1, 66) with i^2=-1 and S(n, x), resp. T(n, x), Chebyshev's polynomials of the second, resp. first, kind. See A049310 and A053120.
a(n) = A041024(2*n)/4.
a(n) = (1/4)*sinh((2*n + 1)*arcsinh(4)). - Bruno Berselli, Apr 03 2018

A160695 Integers m such that 3*m+1 and 7*m+1 are both perfect squares.

Original entry on oeis.org

0, 5, 120, 2760, 63365, 1454640, 33393360, 766592645, 17598237480, 403992869400, 9274237758725, 212903475581280, 4887505700610720, 112199727638465285, 2575706229984090840, 59129043561995624040, 1357392295695915262085, 31160893757444055403920
Offset: 1

Views

Author

Paul Weisenhorn, May 24 2009

Keywords

Comments

The ansatz 3*a(n)+1=A^2, 7*a(n)+1=B^2 is equivalent to the Pell equation x^2-21*y^2=1 (see A077232 for d=21), with x=(21*a(n)+5)/2 and y=A*B/2.
The associated A are in A004253, the B in A030221.
Bisection of A089927. - R. J. Mathar, Jul 10 2009

Crossrefs

Programs

  • Maple
    j:=0: for n from 0 to 1000000 do a:=sqrt(3*n+1): b:=sqrt(7*n+1):
    if (trunc(a)=a) and (trunc(b)=b) then j:=j+1: print(j,n,a,b): end if:
    end do:
  • Mathematica
    LinearRecurrence[{24,-24,1},{0,5,120},30] (* Harvey P. Dale, Dec 17 2013 *)

Formula

a(n) = 24*a(n-1) - 24*a(n-2) + a(n-3).
a(n) = (A004253(n)^2 - 1)/3 = (A030221(n)^2 - 1)/7.
a(n) = ((5+w)/2*((23+5*w)/2)^(n-1) + (5-w)/2*((23-5*w)/2)^(n-1) - 5)/21; where w=sqrt(21). [Corrected by Kevin Ryde, Sep 11 2020]
G.f.: 5*x^2/((1-x)*(x^2-23*x+1)). - R. J. Mathar, Jul 10 2009
From Francesca Arici, Sep 12 2020: (Start)
a(n) = 23*a(n-1) - a(n-2) + 5.
a(n) = A004254(n)* A004254(n+1). (End)
a(n) = 5*A334673(n-1). - Hugo Pfoertner, Apr 07 2021

Extensions

Edited and extended by R. J. Mathar, Jul 10 2009
Name edited by Michel Marcus, Sep 12 2020
Showing 1-7 of 7 results.