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

A136497 Solution of the complementary equation b(n)=a(a(n))+a(n).

Original entry on oeis.org

1, 3, 4, 5, 6, 8, 10, 12, 13, 15, 16, 17, 18, 19, 21, 22, 23, 24, 26, 27, 28, 30, 32, 33, 34, 35, 37, 39, 41, 43, 44, 46, 47, 48, 50, 51, 53, 54, 56, 58, 59, 60, 62, 63, 65, 66, 68, 69, 70, 71, 72, 74, 75, 76, 77, 79, 81, 83, 84, 86, 87, 88, 89, 91, 92, 93, 94, 96, 97, 98, 99
Offset: 1

Views

Author

Clark Kimberling, Jan 01 2008

Keywords

Examples

			b(1) = a(a(1))+a(1) = 1+1 = 2;
b(2) = a(a(2))+a(2) = 4+3 = 7;
b(3) = a(a(3))+a(3) = 5+4 = 9.
		

References

  • Clark Kimberling, "Complementary Equations," Journal of Integer Sequences 10 (2007) Article 07.1.4, 1-14.

Crossrefs

Cf. A136498.

A384662 Solution of the complementary equation b(n)=a(a(n))+a(n)+2 with a(1)=1; this is the sequence b.

Original entry on oeis.org

4, 6, 8, 14, 19, 23, 25, 28, 30, 32, 37, 39, 41, 44, 49, 52, 55, 60, 64, 67, 73, 78, 82, 84, 87, 89, 94, 99, 103, 106, 110, 113, 115, 118, 122, 124, 129, 131, 135, 138, 140, 142, 148, 150, 153, 158, 160, 165, 167, 169, 171, 174, 178, 181, 183, 186, 190, 193
Offset: 1

Views

Author

Clark Kimberling, Jun 09 2025

Keywords

Comments

Sequence a is A384661.

Examples

			b(1) = a(a(1))+a(1)+2 = 1+1+2 = 4;
b(2) = a(a(2))+a(2)+2 = 2+2+2 = 6;
b(3) = a(a(3))+a(3)+2 = 3+3+2 = 8;
b(4) = a(a(4))+a(4)+2 = 5+7+2 = 14.
		

Crossrefs

Formula

{b(n)-b(n-1) : n>=2} = {2, 3, 4, 5, 6}.
Showing 1-3 of 3 results.