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-4 of 4 results.

A332789 First differences of the iterated Beatty sequence A007069.

Original entry on oeis.org

1, 3, 2, 2, 2, 1, 3, 1, 3, 2, 1, 3, 1, 3, 2, 2, 2, 1, 3, 2, 2, 2, 1, 3, 1, 3, 2, 2, 2, 1, 3, 2, 2, 2, 1, 3, 1, 3, 2, 1, 3, 1, 3, 2, 2, 2, 1, 3, 1, 3, 2, 1, 3, 1, 3, 2, 2, 2, 1, 3, 2, 2, 2, 1, 3, 1, 3, 2, 1, 3, 1, 3, 2, 2, 2, 1, 3, 1, 3, 2, 1, 3, 1, 3, 2, 2
Offset: 1

Views

Author

Michel Dekking, Feb 24 2020

Keywords

Comments

The sequence A007069 is an iterated Beatty sequence, like the Wythoff compound sequence (A003622(n)) = (A000201(A000201(n))), and the sequence (A140868(n)) = (A003151(A003151(n))). This sequence is the sequence of first differences 1, 3, 2, 2, 2, 1, 3, 1, 3, 2, ... of A007069.
(a(n)) is a morphic sequence, i.e., the letter-to-letter image of the fixed point of a morphism.
Let theta on {a,b,c,d} be the morphism given by
theta : a->adc, b->adc, c->ad, d->bc.
Let the letter-to-letter morphism lambda be given by
lambda : a->1, b->2, c->2, d->3.
Then (a(n)) = lambda(x), where x = adcbcadadc... is the unique fixed point of theta.
See the appendix of my paper "Morphic words, Beatty sequences...".

Crossrefs

Programs

  • Python
    from math import isqrt
    def A332789(n): return isqrt(isqrt(m:=(n+1)**2<<1)**2<<1)-isqrt(isqrt(m-(n<<2)-2)**2<<1) # Chai Wah Wu, Aug 29 2022

Formula

a(n) = A001951(A001951(n+2)+2) - A001951(A001951(n+1)+1).

A059648 a(n) = [[(k^2)*n]-(k*[k*n])], where k = sqrt(2) and [] is the floor function.

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0
Offset: 0

Views

Author

Antti Karttunen, Feb 03 2001

Keywords

Comments

The values of (floor((k^2)*j)-(k*(floor(k*j)))) for j=0..20, with k=sqrt(2), are 0, 0.585786, 1.171572, 0.343144, 0.928930, 0.100502, 0.68629, 1.27207, 0.44365, 1.02943, 0.20100, 0.78679, 1.37258, 0.54415, 1.12993, 0.30151, 0.88729, 0.05886, 0.64465, 1.23044, 0.40201

Crossrefs

Cf. A007069. Positions of ones: A059649.
Cf. A002193 (sqrt(2)).

Programs

  • Magma
    [Floor(Floor(n*Sqrt(2)^2) - Sqrt(2)*Floor(n*Sqrt(2))): n in [0..100]]; // G. C. Greubel, Jan 27 2018
    
  • Maple
    Digits := 89; floor_diffs_floored(sqrt(2),120); floor_diffs_floored := proc(k,upto_n) local j; [seq(floor(floor((k^2)*j)-(k*(floor(k*j)))),j=0..upto_n)]; end;
  • Mathematica
    With[{k = Sqrt[2]}, Table[Floor[Floor[k^2*j] - k*Floor[k*j]], {j, 0, 104}]] (* Jean-François Alcover, Mar 06 2016 *)
  • PARI
    for(n=0, 100, print1(floor(floor(n*sqrt(2)^2) - sqrt(2)*floor(n*sqrt(2))), ", ")) \\ G. C. Greubel, Jan 27 2018
    
  • Python
    from math import isqrt
    def A059648(n): return (m:=n<<1)-1-isqrt(isqrt(n*m)**2<<1) if n else 0 # Chai Wah Wu, Aug 29 2022

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

A083656 a(n) = Sum_{i=1..n} floor(r*floor(r*i)), where r=sqrt(2).

Original entry on oeis.org

1, 3, 8, 15, 24, 35, 47, 62, 78, 97, 118, 140, 165, 191, 220, 251, 284, 319, 355, 394, 435, 478, 523, 569, 618, 668, 721, 776, 833, 892, 952, 1015, 1080, 1147, 1216, 1286, 1359, 1433, 1510, 1589, 1669, 1752, 1836, 1923, 2012, 2103, 2196, 2290, 2387, 2485, 2586
Offset: 1

Views

Author

Benoit Cloitre, Jun 13 2003

Keywords

Comments

Partial sums of A007069.

Programs

  • Magma
    [(&+[Floor(Sqrt(2)*Floor(Sqrt(2)*j)): j in [1..n]]): n in [1..60]]; // G. C. Greubel, Oct 01 2018
  • Mathematica
    Table[Sum[Floor[Sqrt[2]Floor[Sqrt[2]x]],{x,n}],{n,60}] (* Harvey P. Dale, Jul 20 2018 *)
  • PARI
    a(n) = sum(i=1, n, floor(sqrt(2)*floor(sqrt(2)*i))); \\ Michel Marcus, Dec 05 2013
    

Formula

a(n) = n*(n-1+1/sqrt(2)) + O(1).
Showing 1-4 of 4 results.