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 41-50 of 135 results. Next

A267857 Length of the period of the continued fraction for the square root of D, the discriminant of indefinite binary quadratic forms. D is given in A079896.

Original entry on oeis.org

1, 2, 2, 5, 1, 2, 6, 2, 4, 5, 4, 4, 1, 2, 3, 8, 6, 2, 6, 5, 2, 6, 4, 11, 1, 2, 8, 2, 7, 12, 6, 2, 2, 5, 6, 5, 8, 10, 4, 11, 1, 2, 2, 8, 15, 6, 9, 10, 6, 2, 16, 5, 4, 10, 2, 16, 4, 9, 4, 4, 1, 2, 9, 2, 8, 2, 17, 8, 10, 6, 6, 2, 16, 5, 4, 8, 4, 21
Offset: 1

Views

Author

Wolfdieter Lang, Feb 03 2016

Keywords

Comments

This is a subsequence of A003285.
If a(n) is even then the smallest positive integer solution of the Pell equation x^2 - D(n)*y^2 = +1 with D(n) = A079896(n) is given by (x0, y0) = (P,Q) with P/Q = [a,b[1], ..., b[a(n)-1]]. If a(n) is odd then the smallest positive integer solution of the Pell equation x^2 - D(n)*y^2 = +1 is given by (x0, y0) = (P^2 + D(n)*Q^2, 2*P*Q). See e.g., the Silverman reference Theorem 40.4 on p. 351.
For positive integer d, d not a square, the Pell equations X^2 - d*Y^2 = +4 and X^2 - d*Y^2 = -4 have no proper solutions. For D(n) = A079896(n) there are solutions for X^2 - D(n)*Y^2 = +4 or -4 (inclusive or). See the Wolfdieter Lang link under A225953 for Pell +4 or -4 solutions.

Examples

			a(1)  = 1  because sqrt(5)  = [2,repeat(4)].
a(2)  = 2  because sqrt(8)  = [2,repeat(1,4)].
a(24) = 11 because sqrt(61) = [7,repeat(1,4,3,1,2,2,1,3,4,1,14)].
Pell +1 equation: n = 24 with D = 61 has odd a(24)
  P/Q = [7,1,4,3,1,2,2,1,3,4,1] = 29718/3805 (in lowest terms). Therefore (x0, y0) = (1766319049, 226153980), see A174762 (Of course, (1, 0) is the smallest nonnegative solution.)
		

References

  • J. H. Silverman, A Friendly Introduction to Number Theory, 3rd ed., Pearson Education, Inc, 2006, p. 351.

Crossrefs

Programs

Extensions

Offset corrected by Robin Visser, Jun 06 2025

A276689 Least term in the periodic part of the continued fraction expansion of sqrt(n) or 0 if n is square.

Original entry on oeis.org

0, 0, 2, 1, 0, 4, 2, 1, 1, 0, 6, 3, 2, 1, 1, 1, 0, 8, 4, 1, 2, 1, 1, 1, 1, 0, 10, 5, 2, 1, 2, 1, 1, 1, 1, 1, 0, 12, 6, 4, 3, 2, 2, 1, 1, 1, 1, 1, 1, 0, 14, 7, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 0, 16, 8, 1, 4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 18, 9, 6, 1
Offset: 0

Views

Author

Chai Wah Wu, Sep 28 2016

Keywords

Comments

If r > 0 is even, then a((rm/2)^2+m) = r for all m >= 1 and a((r^2-2)^2/4 + (r+1)^3) = r.
If r is odd, then a((rm)^2+2m) = r for all m >= 1 and a(r^4 + r^3 + 5(r+1)^2/4) = r.

Crossrefs

Programs

  • Python
    from sympy import continued_fraction_periodic
    def A276689(n):
        x = continued_fraction_periodic(0,1,n)
        return min(x[1]) if len(x) > 1 else 0

A288184 Least odd number k such that the continued fraction for sqrt(k) has period n.

Original entry on oeis.org

5, 3, 41, 7, 13, 19, 73, 31, 113, 43, 61, 103, 193, 179, 109, 133, 157, 139, 337, 151, 181, 253, 853, 271, 457, 211, 949, 487, 821, 379, 601, 463, 613, 331, 1061, 1177, 421, 619, 541, 589, 1117, 571, 1153, 823, 1249, 739, 1069, 631, 1021, 1051, 1201, 751
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 06 2017

Keywords

Examples

			a(2) = 3, sqrt(3) = 1 + 1/(1 + 1/(2 + 1/(1 + 1/(2 + 1/...)))), period 2: [1, 2].
		

Crossrefs

Programs

  • Python
    from sympy import continued_fraction_periodic
    def A288184(n):
        d = 1
        while True:
            s = continued_fraction_periodic(0,1,d)[-1]
            if isinstance(s, list) and len(s) == n:
                return d
            d += 2 # Chai Wah Wu, Jun 07 2017

Formula

A003285(a(n)) = n, A000035(a(n)) = 1.

A288185 Least even number k such that the continued fraction for sqrt(k) has period n.

Original entry on oeis.org

2, 6, 130, 14, 74, 22, 58, 44, 106, 86, 298, 46, 746, 134, 1066, 94, 1018, 424, 922, 268, 394, 166, 586, 382, 1306, 214, 1354, 334, 1642, 436, 2122, 508, 1114, 454, 4138, 478, 3194, 1108, 4874, 526, 3418, 724, 2458, 604, 9914, 694, 4618, 844, 2746, 1318
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 06 2017

Keywords

Examples

			a(2) = 6, sqrt(6) = 2 + 1/(2 + 1/(4 + 1/(2 + 1/(4 + 1/...)))), period 2: [2, 4].
		

Crossrefs

Programs

  • Python
    from sympy import continued_fraction_periodic
    def A288185(n):
        d = 2
        while True:
            s = continued_fraction_periodic(0,1,d)[-1]
            if isinstance(s, list) and len(s) == n:
                return d
            d += 2 # Chai Wah Wu, Jun 08 2017

Formula

A003285(a(n)) = n, A000035(a(n)) = 0.

A293028 Period of the continued fraction for sqrt(5^(2n+1)).

Original entry on oeis.org

1, 5, 31, 153, 745, 3779, 19011, 95121, 475251, 2375759, 11880177, 59406541, 297033919, 1485165459, 7425797777, 37129022423
Offset: 0

Views

Author

A.H.M. Smeets, Sep 28 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length[Last[ContinuedFraction[Sqrt[5^(2n+1)] ]]],{n,0,11}] (* Metin Sariyar, Sep 25 2019 *)

Formula

a(n) = A003285(A013710(n)). - Michel Marcus, Sep 25 2019

Extensions

a(11)-a(13) from Daniel Suteu, Jan 24 2019
Better name from Daniel Suteu, Jan 24 2019
a(14)-a(15) from Chai Wah Wu, Sep 25 2019

A384923 a(n) is the smallest number of leading significant digits of the square root of the n-th nonsquare that includes all decimal digits.

Original entry on oeis.org

19, 23, 37, 39, 45, 36, 27, 17, 25, 15, 36, 19, 20, 36, 25, 37, 28, 13, 27, 52, 39, 17, 38, 27, 26, 17, 23, 24, 37, 19, 25, 26, 26, 41, 58, 57, 25, 12, 25, 22, 24, 19, 33, 48, 23, 41, 49, 23, 32, 32, 23, 30, 19, 17, 31, 27, 24, 47, 24, 26, 18, 22, 19, 48, 31, 22
Offset: 1

Views

Author

Felix Huber, Jun 26 2025

Keywords

Comments

Squares are excluded by definition because a(n) would only exist for positive integers s that include all decimal digits. The smallest square s^2 for which a(n) would exist is 1023456789^2 = 1047463798950190521.

Examples

			The leading 19 significant digits of sqrt(2) are [1, 4, 1, 4, 2, 1, 3, 5, 6, 2, 3, 7, 3, 0, 9, 5, 0, 4, 8]. These digits include all decimal digits, with the digit '8' appearing for the first time at position 19. Since 2 is the first nonsquare, it follows that a(1) = 19.
		

Crossrefs

Programs

  • Maple
    A384923:=proc(n)
        local m,b,k;
        m:=n+floor(1/2+sqrt(n));
        b:=floor(log10(sqrt(m)));
        k:=9-b;
        while nops(convert(ListTools:-Reverse(convert(floor(10^k*sqrt(m)),'base',10)),set))<10 do
            k:=k+1
        od;
        return k+b+1
    end proc;
    seq(A384923(n),n=1..66);
  • Python
    from itertools import count
    from math import isqrt
    def A384923(n):
        m = n+(k:=isqrt(n))+(n>k*(k+1))
        return 1+next(n for n in count(9) if len(set(str(isqrt(10**(n<<1)*m))))==10) # Chai Wah Wu, Jul 01 2025

Formula

a(n) >= max(10, A384924(n)).
a(A113507(k) - floor(sqrt(A113507(k)))) = 10 for positive integers k.

A384924 a(n) is the position of the first occurrence of the digit 0 among the leading significant decimal digits of the square root of the n-th nonsquare.

Original entry on oeis.org

14, 5, 5, 17, 11, 16, 10, 10, 6, 3, 36, 12, 6, 7, 13, 37, 16, 4, 26, 52, 2, 12, 6, 9, 11, 13, 16, 14, 4, 5, 2, 8, 18, 10, 3, 4, 12, 10, 3, 20, 9, 6, 2, 48, 6, 4, 49, 11, 32, 13, 9, 15, 19, 4, 5, 21, 2, 5, 24, 17, 3, 6, 19, 16, 5, 3, 4, 11, 17, 7, 19, 9, 2, 4, 16
Offset: 1

Views

Author

Felix Huber, Jun 26 2025

Keywords

Examples

			The leading 14 significant digits of sqrt(2) are [1, 4, 1, 4, 2, 1, 3, 5, 6, 2, 3, 7, 3, 0], with the digit '0' appearing for the first time at position 14. Since 2 is the first nonsquare, it follows that a(1) = 14.
		

Crossrefs

Programs

  • Maple
    A384924:=proc(n)
        local m,b,k;
        m:=n+floor(1/2+sqrt(n));
        b:=floor(log10(sqrt(m)));
        k:=1-b;
        while not member(0,ListTools:-Reverse(convert(floor(10^k*sqrt(m)),'base',10))) do
            k:=k+1
        od;
        return k+b+1
    end proc;
    seq(A384924(n),n=1..75);
  • Mathematica
    b[n_] := (n + Floor[Sqrt[n + Floor[Sqrt[n]]]]);a[n_]:=Position[RealDigits[N[Sqrt[b[n]],100]][[1]],0][[1]];Array[a,75]//Flatten (* Increase precision for n>23000 *) (* James C. McMahon, Jul 05 2025 *)
  • Python
    from itertools import count
    from math import isqrt
    def A384924(n):
        m = n+(k:=isqrt(n))+(n>k*(k+1))
        return 1+next(n for n in count(1) if not isqrt(10**(n<<1)*m)%10) # Chai Wah Wu, Jul 01 2025

Formula

2 <= a(n) <= A384923(n).

A020376 Numbers k such that the continued fraction for sqrt(k) has period 37.

Original entry on oeis.org

421, 769, 1409, 1481, 2237, 2609, 2977, 3109, 3194, 3257, 3301, 3517, 4282, 5617, 6154, 6637, 7474, 8573, 8770, 9181, 9685, 9893, 9965, 10042, 10085, 10949, 11674, 12185, 12301, 12473, 12658, 12953, 13061, 13697, 13885, 15025, 15146, 15889, 16042
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A003285.

Programs

  • Mathematica
    cf37Q[n_]:=Module[{s=Sqrt[n]},If[IntegerQ[s],1,Length[ ContinuedFraction[ s][[2]]]]==37]; Select[Range[17000],cf37Q] (* Harvey P. Dale, Jan 03 2019 *)

A020377 Numbers k such that the continued fraction for sqrt(k) has period 38.

Original entry on oeis.org

619, 669, 691, 811, 1057, 1108, 1357, 1461, 1629, 1723, 1809, 1816, 1819, 1857, 2084, 2169, 2182, 2185, 2201, 2246, 2266, 2356, 2391, 2515, 2571, 2578, 2634, 2950, 2959, 2979, 2983, 3139, 3235, 3254, 3382, 3411, 3441, 3460, 3473, 3558, 3574, 3621, 3714
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A003285.

Programs

  • Mathematica
    q[k_] := Module[{c = ContinuedFraction[Sqrt[k]]}, Length[c] == 2 && Length[c[[2]]] == 38]; Select[Range[4000], q] (* Amiram Eldar, Aug 22 2025 *)

A020378 Numbers k such that the continued fraction for sqrt(k) has period 39.

Original entry on oeis.org

541, 661, 3809, 4637, 4874, 6250, 6625, 6922, 7033, 7633, 7642, 7706, 8017, 8693, 9497, 9533, 10337, 10553, 10585, 10874, 11773, 12337, 12370, 12401, 13037, 13282, 13781, 13810, 13898, 14281, 14290, 14741, 15425, 15970, 16153, 16762, 17362, 18365
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A003285.

Programs

  • Mathematica
    q[k_] := Module[{c = ContinuedFraction[Sqrt[k]]}, Length[c] == 2 && Length[c[[2]]] == 39]; Select[Range[19000], q] (* Amiram Eldar, Aug 22 2025 *)
Previous Showing 41-50 of 135 results. Next