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 A138330 #34 Jan 08 2025 10:15:12 %S A138330 1,2,1,1,1,1,2,1,2,1,1,2,1,2,1,1,1,1,2,1,1,1,1,2,1,2,1,1,1,1,2,1,1,1, %T A138330 1,2,1,2,1,1,2,1,2,1,1,1,1,2,1,2,1,1,2,1,2,1,1,1,1,2,1,1,1,1,2,1,2,1, %U A138330 1,2,1,2,1,1,1,1,2,1,2,1,1,2,1,2,1,1,1,1,2,1,1,1,1,2,1,2,1,1,1,1,2,1,1,1,1 %N A138330 Beatty discrepancy (defined in A138253) giving the closeness of the pair (A136497,A136498) to the Beatty pair (A001951,A001952). %C A138330 Old definition was "Beatty discrepancy of the complementary equation b(n) = a(a(n)) + a(n)". %H A138330 Muniru A Asiru, <a href="/A138330/b138330.txt">Table of n, a(n) for n = 1..1000</a> %H A138330 Clark Kimberling, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL10/Kimberling/kimberling26.html"> Complementary Equations</a>, Journal of Integer Sequences, Vol. 10 (2007), Article 07.1.4. %F A138330 a(n) = d(n) - c(c(n)) - c(n), where c(n) = A001951 and d(n) = A001952. %F A138330 a(n) = 2*n - A007069(n). - _Benoit Cloitre_, May 08 2008 %F A138330 a(n) = A059648(n+1) + 1. - _Michel Dekking_, Nov 11 2018 %e A138330 d(1) - c(c(1)) - c(1) = 3 - 1 - 1 = 1; %e A138330 d(2) - c(c(2)) - c(2) = 6 - 2 - 2 = 2; %e A138330 d(3) - c(c(3)) - c(3) = 10 - 5 - 4 = 1; %e A138330 d(4) - c(c(4)) - c(4) = 13 - 7 - 5 = 1. %p A138330 a:=n->2*n-floor(sqrt(2)*floor(sqrt(2)*n)): seq(a(n),n=1..120); # _Muniru A Asiru_, Nov 11 2018 %t A138330 Table[2 n - Floor[Sqrt[2] Floor[Sqrt[2] n]], {n, 1, 100}] (* _Vincenzo Librandi_, Nov 12 2018 *) %o A138330 (PARI) a(n)=2*n-floor(sqrt(2)*floor(sqrt(2)*n)) \\ _Benoit Cloitre_, May 08 2008 %o A138330 (Magma) [2*n - Floor(Sqrt(2)*Floor(Sqrt(2)*n)): n in [1..100]]; // _Vincenzo Librandi_, Nov 12 2018 %o A138330 (Python) %o A138330 from math import isqrt %o A138330 def A138330(n): return (m:=n<<1)-isqrt(isqrt(n*m)**2<<1) # _Chai Wah Wu_, Aug 29 2022 %Y A138330 Cf. A001951, A001952, A136497, A136498, A138253, A059648. %K A138330 nonn %O A138330 1,2 %A A138330 _Clark Kimberling_, Mar 14 2008 %E A138330 Definition revised by _N. J. A. Sloane_, Dec 16 2018