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

A194403 (A194402)/2.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 49, 50, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 67, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 85, 86, 89
Offset: 1

Views

Author

Clark Kimberling, Aug 24 2011

Keywords

Comments

See A194368.

Crossrefs

Cf. A194368.

Programs

  • Mathematica
    r = GoldenRatio; c = 1/2;
    x[n_] := Sum[FractionalPart[k*r], {k, 1, n}]
    y[n_] := Sum[FractionalPart[c + k*r], {k, 1, n}]
    t1 = Table[If[y[n] < x[n], 1, 0], {n, 1, 200}];
    Flatten[Position[t1, 1]]       (* A194401 *)
    t2 = Table[If[y[n] == x[n], 1, 0], {n, 1, 200}];
    Flatten[Position[t2, 1]]       (* A194402 *)
    %/2                            (* A194403 *)
    t3 = Table[If[y[n] > x[n], 1, 0], {n, 1, 200}];
    Flatten[Position[t3, 1]]       (* A194404 *)

A194368 Numbers m such that Sum_{k=1..m} (<1/2 + k*r> - ) = 0, where r=sqrt(2) and < > denotes fractional part.

Original entry on oeis.org

2, 4, 12, 14, 16, 24, 26, 28, 70, 72, 74, 82, 84, 86, 94, 96, 98, 140, 142, 144, 152, 154, 156, 164, 166, 168, 408, 410, 412, 420, 422, 424, 432, 434, 436, 478, 480, 482, 490, 492, 494, 502, 504, 506, 548, 550, 552, 560, 562, 564, 572, 574, 576, 816, 818
Offset: 1

Views

Author

Clark Kimberling, Aug 23 2011

Keywords

Comments

Suppose that r and c are real numbers, 0 < c < 1, and
...
s(m) = Sum_{k=1..m} ( - )
...
where < > denotes fractional part. The inequalities s(m) < 0, s(m) = 0, s(m) > 0 yield up to three sequences that partition the set of positive integers, as in the examples cited below. Of particular interest are choices of r and c for which s(m) >= 0 for every m >= 1.
.
Note that s(m) = m*c - Sum_{k=1..m} floor(c + ). This shows that if c is a rational number p/q, then the range of s(m) is a set of rational numbers having denominator q. In this case, it is easy to prove that if s(m)=0, then m is an integer multiple of q, yielding a sequence of quotients denoted by [[m/q>]] in the following list:
.
r..........p/q....s(m)<0....s(m)=0....[[m/q]]...s(m)>0
sqrt(2)....1/2....(empty)...A194368...A194369...A194370
sqrt(3)....1/2....A194371...A194372.............A194373
sqrt(5)....1/2....(empty)...A194374.............A194375
sqrt(6)....1/2....(empty)...A194376.............A194377
sqrt(7)....1/2....A194378...A194379.............A194380
sqrt(8)....1/2....A194381...A194382...A194383...A194384
sqrt(10)...1/2....(empty)...A194385.............A194386
sqrt(11)...1/2....A194387...A194388.............A194389
sqrt(12)...1/2....(empty)...A194390.............A194391
sqrt(13)...1/2....A194392...A194393.............A194394
sqrt(14)...1/2....A194395...A194396.............A194397
sqrt(15)...1/2....A194398...A194399.............A194400
tau........1/2....A194401...A194402...A194403...A194404
e..........1/2....A194405...A194406.............A194407
Pi.........1/2....A194408...A194409.............A194410
sqrt(2)....1/3....A194411...A194412...A194413...A194414
sqrt(3)....1/3....A194415...A194416...A194417...A194418
sqrt(5)....1/3....A194419...A194420.............A194421
sqrt(2)....2/3....A194422...A194423...A194424...A194425
tau...../2...A194461.......................A194462
tau........A194463.......................A194464
sqrt(2)....1/r.......A194465....................A194466
sqrt(3)....1/r.......A194467....................A194468
.
Next, suppose that r and c are chosen so that s(m)=0 for all m. Then the sets X={m : s(m)<0} and Y={m : s(m)>0} represent a pair of "generalized Beatty sequences" in this sense: if c=1/, the sets X and Y represent the Beatty sequences of 1/ and 1<-r>. Examples:
...
r..........c.........X.........Y......
sqrt(2)....r-1.......A003151...A003152
sqrt(3)....r-1.......A003511...A003512
tau........r-1.......A000201...A001950
sqrt(1/2)..r.........A001951...A001952
e..........e-2.......A000062...A098005

References

  • Ivan Niven, Diophantine Approximations, Interscience Publishers, 1963.

Crossrefs

Programs

  • Mathematica
    r = Sqrt[2]; c = 1/2;
    x[n_] := Sum[FractionalPart[k*r], {k, 1, n}]
    y[n_] := Sum[FractionalPart[c + k*r], {k, 1, n}]
    t1 = Table[If[y[n] < x[n], 1, 0], {n, 1, 100}];
    Flatten[Position[t1, 1]] (* empty *)
    t2 = Table[If[y[n] == x[n], 1, 0], {n, 1, 800}];
    Flatten[Position[t2, 1]] (* A194368 *)
    %/2 (* A194369 *)
    t3 = Table[If[y[n] > x[n], 1, 0], {n, 1, 100}];
    Flatten[Position[t3, 1]] (* A194370 *)

A078588 a(n) = 1 if the integer multiple of phi nearest n is greater than n, otherwise 0, where phi = (1+sqrt(5))/2.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Dec 02 2002

Keywords

Comments

From Fred Lunnon, Jun 20 2008: (Start)
Partition the positive integers into two sets A_0 and A_1 defined by A_k == { n | a(n) = k }; so A_0 = A005653 = { 2, 4, 5, 7, 10, 12, 13, 15, 18, 20, ... }, A_1 = A005652 = { 1, 3, 6, 8, 9, 11, 14, 16, 17, 19, 21, ... }.
Then form the sets of sums of pairs of distinct elements from each set and take the complement of their union: this is the Fibonacci numbers { 1, 2, 3, 5, 8, 13, 21, 34, 55, ... } (see the Chow article). (End)
The Chow-Long paper gives a connection with continued fractions, as well as generalizations and other references for this and related sequences.
This is the complement of A089809; also a(n) = 1 iff A024569(n) = 1. - Gary W. Adamson, Nov 11 2003
Since (n*phi) is equidistributed, s(n):=(Sum_{k=1..n}a(k))/n converges to 1/2, but actually s(n) is exactly equal to 1/2 for many values of n. These values are given by A194402. - Michel Dekking, Sep 30 2016
From Clark Kimberling and Jianing Song, Sep 09 2019: (Start)
Suppose that k >= 2, and let a(n) = floor(n*k*r) - k*floor(n*r) = k*{n*r} - {n*k*r}, an integer strictly between 0 and k, where {} denotes fractional part. For h = 0,1,...,k-1, let s(h) be the sequence of positions of h in {a(n)}. The sets s(h) partition the positive integers. Although a(n)/n -> k, the sequence a(n)-k*n appears to be unbounded.
Guide to related sequences, for k = 2:
** r ********* {a(n)} positions of 0's positions of 1's
(1+sqrt(5))/2 A078588 A005653 A005652
Guide to related sequences, for k = 3:
** r ********* {a(n)} pos. of 0's pos. of 1's pos. of 2's
Guide to related sequences, for k = 4:
** r ********* {a(n)} pos. of 0's pos. of 1's pos. of 2's pos. of 3's
(End)

References

  • D. L. Silverman, J. Recr. Math. 9 (4) 208, problem 567 (1976-77).

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = Floor[n/GoldenRatio]}, If[n - k*GoldenRatio > (k + 1)*GoldenRatio - n, 1, 0]]; Table[ f[n], {n, 0, 105}]
    r = (1 + Sqrt[5])/2; z = 300;
    t = Table[Floor[2 n*r] - 2 Floor[n*r], {n, 0, z}]
    (* Clark Kimberling, Aug 26 2019 *)
  • PARI
    a(n)=if(n,n+1+ceil(n*sqrt(5))-2*ceil(n*(1+sqrt(5))/2),0) \\ (changed by Jianing Song, Sep 10 2019 to include a(0) = 0)
    
  • Python
    from math import isqrt
    def A078588(n): return (n+isqrt(5*n**2))&1 # Chai Wah Wu, Aug 17 2022

Formula

a(n) = floor(2*phi*n) - 2*floor(phi*n) where phi denotes the golden ratio (1 + sqrt(5))/2. - Fred Lunnon, Jun 20 2008
a(n) = 2{n*phi} - {2n*phi}, where { } denotes fractional part. - Clark Kimberling, Jan 01 2007
a(n) = n + 1 + ceiling(n*sqrt(5)) - 2*ceiling(n*phi) where phi = (1+sqrt(5))/2. - Benoit Cloitre, Dec 05 2002
a(n) = round(phi*n) - floor(phi*n). - Michel Dekking, Sep 30 2016
a(n) = (n+floor(n*sqrt(5))) mod 2. - Chai Wah Wu, Aug 17 2022

Extensions

Edited by N. J. A. Sloane, Jun 20 2008, at the suggestion of Fred Lunnon
Edited by Jianing Song, Sep 09 2019
Offset corrected by Jianing Song, Sep 10 2019

A194401 Numbers m such that Sum_{k=1..m} (<1/2 + k*r> - ) < 0, where r=(1+sqrt(5))/2 and < > denotes fractional part.

Original entry on oeis.org

1, 3, 9, 11, 17, 19, 21, 22, 23, 24, 25, 27, 29, 30, 31, 32, 33, 35, 37, 43, 45, 51, 53, 55, 56, 57, 58, 59, 61, 63, 64, 65, 66, 67, 69, 71, 77, 79, 85, 87, 111, 113, 119, 121, 145, 147, 153, 155, 161, 163, 165, 166, 167, 168, 169, 171, 173, 174, 175, 176, 177
Offset: 1

Views

Author

Clark Kimberling, Aug 24 2011

Keywords

Comments

See A194368.

Crossrefs

Programs

  • Mathematica
    r = GoldenRatio; c = 1/2;
    x[n_] := Sum[FractionalPart[k*r], {k, 1, n}]
    y[n_] := Sum[FractionalPart[c + k*r], {k, 1, n}]
    t1 = Table[If[y[n] < x[n], 1, 0], {n, 1, 200}];
    Flatten[Position[t1, 1]]       (* A194401 *)
    t2 = Table[If[y[n] == x[n], 1, 0], {n, 1, 200}];
    Flatten[Position[t2, 1]]       (* A194402 *)
    %/2       (* A194403 *)
    t3 = Table[If[y[n] > x[n], 1, 0], {n, 1, 200}];
    Flatten[Position[t3, 1]]       (* A194404 *)

A194404 Numbers m such that Sum_{k=1..m} (<1/2 + k*r> - ) > 0, where r=(1+sqrt(5))/2 and < > denotes fractional part.

Original entry on oeis.org

5, 7, 13, 15, 39, 41, 47, 49, 73, 75, 81, 83, 89, 91, 93, 94, 95, 96, 97, 99, 101, 102, 103, 104, 105, 107, 109, 115, 117, 123, 125, 127, 128, 129, 130, 131, 133, 135, 136, 137, 138, 139, 141, 143, 149, 151, 157, 159, 183, 185, 191, 193, 217, 219, 225
Offset: 1

Views

Author

Clark Kimberling, Aug 24 2011

Keywords

Comments

See A194368.

Crossrefs

Programs

  • Mathematica
    r = GoldenRatio; c = 1/2;
    x[n_] := Sum[FractionalPart[k*r], {k, 1, n}]
    y[n_] := Sum[FractionalPart[c + k*r], {k, 1, n}]
    t1 = Table[If[y[n] < x[n], 1, 0], {n, 1, 200}];
    Flatten[Position[t1, 1]]       (* A194401 *)
    t2 = Table[If[y[n] == x[n], 1, 0], {n, 1, 200}];
    Flatten[Position[t2, 1]]       (* A194402 *)
    %/2       (* A194403 *)
    t3 = Table[If[y[n] > x[n], 1, 0], {n, 1, 200}];
    Flatten[Position[t3, 1]]       (* A194404 *)
Showing 1-5 of 5 results.