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.

A320773 Numbers (excluding squares) whose square root has a continued fraction with a period < 3.

This page as a plain text file.
%I A320773 #38 Jan 25 2020 02:32:20
%S A320773 2,3,5,6,8,10,11,12,15,17,18,20,24,26,27,30,35,37,38,39,40,42,48,50,
%T A320773 51,56,63,65,66,68,72,80,82,83,84,87,90,99,101,102,104,105,110,120,
%U A320773 122,123,132,143,145,146,147,148,150,152,156,168,170,171,182,195,197,198,200
%N A320773 Numbers (excluding squares) whose square root has a continued fraction with a period < 3.
%C A320773 The Heron sequence of every number a(n) has the following relationship: numerator(h(k))^2 - a(n)*denominator(h(k))^2 = 1 for k > 1.
%C A320773 The Heron sequence of every number a(n) has the following relationship with the continued fraction f(s) convergent to sqrt(a(n)): h(k) = f(2^k-1).
%C A320773 From _Gerhard Kirchner_, Jan 17 2020: (Start)
%C A320773 Numbers k = m^2 + r with m > 0 and 0 < r <= 2m such that r is a divisor of 2m.
%C A320773 Continued fraction: k = [m; 2m/r, 2m, 2m/r, 2m, ...].
%C A320773 The number of terms that are between m^2 and (m+1)^2  is equal to the number of divisors of 2m, which is A099777(m).
%C A320773 Proof see link. The Maxima code below demonstrates the divisor property. Note that there is no divisor of 2m between m and 2m.
%C A320773 (End)
%H A320773 Gerhard Kirchner, <a href="/A320773/a320773_1.pdf">Divisor property of a(n)</a>
%e A320773 The continued fraction of sqrt(6) = 2 + 1/(2 + 1/(4 + 1/(2 + 1/(4 + 1/(2 + 1/(4 + ...)))))) = [2; 2, 4, 2, 4, 2, 4, ...] has repeating portion (2, 4) with period 2, so 6 is a term.
%p A320773 Digits:=40: nr:=0:
%p A320773 for z from 2 to 200 do
%p A320773   test:=true: c:=sqrt(z):
%p A320773   if (c=floor(c)) the test:=false: end if:
%p A320773   while (test=true) do
%p A320773     b[0]:=floor(c):
%p A320773     r[0]:=c:
%p A320773     for k from 1 to 2 do
%p A320773       r[k]:=evalf(1/(r[k-1]-b[k-1])):
%p A320773       b[k]:=floor(r[k]):
%p A320773     end do:
%p A320773     if (b[1]=2*b[0]) or (b[2]=2*b[0]) then nr:=nr+1: a[nr]:=z: printf("%4d",z): end if:
%p A320773     test:=false:
%p A320773   end do:
%p A320773 end do:
%t A320773 Select[Range[200], !IntegerQ[Sqrt[#]] && Length@ContinuedFraction[Sqrt[#]][[-1]]<3 &] (* _Amiram Eldar_, Nov 01 2018 *)
%o A320773 (Maxima)
%o A320773 block([n: 2, m: 0, r: 0, k: 0, kmax: 10,v: ""],
%o A320773   while k<kmax do
%o A320773     (m: floor(sqrt(n)), r: n-m^2,
%o A320773     if mod(2*m,r)=0 then (k: k+1, print(n)),
%o A320773     if r= m then n: n+m else (if r= 2*m then n: n+2 else n: n+1)));
%o A320773 /* _Gerhard Kirchner_, Jan 17 2020 */
%K A320773 nonn
%O A320773 1,1
%A A320773 _Paul Weisenhorn_, Oct 21 2018
%E A320773 Edited by _Jon E. Schoenfield_, Oct 19 2019