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.

Showing 1-3 of 3 results.

A138330 Beatty discrepancy (defined in A138253) giving the closeness of the pair (A136497,A136498) to the Beatty pair (A001951,A001952).

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Mar 14 2008

Keywords

Comments

Old definition was "Beatty discrepancy of the complementary equation b(n) = a(a(n)) + a(n)".

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.
		

Crossrefs

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) = d(n) - c(c(n)) - c(n), where c(n) = A001951 and d(n) = A001952.
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

A138251 Beatty sequence of the positive root of x^3 - x^2 - 1.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 21, 23, 24, 26, 27, 29, 30, 32, 33, 35, 36, 38, 39, 41, 42, 43, 45, 46, 48, 49, 51, 52, 54, 55, 57, 58, 60, 61, 63, 64, 65, 67, 68, 70, 71, 73, 74, 76, 77, 79, 80, 82, 83, 85, 86, 87, 89, 90, 92, 93, 95, 96, 98, 99, 101, 102
Offset: 1

Views

Author

Clark Kimberling, Mar 09 2008

Keywords

Comments

First differs from A110118 at 73rd term.

Crossrefs

Formula

a(n)=Floor(r*n), where r=1.46557123187676...; see A092526 for more decimal places.

A138252 Beatty sequence of the number t satisfying 1/s + 1/t = 1, where s is the positive root of x^3 - x^2 - 1.

Original entry on oeis.org

3, 6, 9, 12, 15, 18, 22, 25, 28, 31, 34, 37, 40, 44, 47, 50, 53, 56, 59, 62, 66, 69, 72, 75, 78, 81, 84, 88, 91, 94, 97, 100, 103, 107, 110, 113, 116, 119, 122, 125, 129, 132, 135, 138, 141, 144, 147, 151, 154, 157, 160, 163, 166, 169, 173, 176, 179, 182, 185, 188
Offset: 1

Views

Author

Clark Kimberling, Mar 09 2008

Keywords

Comments

Complement of A138251.
First differs from A110117 at 34th term.

Crossrefs

Formula

a(n)=Floor(t*n).

Extensions

Typo in data corrected by D. S. McNeil, Aug 17 2010
Showing 1-3 of 3 results.