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 11-13 of 13 results.

A338785 a(n) is the least number k such that continued fraction for sqrt(prime(k)) has period n.

Original entry on oeis.org

1, 2, 13, 4, 6, 8, 21, 11, 30, 14, 18, 27, 44, 41, 29, 43, 37, 34, 68, 36, 42, 94, 147, 58, 88, 47, 186, 93, 142, 75, 110, 90, 112, 67, 178, 228, 82, 114, 100, 222, 187, 105, 191, 143, 204, 131, 180, 115, 172, 177, 197, 133, 263, 272, 353, 175, 231, 242, 322, 157
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 08 2020

Keywords

Examples

			sqrt(prime(1))  = sqrt(2)  = 1 + 1/(2 + 1/(2 + ...)), period 1.
sqrt(prime(2))  = sqrt(3)  = 1 + 1/(1 + 1/(2 + 1/(1 + 1/(2 + ...)))), period 2.
sqrt(prime(13)) = sqrt(41) = 6 + 1/(2 + 1/(2 + 1/(12 + 1/(2 + 1/(2 + 1/(12 + ...)))))), period 3.
		

Crossrefs

Programs

  • Maple
    N:= 100: # for a(1)..a(N)
    A:= Vector(N): count:= 0: p:= 1:
    for n from 1 while count < N do
      p:= nextprime(p);
      v:= nops(numtheory:-cfrac(sqrt(p),periodic,quotients)[2]);
      if v <= N and A[v] = 0 then count:= count+1; A[v]:= n; fi
    od:
    convert(A,list); # Robert Israel, Nov 11 2020
  • Mathematica
    Table[SelectFirst[Range[500], Length[Last[ContinuedFraction[Sqrt[Prime[#]]]]] == n &], {n, 60}]

Formula

a(n) = A000720(A059800(n)).

A351139 a(n) is the least k such that the continued fraction for sqrt(k) has periodic part [r, 1, 2, ..., n-1, n, n-1, ..., 1, 2r] for some positive integer r.

Original entry on oeis.org

3, 14, 216, 25185, 23287359, 1953082923, 81112983931776, 6667182474680388, 699567746120736710880, 855784807474766398870755, 51592564054278677032777194015, 1474855822717073602911008555048040, 23175672095781915301598668218548941215, 474577479777785868138090462593743556930231
Offset: 1

Views

Author

Giorgos Kalogeropoulos, Feb 02 2022

Keywords

Examples

			a(3) = 216 because the continued fraction of sqrt(216) has periodic part [14; 1, 2, 3, 2, 1, 28] and this is the least number with this property.
		

Crossrefs

Cf. A013646.

Programs

  • Python
    from itertools import count
    from sympy.ntheory.continued_fraction import continued_fraction_reduce
    def A351139(n):
        if n == 2:
            return 14
        for r in count(1):
            if (k := continued_fraction_reduce([r,list(range(1,n+1))+list(range(n-1,0,-1))+[2*r]])**2).is_integer:
                return k # Chai Wah Wu, Feb 09 2022

A350545 a(n) is the least k such that the continued fraction for sqrt(k) has period prime(n).

Original entry on oeis.org

3, 41, 13, 58, 61, 193, 157, 337, 586, 821, 601, 421, 1117, 1153, 1069, 1669, 2137, 2053, 1381, 3733, 3541, 1621, 4657, 2389, 4561, 6577, 3061, 4261, 5209, 6121, 6781, 8317, 7621, 6661, 6301, 7561, 7549, 15817, 9241, 9349, 12853, 8269, 11701, 16729, 14449, 23017, 31573
Offset: 1

Views

Author

Giorgos Kalogeropoulos, Jan 04 2022

Keywords

Comments

Conjecture: All terms in this sequence (except a(4) = 58 and a(9) = 586) are primes.

Examples

			a(5) = 61 because 61 is the least integer k whose period of the continued fraction for sqrt(k) is prime(5)=11, namely {1, 4, 3, 1, 2, 2, 1, 3, 4, 1, 14}.
		

Crossrefs

Cf. A003285. A subsequence of A013646.

Programs

  • Mathematica
    n=30;prm={};fin={};k=2;While[Length@prm
    				

Formula

a(n) = A013646(prime(n)).
Previous Showing 11-13 of 13 results.