OFFSET
1,1
COMMENTS
The square root of two can be expressed as the continued fraction 1+1/(2+1/(2+1/(2+...))), whose first three convergents are a(1)=1+1/2=3/2, a(2)=1+1/(2+1/2)=7/5 and a(3)=1+1/(2+1/(2+1/2))=17/12. At the 8th convergent, 1393/985, the number of digits in the numerator exceeds the number of digits in the denominator for the first time. The next time this occurs is at the 13th convergent, which is 114243/80782.
The first differences of the terms of this sequence form an interesting sequence, as well. It looks deterministic at first sight but can be chaotic too.
The graphical expression of the original sequence is linear, but it doesn't increase with a constant rate. It is constant at bigger scales, but for smaller scales we see oscillations. The formulation therefore looks algorithmic and should be investigated in order to obtain a formulation for the original sequence.
Also the sequence starts like the Fibonacci sequence (A000045). a(1)=8, a(2)=13, a(3)=21, a(5)=34, a(8)=55, a(14)=89, after which there are no Fibonacci numbers until a(29570)=196418.
From Jon E. Schoenfield, Nov 27 2016: (Start)
Since the numerator of each successive convergent is larger than its predecessor by a factor approaching 1+sqrt(2) (and the same is true of each denominator), the first differences of the terms of this sequence can be expected to exhibit a kind of near-periodicity similar to that seen in other sequences involving the integer parts of successive multiples of irrational numbers. In this case, the base-10 logarithms of successive numerators (and of successive denominators) increase by a difference approaching log_10(1+sqrt(2)) = 0.38277568..., which is close to 80/209 = 0.38277511..., and as a result, it's usually the case that if a number k is in this sequence, then so is k+209; e.g., at k=86, the convergent is 1.0010473...*10^33 / 7.0784738...*10^32, while at k=86+209=295, the numerator and denominator are each larger by a factor of just over 10^80: 1.0013199...*10^113 / 7.0804011...*10^112.
Conjecture: an integer k is in the sequence iff s(k)/10^floor(log_10(s(k))) is in the interval [1, sqrt(2)] where s(k) = (1+sqrt(2))^(k+1))/2. (In other words, k is in the sequence if and only if (1+sqrt(2))^(k+1))/2, expressed in the form x*10^m where m is the integer such that 1 <= x < 10, satisfies x < sqrt(2).) (End)
LINKS
Ogetay Kayali, Table of n, a(n) for n = 1..150519
Project Euler, Problem 57: Square root convergents
MATHEMATICA
Position[#, 1] &@ Array[Subtract @@ IntegerLength@ {Numerator@ #, Denominator@ #} &@ FromContinuedFraction@ ContinuedFraction[Sqrt@ 2, #] &, 360] - 1 // Flatten (* Michael De Vlieger, Nov 18 2016 *)
PROG
(C#)
BigInteger a = 1, b = 1, c = 0;
BigInteger x = 2, y = 5, z = 0;
int s = 0;
for (int i = 0; i < 200; i++)
{
c = 2 * b + a;
z = 2 * y + x;
if ((int)BigInteger.Log10(c) > (int)BigInteger.Log10(x))
{
Console.WriteLine((i + 1).ToString() + ". " + c + "/" + x);
s++;
}
a = b;
b = c;
x = y;
y = z;
}
CROSSREFS
KEYWORD
easy,base,nonn
AUTHOR
Ogetay Kayali, Nov 10 2016
STATUS
approved