A138330 Beatty discrepancy (defined in A138253) giving the closeness of the pair (A136497,A136498) to the Beatty pair (A001951,A001952).
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, 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, 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
Offset: 1
Keywords
Examples
d(1) - c(c(1)) - c(1) = 3 - 1 - 1 = 1; d(2) - c(c(2)) - c(2) = 6 - 2 - 2 = 2; d(3) - c(c(3)) - c(3) = 10 - 5 - 4 = 1; d(4) - c(c(4)) - c(4) = 13 - 7 - 5 = 1.
Links
- Muniru A Asiru, Table of n, a(n) for n = 1..1000
- Clark Kimberling, Complementary Equations, Journal of Integer Sequences, Vol. 10 (2007), Article 07.1.4.
Programs
-
Magma
[2*n - Floor(Sqrt(2)*Floor(Sqrt(2)*n)): n in [1..100]]; // Vincenzo Librandi, Nov 12 2018
-
Maple
a:=n->2*n-floor(sqrt(2)*floor(sqrt(2)*n)): seq(a(n),n=1..120); # Muniru A Asiru, Nov 11 2018
-
Mathematica
Table[2 n - Floor[Sqrt[2] Floor[Sqrt[2] n]], {n, 1, 100}] (* Vincenzo Librandi, Nov 12 2018 *)
-
PARI
a(n)=2*n-floor(sqrt(2)*floor(sqrt(2)*n)) \\ Benoit Cloitre, May 08 2008
-
Python
from math import isqrt def A138330(n): return (m:=n<<1)-isqrt(isqrt(n*m)**2<<1) # Chai Wah Wu, Aug 29 2022
Formula
a(n) = 2*n - A007069(n). - Benoit Cloitre, May 08 2008
a(n) = A059648(n+1) + 1. - Michel Dekking, Nov 11 2018
Extensions
Definition revised by N. J. A. Sloane, Dec 16 2018
Comments