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.
%I A074840 #22 May 30 2025 15:35:30 %S A074840 0,1,1,2,2,3,4,4,5,5,6,7,7,8,8,9,9,10,11,11,12,12,13,14,14,15,15,16, %T A074840 16,17,18,18,19,19,20,21,21,22,22,23,24,24,25,25,26,26,27,28,28,29,29, %U A074840 30,31,31,32,32,33,33,34,35,35,36,36,37,38,38,39,39,40,41,41,42,42,43,43 %N A074840 Numerators a(n) of fractions slowly converging to sqrt(2): let a(1) = 0, b(n) = n - a(n); if (a(n) + 1) / b(n) < sqrt(2), then a(n+1) = a(n) + 1, else a(n+1)= a(n). %C A074840 a(n) + b(n) = n and as n -> +infinity, a(n) / b(n) converges to sqrt(2). For all n, a(n) / b(n) < sqrt(2). %H A074840 G. C. Greubel, <a href="/A074840/b074840.txt">Table of n, a(n) for n = 1..5000</a> %H A074840 Heinz H. Bauschke, Minh N. Dao, Scott B. Lindstrom, <a href="https://arxiv.org/abs/1804.08880">The Douglas-Rachford algorithm for a hyperplane and a doubleton</a>, arXiv:1804.08880 [math.OC], 2018. %F A074840 a(1) = 0. b(n) = n - a(n). If (a(n) + 1) / b(n) < sqrt(2), then a(n+1) = a(n) + 1, else a(n+1) = a(n). %F A074840 a(n) = floor(n*(2-sqrt(2))). - _Vladeta Jovovic_, Oct 04 2003 %F A074840 a(n) = 2*n - ceiling(n*sqrt(2)). - _Clark Kimberling_, Sep 09 2011 %F A074840 Partial sums of A144611. - _R. J. Mathar_, May 30 2025 %e A074840 a(6)= 3 so b(6) = 6 - 3 = 3. a(7) = 4 because (a(6) + 1) / b(6) = 4/3 which is < sqrt(2). So b(7) = 7 - 4 = 3. a(8) = 4 because (a(7) + 1) / b(7) = 5/3 which is not < sqrt(2). %t A074840 Table[Floor[n*(2 - Sqrt[2])], {n, 1, 50}] (* _G. C. Greubel_, Nov 28 2017 *) %o A074840 (PARI) for(n=1,30, print1(floor(n*(2-sqrt(2))), ", ")) \\ _G. C. Greubel_, Nov 28 2017 %o A074840 (Magma) [Floor(n*(2-Sqrt(2))): n in [1..30]]; // _G. C. Greubel_, Nov 28 2017 %Y A074840 Cf. A001601, A144611. %K A074840 easy,frac,nonn %O A074840 1,4 %A A074840 Robert A. Stump (bee_ess107(AT)msn.com), Sep 09 2002