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

A060143 a(n) = floor(n/tau), where tau = (1 + sqrt(5))/2.

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 43, 44, 45, 45
Offset: 0

Views

Author

Clark Kimberling, Mar 05 2001

Keywords

Comments

Fibonacci base shift right: for n >= 0, a(n+1) = Sum_{k in A_n} F_{k-1}, where n = Sum_{k in A_n} F_k (unique) expression of n as a sum of "noncontiguous" Fibonacci numbers (with index >=2). - Michele Dondi (bik.mido(AT)tiscalenet.it), Dec 30 2001 [corrected, and aligned with sequence offset by Peter Munn, Jan 10 2018]
Numerators a(n) of fractions slowly converging to phi, the golden ratio: let a(1) = 0, b(n) = n - a(n); if (a(n) + 1) / b(n) < (1 + sqrt(5))/2, then a(n+1) = a(n) + 1, else a(n+1) = a(n). a(n) + b(n) = n and as n -> +infinity, a(n) / b(n) converges to (1 + sqrt(5))/2. For all n, a(n) / b(n) < (1 + sqrt(5))/2. - Robert A. Stump (bee_ess107(AT)msn.com), Sep 22 2002
a(10^n) gives the first few digits of phi=(sqrt(5)-1)/2.
Comment corrected, two alternative ways, by Peter Munn, Jan 10 2018: (Start)
(a(n) = a(n+1) or a(n) = a(n-1)) if and only if a(n) is in A066096.
a(n+1) = a(n+2) if and only if n is in A003622.
(End)
From Wolfdieter Lang, Jun 28 2011: (Start)
a(n+1) counts for n >= 1 the number of Wythoff A-numbers not exceeding n.
a(n+1) counts also the number of Wythoff B-numbers smaller than A(n+2), with the Wythoff A- and B-sequences A000201 and A001950, respectively.
a(n+1) = Sum_{j=1..n} A005614(j-1) for n >= 1 (no rounding problems like in the above definition, because the rabbit sequence A005614(n-1) for n >= 1, can be defined by a substitution rule).
a(n+1) = A(n+1)-(n+1) (serving, together with the last equation, as definition for A(n+1), given the rabbit sequence).
a(n+1) = A005206(n), n >= 0.
(End)
Let b(n) = floor((n+1)/phi). Then b(n) + b(b(n-1)) = n [Granville and Rasson]. - N. J. A. Sloane, Jun 13 2014

Examples

			a(6)= 3 so b(6) = 6 - 3 = 3. a(7) = 4 because (a(6) + 1) / b(6) = 4/3 which is < (1 + sqrt(5))/2. So b(7) = 7 - 4 = 3. a(8) = 4 because (a(7) + 1) / b(7) = 5/3 which is > (1 + sqrt(5))/2. - Robert A. Stump (bee_ess107(AT)msn.com), Sep 22 2002
From _Wolfdieter Lang_, Jun 28 2011: (Start)
There are a(4) = 2 (positive) Wythoff A-numbers <= 3, namely 1 and 3.
There are a(4) = 2 (positive) Wythoff B-numbers < A(4) = 6, namely 2 and 5.
a(4) = 2 = A(4) - 4 = 6 - 4.
(End)
		

Crossrefs

Cf. A000045 (Fibonacci numbers), A003622, A022342, A035336.
Terms that occur only once: A001950.
Terms that occur twice: A066096 (a version of A000201).
Numerator sequences for other values, as described in Robert A. Stump's 2002 comment: A074065 (sqrt(3)), A074840 (sqrt(2)).
Apart from initial terms, same as A005206.
First differences: A096270 (a version of A005614).
Partial sums: A183136.

Programs

  • Magma
    [Floor(2*n/(1+Sqrt(5))): n in [0..80]]; // Vincenzo Librandi, Mar 29 2015
    
  • Mathematica
    Floor[Range[0,80]/GoldenRatio] (* Harvey P. Dale, May 09 2013 *)
  • PARI
    { default(realprecision, 10); p=(sqrt(5) - 1)/2; for (n=0, 1000, write("b060143.txt", n, " ", floor(n*p)); ) } \\ Harry J. Smith, Jul 02 2009
    
  • Python
    from math import isqrt
    def A060143(n): return (n+isqrt(5*n**2)>>1)-n # Chai Wah Wu, Aug 10 2022

Formula

a(n) = floor(phi(n)), where phi=(sqrt(5)-1)/2. [corrected by Casey Mongoven, Jul 18 2008]
a(F_n + 1) = F_{n-1} if F_n is the n-th Fibonacci number. [aligned with sequence offset by Peter Munn, Jan 10 2018]
a(1) = 0. b(n) = n - a(n). If (a(n) + 1) / b(n) < (1 + sqrt(5))/2, then a(n+1) = a(n) + 1, else a(n+1) = a(n). - Robert A. Stump (bee_ess107(AT)msn.com), Sep 22 2002 [corrected by Peter Munn, Jan 07 2018]
A006336(n) = A006336(n-1) + A006336(a(n)) for n>1. - Reinhard Zumkeller, Oct 24 2007
a(n) = floor(n*phi) - n, where phi = (1+sqrt(5))/2. - William A. Tedeschi, Mar 06 2008
Celaya and Ruskey give an interesting formula for a(n). - N. J. A. Sloane, Jun 13 2014

Extensions

I merged three identical sequences to create this entry. Some of the formulas may need their initial terms adjusting now. - N. J. A. Sloane, Mar 05 2003
More terms from William A. Tedeschi, Mar 06 2008

A074065 Numerators a(n) of fractions slowly converging to sqrt(3): let a(1) = 0, b(n) = n - a(n); if (a(n) + 1) / b(n) < sqrt(3), then a(n+1) = a(n) + 1, else a(n+1)= a(n).

Original entry on oeis.org

0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 46
Offset: 1

Views

Author

Robert A. Stump (bee_ess107(AT)msn.com), Sep 15 2002

Keywords

Comments

a(n) + b(n) = n and as n -> +infinity, a(n) / b(n) converges to sqrt(3). For all n, a(n) / b(n) < sqrt(3).

Examples

			a(6)= 3 so b(6) = 6 - 3 = 3. a(7) = 4 because (a(6) + 1) / b(6) = 4/3 which is < sqrt(3). So b(7) = 7 - 4 = 3. a(8) = 5 because (a(7) + 1) / b(7) = 5/3 which is < sqrt(3).
		

Crossrefs

Formula

a(1) = 0. b(n) = n - a(n). If (a(n) + 1) / b(n) < sqrt(3), then a(n+1) = a(n) + 1, else a(n+1) = a(n).
a(n) = floor(n*(3-sqrt(3))/2). - Vladeta Jovovic, Oct 04 2003
Partial sums of A144612. - R. J. Mathar, May 30 2025

Extensions

Offset corrected by Sean A. Irvine, Jan 08 2025

A076538 Numerators a(n) of fractions slowly converging to e: let a(1) = 0, b(n) = n - a(n); if (a(n) + 1) / b(n) < e then a(n+1) = a(n) + 1, else a(n+1)= a(n).

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 16, 16, 17, 18, 19, 19, 20, 21, 21, 22, 23, 24, 24, 25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36, 37, 38, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 46, 47, 48, 48, 49, 50, 51, 51, 52, 53
Offset: 1

Views

Author

Robert A. Stump (bee_ess107(AT)msn.com), Oct 18 2002

Keywords

Comments

a(n) + b(n) = n and as n -> +infinity, a(n) / b(n) converges to e. For all n, a(n) / b(n) < e.

Examples

			a(6)= 4 so b(6) = 6 - 4 = 2. a(7) = 5 because (a(6) + 1) / b(6) = 5/2 which is < e. So b(7) = 7 - 5 = 2. a(8) = 5 because (a(7) + 1) / b(7) = 6/2 which is not < e.
		

Crossrefs

Cf. A074840.
Partial sums of A144610.

Programs

  • PARI
    a(n)=local(t); if(n<2,0,t=0; for(k=0,n-1,if(1+t
    				

Formula

a(1) = 0. b(n) = n - a(n). If (a(n) + 1) / b(n) < e, then a(n+1) = a(n) + 1, else a(n+1) = a(n).
a(n) = floor(n*exp(1)/(exp(1)+1)). - Vladeta Jovovic, Oct 04 2003

A076539 Numerators a(n) of fractions slowly converging to Pi: let a(1) = 0, b(n) = n - a(n); if (a(n) + 1) / b(n) < Pi, then a(n+1) = a(n) + 1, otherwise a(n+1) = a(n).

Original entry on oeis.org

0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 22, 23, 24, 25, 25, 26, 27, 28, 28, 29, 30, 31, 31, 32, 33, 34, 34, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, 49, 50, 50, 51, 52, 53, 53, 54, 55
Offset: 1

Views

Author

Robert A. Stump (bee_ess107(AT)msn.com), Oct 18 2002

Keywords

Comments

a(n) + b(n) = n and as n -> +infinity, a(n)/b(n) converges to Pi. For all n, a(n)/b(n) < Pi.

Examples

			a(7)= 5 so b(7) = 7 - 5 = 2.
a(8) = 6 because (a(7) + 1)/b(7) = 6/2 which is < Pi. So b(8) = 8 - 6 = 2.
a(9) = 6 because (a(8) + 1)/b(8) = 7/2 which is not < Pi.
		

Crossrefs

Partial sums of A144609.

Programs

Formula

a(1) = 0, b(n) = n - a(n), if (a(n) + 1)/b(n) < Pi, then a(n+1) = a(n) + 1, otherwise a(n+1) = a(n).
a(n) = floor(n*Pi/(Pi+1)). - Vladeta Jovovic, Oct 04 2003

A144611 Sturmian word of slope 2-sqrt(2).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jan 13 2009

Keywords

Comments

Old name was: Sturmian word of slope 2.
Conjecture: a(n) = floor((n+1)*log(3)/log(2)) - floor(n*log(3)/log(2)) - 1.
This is not true: Let b(n) = floor((n+1)*log(3)/log(2)) - floor(n*log(3)/log(2)) - 1. Then b(40) = 0, whereas a(40) = 1. This is the first term at which a(n) and b(n) disagree. - Danny Rorabaugh, Mar 14 2015
From Benoit Cloitre, Oct 16 2016: (Start)
Let u(n) = n + floor(sqrt(2)*n) (A003151) and v(n) = n + floor(n/sqrt(2)) (A003152) then u,v form a partition of the positive integers and we have, for n >= 1, a(u(n))=0 and a(v(n))=1.
Another way to construct the sequence: merge the sequences x(n) = 2n^2+1 and y(n) = 4n^2 (n >= 1) into an increasing sequence z(n) which then begins: 3,4,9,16,19,33,36,51,64,73 (not in the OEIS). Then for n >= 1, a(n) = z(n) mod 2. (End)
From Michel Dekking, Feb 16 2020: (Start)
This sequence is a Sturmian sequence s(alpha,rho) with slope alpha = 2-sqrt(2), and intercept rho = 0.
In general, one passes from slope alpha to slope 1-alpha by exchanging 0 and 1. It therefore follows from the Comments of A006337 that (a(n+1)) is the unique fixed point of the morphism 0 -> 101, 1 -> 10. (End)

Crossrefs

See A144595 for further details. Cf. A006337, A074840.

Programs

  • Mathematica
    christoffel[s_, M_] := Module[{n, x = 1, y = 0, ans = {0}}, Do[If[y + 1 <= s*x, AppendTo[ans, 1]; y++, AppendTo[ans, 0]; x++], {n, 1, M}]; ans] (* or Sturmian word, Jean-François Alcover, Sep 19 2016, A274170 *); christoffel[Sqrt[2], 105] (* Robert G. Wilson v, Feb 02 2017 *)
  • PARI
    \\ to get N terms
    a(n)=if(n<1,0,vecsort(concat(vector(floor(sqrt(2)*N),i,2*i^2+1),vector(N,j,4*j^2)))[n]%2) \\ Benoit Cloitre, Oct 16 2016
  • Sage
    #Generate the first n terms (plus a few) of the Sturmian word of slope a
    def Sturmian(a,n):
        y = 0
        A = []
        while len(A)<=n:
            y += a
            A.extend([0]+[1]*(floor(y)-floor(y-a)))
        return A
    Sturmian(sqrt(2),104)
    # Danny Rorabaugh, Mar 14 2015
    

Formula

a(n) = floor((n+1)*alpha) - floor(n*alpha), where alpha = 2-sqrt(2). - Michel Dekking, Feb 16 2020

Extensions

Name corrected by Michel Dekking, Feb 16 2020

A098295 ((3/2)^n)/2^a(n) lies in the half-open interval [1,2).

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 14, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 27, 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, 33, 34, 35, 35, 36, 36, 37, 38, 38, 39, 39, 40, 40, 41, 42, 42, 43, 43
Offset: 1

Views

Author

Wolfdieter Lang, Oct 18 2004

Keywords

Comments

Stacking perfect fifths (the frequency ratio of a fifth is 3/2), a division by 2^a(n) leads the equivalent tone belonging to the first octave interval [1,2). For example, the third fifth, (3/2)^3, falls into the second octave. This means it lies in the interval [2^1,2^2)=[2,4). Hence ((3/2)^3)/2^1 belongs to the first octave, the interval [1,2).
This sequence coincides for the first 93 term with the floor of y(n)= 4*Pi*log(phi)*n/(Pi^2 + (2*log(phi)^2)), with phi:=(1+sqrt(5))/2. a(n) = floor(y(n)), for n=1..93. Note that y(n) is not the imaginary part of the zero of the Fibonacci function because of a different bracket setting. See A214656. - Wolfdieter Lang, Jul 24 2012

Examples

			(3/2)^12 lies in the eighth octave [2^7,2^8) and
((3/2)^12)/2^a(12)= ((3/2)^12)/2^7 = 3^12/2^19 = 531441/524288 = 1.01363... belongs to the first octave [1,2). This ratio is called the Pythagorean comma.
		

Crossrefs

This sequence differs from A074840 for the first time at entry a(41)=23: A074840(41)=24.

Programs

Formula

a(n) = A098294(n)-1, n >= 1.
a(n) = ceiling(tau*n)-1 with tau = log(3)/log(2)-1 = 0.58496250072..., n >= 1.
a(n) = A056576(n) - n. - Ruud H.G. van Tol, Jan 26 2024
Showing 1-6 of 6 results.