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.

A119016 Numerators of "Farey fraction" approximations to sqrt(2).

This page as a plain text file.
%I A119016 #58 Feb 05 2024 06:18:01
%S A119016 1,0,1,2,3,4,7,10,17,24,41,58,99,140,239,338,577,816,1393,1970,3363,
%T A119016 4756,8119,11482,19601,27720,47321,66922,114243,161564,275807,390050,
%U A119016 665857,941664,1607521,2273378,3880899,5488420,9369319,13250218,22619537,31988856
%N A119016 Numerators of "Farey fraction" approximations to sqrt(2).
%C A119016 "Add" (meaning here to add the numerators and add the denominators, not to add the fractions) 1/0 to 1/1 to make the fraction bigger: 2/1. Now 2/1 is too big, so add 1/1 to make the fraction smaller: 3/2, 4/3. Now 4/3 is too small, so add 3/2 to make the fraction bigger: 7/5, 10/7, ... Because the continued fraction for sqrt(2) is all 2s, it will always take exactly two terms here to switch from a number that's bigger than sqrt(2) to one that's less. a(n+2) = A082766(n).
%C A119016 a(2n) are the interleaved values of m such that 2*m^2-2 and 2*m^2+2 are squares, respectively; a(2n+1) are the corresponding integer square roots. - _Richard R. Forberg_, Aug 19 2013
%C A119016 Apart from the first two terms, this is the sequence of numerators of the convergents of the continued fraction expansion sqrt(2) = 1/(1 - 1/(2 + 1/(1 - 1/(2 + 1/(1 - ....))))). - _Peter Bala_, Feb 02 2017
%H A119016 G. C. Greubel, <a href="/A119016/b119016.txt">Table of n, a(n) for n = 0..1000</a>
%H A119016 Dave Rusin, <a href="http://www.math.niu.edu/~rusin/known-math/99/farey">Farey fractions on sci.math</a> [Broken link]
%H A119016 Dave Rusin, <a href="/A002965/a002965.txt">Farey fractions on sci.math</a> [Cached copy]
%H A119016 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,1).
%F A119016 From _Joerg Arndt_, Feb 14 2012: (Start)
%F A119016 a(0) = 1, a(1) = 0, a(2n) = a(2n-1) + a(2n-2), a(2n+1) = a(2n) + a(2n-2).
%F A119016 G.f.: (1 - x^2 + 2*x^3)/(1 - 2*x^2 - x^4). (End)
%F A119016 a(n) = 1/4*(1-(-1)^n)*(-2+sqrt(2))*(1+sqrt(2))*((1-sqrt(2))^(1/2*(n-1))-(1+sqrt(2))^(1/2*(n-1)))+1/4*(1+(-1)^n)*((1-sqrt(2))^(n/2)+(1+sqrt(2))^(n/2)). - _Gerry Martens_, Nov 04 2012
%F A119016 a(2n) = A001333(n). a(2n+1) = A052542(n) for n>0. - _R. J. Mathar_, Feb 05 2024
%e A119016 The fractions are 1/0, 0/1, 1/1, 2/1, 3/2, 4/3, 7/5, 10/7, 17/12, ...
%p A119016 f:= gfun:-rectoproc({a(n+4)=2*a(n+2) +a(n),a(0)=1,a(1)=0,a(2)=1,a(3)=2}, a(n), remember):
%p A119016 map(f, [$0..100]); # _Robert Israel_, Jun 10 2015
%t A119016 f[x_, n_] := (m = Floor[x]; f0 = {m, m+1/2, m+1}; r = ({a___, b_, c_, d___} /; b < x < c) :> {b, (Numerator[b] + Numerator[c]) / (Denominator[b] + Denominator[c]), c}; Join[{m, m+1}, NestList[# /. r &, f0, n-3][[All, 2]]]); Join[{1, 0 }, f[Sqrt[2], 38]] // Numerator (* _Jean-François Alcover_, May 18 2011 *)
%t A119016 LinearRecurrence[{0, 2, 0, 1}, {1, 0, 1, 2}, 40] (* and *) t = {1, 2}; Do[AppendTo[t, t[[-2]] + t[[-1]]]; AppendTo[t, t[[-3]] + t[[-1]]], {n, 30}]; t (* _Vladimir Joseph Stephan Orlovsky_, Feb 13 2012 *)
%t A119016 a0 := LinearRecurrence[{2, 1}, {1, 1}, 20]; (*     A001333 *)
%t A119016 a1 := LinearRecurrence[{2, 1}, {0, 2}, 20]; (* 2 * A000129 *)
%t A119016 Flatten[MapIndexed[{a0[[#]],a1[[#]]} &, Range[20]]] (* _Gerry Martens_, Jun 09 2015 *)
%o A119016 (PARI) x='x+O('x^50); Vec((1 - x^2 + 2*x^3)/(1 - 2*x^2 - x^4)) \\ _G. C. Greubel_, Oct 20 2017
%Y A119016 Cf. A097545, A097546 gives the similar sequence for Pi. A119014, A119015 gives the similar sequence for e. A002965 gives the denominators for this sequence. Also very closely related to A001333, A052542 and A000129.
%Y A119016 See A082766 for another version.
%K A119016 easy,frac,nonn
%O A119016 0,4
%A A119016 _Joshua Zucker_, May 08 2006