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.

A035336 a(n) = 2*floor(n*phi) + n - 1, where phi = (1+sqrt(5))/2.

Original entry on oeis.org

2, 7, 10, 15, 20, 23, 28, 31, 36, 41, 44, 49, 54, 57, 62, 65, 70, 75, 78, 83, 86, 91, 96, 99, 104, 109, 112, 117, 120, 125, 130, 133, 138, 143, 146, 151, 154, 159, 164, 167, 172, 175, 180, 185, 188, 193, 198, 201, 206, 209, 214, 219, 222, 227, 230, 235, 240
Offset: 1

Views

Author

Keywords

Comments

Second column of Wythoff array.
These are the numbers in A022342 that are not images of another value of the same sequence if it is given offset 0. - Michele Dondi (bik.mido(AT)tiscalenet.it), Dec 30 2001
Also, positions of 2's in A139764, the smallest term in Zeckendorf representation of n. - John W. Layman, Aug 25 2011
From Amiram Eldar, Mar 21 2022: (Start)
Numbers k for which the Zeckendorf representation A014417(k) ends with 0, 1, 0.
The asymptotic density of this sequence is sqrt(5)-2. (End)

Crossrefs

Let A = A000201, B = A001950. Then AA = A003622, AB = A003623, BA = A035336, BB = A101864.

Programs

  • Haskell
    import Data.List (elemIndices)
    a035336 n = a035336_list !! (n-1)
    a035336_list = elemIndices 0 a005713_list
    -- Reinhard Zumkeller, Dec 30 2011
    
  • Magma
    [2*Floor(n*(1+Sqrt(5))/2)+n-1: n in [1..80]]; // Vincenzo Librandi, Nov 19 2016
    
  • Maple
    Digits := 100: t := (1+sqrt(5))/2; [ seq(2*floor((n+1)*t)+n,n=0..80) ];
  • Mathematica
    Table[2*Floor[n*(1 + Sqrt[5])/2] + n - 1, {n, 50}] (* Wesley Ivan Hurt, Nov 21 2017 *)
    Array[2 Floor[# GoldenRatio] + # - 1 &, 60] (* Robert G. Wilson v, Dec 12 2017 *)
  • Python
    from sympy import floor
    from mpmath import phi
    def a(n): return 2*floor(n*phi) + n - 1 # Indranil Ghosh, Jun 10 2017
    
  • Python
    from math import isqrt
    def A035336(n): return (n+isqrt(5*n**2)&-2)+n-1 # Chai Wah Wu, Aug 17 2022

Formula

a(n) = B(A(n)), with A(k)=A000201(k) and B(k)=A001950(k) (Wythoff BA-numbers).
a(n) = A(n) + A(A(n)), with A(A(n))=A003622(n) (Wythoff AA-numbers).
Equals A022342(A003622(n)+1). - Michele Dondi (bik.mido(AT)tiscalenet.it), Dec 30 2001, sequence reference updated by Peter Munn, Nov 23 2017
a(n) = 2*A003622(n) - (n - 1) = A003623(n) - 1. - Franklin T. Adams-Watters, Jun 30 2009
A005713(a(n)) = 0. - Reinhard Zumkeller, Dec 30 2011
a(n) = A089910(n) - 2. - Bob Selcoe, Sep 21 2014

A014677 First differences of A001468.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Nov 07 2001

Keywords

Comments

A001468 is an infinite Fibonacci word with strings of 2's of length A001468(n) delimited by 1's. - Paul D. Hanna, Dec 17 2004
c(n):=a(n-1), n >= 1, is -1 if n is a Wythoff B-number from A001950, it is 0 if n=A(B(m)+1) for some m >= 1, with A(k):=A000201(k) (Wythoff A-numbers) and it is +1 if n=A(A(m)+1)=B(m)+1 for some m >= 0, with B(0):=0. - Wolfdieter Lang, Oct 13 2006
This sequence is a symbolic sequence as discussed in the paper "Morphisms, Symbolic Sequences, and Their Standard Forms". It can be derived directly from the 2-block morphism induced by the morphism generating A001468. Since A001468 is the Fibonacci word A003849, but on the alphabet {2,1}, with an extra 1 in front, this 2-block morphism has 3-symbol Fibonacci as a fixed point: A270788. The 2-blocks in A001468 are 12, 21, and 22, yielding the differences a(n) = 1, a(n) = -1, and a(n) = 0. In 3-symbol Fibonacci these correspond to the letters 2, 1, and 3. Expressing this coding with pi given by pi(1)=-1, pi(2)=1, pi(3)=0, we obtain the formula below. Wolfdieter Lang's Wythoff description of (a(n)) follows from the corresponding Wythoff description in A270788. - Michel Dekking, Dec 30 2019

Crossrefs

Cf. A001468, A000045. Essentially equal to A270788.

Programs

  • Python
    from math import isqrt
    def A014677(n): return (n+isqrt(m:=5*(n+2)**2)>>1)-(n+1+isqrt(m-10*n-15)&-2)+(n+isqrt(m-20*n-20)>>1)+1 # Chai Wah Wu, Aug 25 2022

Formula

abs(a(n)) = floor(f*ceiling(n/f)) - ceiling(f*floor(n/f)) where f=phi=(1+sqrt(5))/2; for n > 1, abs(a(n)) = A005713(n-1). - Benoit Cloitre, Apr 21 2003
G.f. equals the continued fraction: A(x) = [0;1, 1/x, 1/x, 1/x^2, 1/x^3, 1/x^5, 1/x^8, ..., 1/x^Fibonacci(n), ...]. - Paul D. Hanna, Dec 17 2004
a(n) = b(n) - b(n-1) with b(n):=A005614(n), n >= 1.
a(n) = pi(A270788(n)), n >= 1, where pi is the letter-to-letter map pi(1)=-1, pi(2)=1, pi(3)=0. - Michel Dekking, Dec 30 2019

A214990 Second nearest integer to n*r, where r = (1+ sqrt(5))/2, the golden ratio.

Original entry on oeis.org

1, 4, 4, 7, 9, 9, 12, 12, 14, 17, 17, 20, 22, 22, 25, 25, 27, 30, 30, 33, 33, 35, 38, 38, 41, 43, 43, 46, 46, 48, 51, 51, 54, 56, 56, 59, 59, 62, 64, 64, 67, 67, 69, 72, 72, 75, 77, 77, 80, 80, 82, 85, 85, 88, 88, 90, 93, 93, 96, 98, 98, 101, 101, 103, 106, 106
Offset: 1

Views

Author

Clark Kimberling, Oct 31 2012

Keywords

Comments

Let {x} denote the fractional part of x. The second nearest integer to x, denoted by s(x), is defined to be ceiling(x) if {x} < 1/2 and floor(x) if {x} >= 1/2. If x is not an integer, there are exactly two integers k such that |k-x|<1; one is round(x) = floor(x+1/2), and the other is s(x).
Let J(n) be the n-th number k for which s((k+1)*r) > s(k*r). The golden ratio appears to be the only number x for which J(n) = floor(nx) for all n>=0. In this case, J = A000201.
Let f(n) = 0 if a(n) = a(n+1) and f(n) = 1 otherwise; then f is the infinite Fibonacci word A005614 = 1-A003849.
In this sequence, replace each repeated term by 1 and all others by 0; the result is A005713 (prefixed by 0).
The distinct terms of this sequence are given by A007064.

Examples

			n . . n*r . . nearest integer . second nearest
1 . . 1.618... .  2 . . . . . . . 1 = a(1)
2 . . 3.236... .  3 . . . . . . . 4 = a(2)
3 . . 4.854... .  5 . . . . . . . 4 = a(3)
4 . . 6.472... .  6 . . . . . . . 7 = a(4)
5 . . 8.090... .  8 . . . . . . . 9 = a(5)
		

Crossrefs

Programs

  • Mathematica
    r = GoldenRatio; f[x_] := If[FractionalPart[x] < 1/2, Ceiling[x], Floor[x]]
    Table[f[r*n], {n, 1, 100}]

A363070 Take the terms 0..n of the infinite Fibonacci word A003849, regard them as a number in Fibonacci base.

Original entry on oeis.org

0, 1, 2, 3, 6, 10, 17, 28, 45, 74, 120, 194, 315, 510, 826, 1337, 2163, 3501, 5665, 9167, 14833, 24000, 38834, 62835, 101669, 164505, 266175, 430681, 696857, 1127538, 1824396, 2951935, 4776331, 7728267, 12504599, 20232867, 32737467, 52970334, 85707802, 138678137, 224385940, 363064078
Offset: 0

Views

Author

Gandhar Joshi, May 16 2023

Keywords

Examples

			0 ->                            0 -> a(0) = 0,
0,1 ->                         01 -> a(1) = 1,
0,1,0 ->                      010 -> a(2) = 2,
0,1,0,0 ->                   0100 -> a(3) = 3,
0,1,0,0,1 ->                01001 -> a(4) = 6,
0,1,0,0,1,0 ->             010010 -> a(5) = 10,
0,1,0,0,1,0,1 ->          0100101 -> a(6) = 17,
0,1,0,0,1,0,1,0 ->       01001010 -> a(7) = 28,
0,1,0,0,1,0,1,0,0 ->    010010100 -> a(8) = 45,
0,1,0,0,1,0,1,0,0,1 -> 0100101001 -> a(9) = 74.
		

Crossrefs

Cf. A003849 (Fibonacci word), A005713, A189920 (Zeckendorf digits).
Cf. A182028.

Programs

  • Python
    # see linked program
    
  • Python
    def aupto(n): # produces n terms, indices 0..n-1
        F1, F, a = [0], [0, 1], [0, 1]
        while len(F) < n:
            F1, F = F, F+F1
        [a.append(a[-2]+a[-1]+F[i]+F[i-1]) for i in range(2, n)]
        return a
    print(aupto(42)) # Michael S. Branicky, May 17 2023

Formula

a(n) = Sum_{i=0..n} A003849(i)*Fibonacci(n-i+2).
a(n) = a(n-1) + a(n-2) + A003849(n) + A003849(n-1).
a(n) = a(n-1) + a(n-2) + A005713(n-1). - Kevin Ryde, May 20 2023
Showing 1-4 of 4 results.