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-10 of 12 results. Next

A182561 Position of first occurrence of n in A182535.

Original entry on oeis.org

1, 4, 7, 16, 45, 74, 166, 529, 866, 1993, 4560, 9907, 27425, 62894, 161134, 386007, 1308165, 2363223, 7190239, 17844411, 54259731, 90564740, 308061971, 487568736, 1422102892, 3573737940, 8516241133, 22686128280, 77770540116, 144783290133, 365331892456, 928427248701, 2354811032695
Offset: 1

Views

Author

Alex Ratushnyak, May 05 2012

Keywords

Examples

			First occurrence of 4 in A182535 has index 16, so a(4)=16.
		

Programs

  • PARI
    { a(n) = my(k,p,t); k=n-1; while(1, k++; p=[]; forvec(v=vector(n-1,i,[1,k-1]), t = fibonacci(n+k) + sum(i=1,n-1,fibonacci(v[i]+i));  if(ispseudoprime(t),p=concat(p,[t])); ,2); if(p,return(primepi(vecmin(p)))); ); } /* Max Alekseyev, Jan 31 2014 */

Extensions

Corrected and extended by Max Alekseyev, Jan 31 2014

A007895 Number of terms in the Zeckendorf representation of n (write n as a sum of non-consecutive distinct Fibonacci numbers).

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 2, 2, 2, 3, 2, 3, 3, 1, 2, 2, 2, 3, 2, 3, 3, 2, 3, 3, 3, 4, 1, 2, 2, 2, 3, 2, 3, 3, 2, 3, 3, 3, 4, 2, 3, 3, 3, 4, 3, 4, 4, 1, 2, 2, 2, 3, 2, 3, 3, 2, 3, 3, 3, 4, 2, 3, 3, 3, 4, 3, 4, 4, 2, 3, 3, 3, 4, 3, 4, 4, 3, 4, 4, 4, 5, 1, 2, 2, 2, 3, 2, 3, 3, 2, 3, 3, 3, 4, 2, 3, 3
Offset: 0

Views

Author

Felix Weinstein (wain(AT)ana.unibe.ch) and Clark Kimberling

Keywords

Comments

Also number of 0's (or B's) in the Wythoff representation of n -- see the Reble link. See also A135817 for references and links for the Wythoff representation for n >= 1. - Wolfdieter Lang, Jan 21 2008; N. J. A. Sloane, Jun 28 2008
Or, a(n) is the number of applications of Wythoff's B sequence A001950 needed in the unique Wythoff representation of n >= 1. E.g., 16 = A(B(A(A(B(1))))) = ABAAB = `10110`, hence a(16) = 2. - Wolfdieter Lang, Jan 21 2008
Let M(0) = 0, M(1) = 1 and for i > 0, M(i+1) = f(concatenation of M(j), j from 0 to i - 1) where f is the morphism f(k) = k + 1. Then the sequence is the concatenation of M(j) for j from 0 to infinity. - Claude Lenormand (claude.lenormand(AT)free.fr), Dec 16 2003
From Joerg Arndt, Nov 09 2012: (Start)
Let m be the number of parts in the listing of the compositions of n into odd parts as lists of parts in lexicographic order, a(k) = (n - length(composition(k)))/2 for all k < Fibonacci(n) and all n (see example).
Let m be the number of parts in the listing of the compositions of n into parts 1 and 2 as lists of parts in lexicographic order, a(k) = n - length(composition(k)) for all k < Fibonacci(n) and all n (see example).
A000120 gives the equivalent for (all) compositions. (End)
a(n) = A104324(n) - A213911(n); row lengths in A035516 and A035516. - Reinhard Zumkeller, Mar 10 2013
a(n) is also the minimum number of Fibonacci numbers which sum to n, regardless of adjacency or duplication. - Alan Worley, Apr 17 2015
This follows from the fact that the sequence is subadditive: a(n+m) <= a(n) + a(m) for nonnegative integers n,m. See Lemma 2.1 of the Stoll link. - Robert Israel, Apr 17 2015
From Michel Dekking, Mar 08 2020: (Start)
This sequence is a morphic sequence on an infinite alphabet, i.e., (a(n)) is a letter-to-letter projection of a fixed point of a morphism tau.
The alphabet is {0,1,...,j,...}X{0,1}, and tau is given by
tau((j,0)) = (j,0) (j+1,1),
tau((j,1)) = (j,0).
The letter-to-letter map is given by the projection on the first coordinate: (j,i)->j for i=0,1.
To prove this, note first that the second coordinate of the letters generates the infinite Fibonacci word = A003849 = 0100101001001....
This implies that for all n and j one has
|tau^n(j,0)| = F(n+2),
where |w| denotes the length of a word w, and (F(n)) = A000045 are the Fibonacci numbers.
Secondly, we need the following simple, but crucial observation. Let the Zeckendorf representation of n be Z(n) = A014417(n). For example,
Z(0) = 0, Z(1) = 1, Z(2) = 10, Z(3) = 100, Z(4) = 101, Z(5) = 1000.
From the unicity of the Zeckendorf representation it follows that for the positions i = 0,1,...,F(n)-1 one has
Z(F(n+1)+i) = 10...0 Z(i),
where zeros are added to Z(i) to give the total representation length n-1.
This gives for i = 0,1,...,F(n)-1 that
a(F(n+1)+i) = a(i) + 1.
From the first observation follows that the first F(n+1) letters of tau^n(j,0) are equal to tau^{n-1}(j,0), and the last F(n) letters of tau^n(j,0) are equal to tau^{n-1}(j+1,1) = tau^{n-2}(j+1,0).
Combining this with the second observation shows that the first coordinate of the fixed point of tau, starting from (0,0), gives (a(n)).
It is of course possible to obtain a morphism tau' on the natural numbers by changing the alphabet: (j,0)-> 2j (j,1)-> 2j+1, which yields the morphism
tau'(2j) = 2j, 2j+3, tau'(2j+1) = 2j.
The fixed point of tau' starting with 0 is
u = 03225254254472544747625...
The corresponding letter-to-letter map lambda is given by lambda(2j)=j, lambda(2j+1)= j. Then lambda(u) = (a(n)).
(End)

Examples

			a(46) = a(1 + 3 + 8 + 34) = 4.
From _Joerg Arndt_, Nov 09 2012: (Start)
Connection to the compositions of n into odd parts (see comment):
[ #]:  a(n)  composition into odd parts
[ 0]   [ 0]   1 1 1 1 1 1 1 1
[ 1]   [ 1]   1 1 1 1 1 3
[ 2]   [ 1]   1 1 1 1 3 1
[ 3]   [ 1]   1 1 1 3 1 1
[ 4]   [ 2]   1 1 1 5
[ 5]   [ 1]   1 1 3 1 1 1
[ 6]   [ 2]   1 1 3 3
[ 7]   [ 2]   1 1 5 1
[ 8]   [ 1]   1 3 1 1 1 1
[ 9]   [ 2]   1 3 1 3
[10]   [ 2]   1 3 3 1
[11]   [ 2]   1 5 1 1
[12]   [ 3]   1 7
[13]   [ 1]   3 1 1 1 1 1
[14]   [ 2]   3 1 1 3
[15]   [ 2]   3 1 3 1
[16]   [ 2]   3 3 1 1
[17]   [ 3]   3 5
[18]   [ 2]   5 1 1 1
[19]   [ 3]   5 3
[20]   [ 3]   7 1
Connection to the compositions of n into parts 1 or 2 (see comment):
[ #]:  a(n)  composition into parts 1 and 2
[ 0]   [0]   1 1 1 1 1 1 1
[ 1]   [1]   1 1 1 1 1 2
[ 2]   [1]   1 1 1 1 2 1
[ 3]   [1]   1 1 1 2 1 1
[ 4]   [2]   1 1 1 2 2
[ 5]   [1]   1 1 2 1 1 1
[ 6]   [2]   1 1 2 1 2
[ 7]   [2]   1 1 2 2 1
[ 8]   [1]   1 2 1 1 1 1
[ 9]   [2]   1 2 1 1 2
[10]   [2]   1 2 1 2 1
[11]   [2]   1 2 2 1 1
[12]   [3]   1 2 2 2
[13]   [1]   2 1 1 1 1 1
[14]   [2]   2 1 1 1 2
[15]   [2]   2 1 1 2 1
[16]   [2]   2 1 2 1 1
[17]   [3]   2 1 2 2
[18]   [2]   2 2 1 1 1
[19]   [3]   2 2 1 2
[20]   [3]   2 2 2 1
(End)
From _Michel Dekking_, Mar 08 2020: (Start)
The third iterate of the morphism tau generating this sequence:
      tau^3((0,0)) = (0,0)(1,1)(1,0)(1,0)(2,1)
= (a(0),0)(a(1),1)(a(2),0)(a(3),0)(a(4),1). (End)
		

References

  • Cornelius Gerrit Lekkerkerker, Voorstelling van natuurlijke getallen door een som van getallen van Fibonacci, Simon Stevin 29 (1952), 190-195.
  • F. Weinstein, The Fibonacci Partitions, preprint, 1995.
  • Édouard Zeckendorf, Représentation des nombres naturels par une somme des nombres de Fibonacci ou de nombres de Lucas, Bull. Soc. Roy. Sci. Liège 41, 179-182, 1972.

Crossrefs

Cf. A135817 (lengths of Wythoff representation), A135818 (number of 1's (or A's) in the Wythoff representation).
Record positions are in A027941.

Programs

  • Haskell
    a007895 = length . a035516_row  -- Reinhard Zumkeller, Mar 10 2013
    
  • Maple
    # With the following Maple program (not the best one), B(n) (n >= 1) yields the number of terms in the Zeckendorf representation of n.
    with(combinat): B := proc (n) local A, ct, m, j: A := proc (n) local i: for i while fibonacci(i) <= n do n-fibonacci(i) end do end proc: ct := 0; m := n: for j while 0 < A(m) do ct := ct+1: m := A(m) end do: ct+1 end proc: 0, seq(B(n), n = 1 .. 104);
    # Emeric Deutsch, Jul 05 2010
    N:= 1000: # to get a(n) for n <= N
    m:= ceil(log[(1+sqrt(5))/2](sqrt(5)*N)):
    Z:= Vector(m):
    a[0]:= 0:
    for n from 1 to N do
    if Z[1] = 0 then Z[1]:= 1; q:= 1;
    else Z[2]:= 1; Z[1]:= 0; q:= 2;
    fi;
    while Z[q+1] = 1 do
      Z[q]:= 0;
      Z[q+1]:= 0;
      Z[q+2]:= 1;
      q:= q+2;
    od:
    a[n]:= add(Z[i],i=1..m);
    od:
    seq(a[n],n=0..N); # Robert Israel, Apr 17 2015
    # alternative
    read("transforms") : # https://oeis.org/transforms.txt
    A007895 := proc(n)
        wt(A003714(n)) ;
    end proc:
    seq(A007895(n),n=0..10) ; # R. J. Mathar, Sep 22 2020
  • Mathematica
    zf[n_] := (k = 1; ff = {}; While[(fi = Fibonacci[k]) <= n, AppendTo[ff, fi]; k++]; Drop[ff, 1]); zeckRep[n_] := If[n == 0, 0, r = n; s = {}; fr = zf[n]; While[r > 0, lf = Last[fr]; If[lf <= r, r = r - lf; PrependTo[s, lf]]; fr = Drop[fr, -1]]; s]; zeckRepLen[n_] := Length[zeckRep[n]]; Table[zeckRepLen[n], {n, 0, 104}] (* Jean-François Alcover, Sep 27 2011 *)
    DigitCount[Select[Range[0, 1000], BitAnd[#, 2#] == 0 &], 2, 1] (* Jean-François Alcover, Jan 25 2018 *)
    Table[Length[DeleteCases[NestWhileList[# - Fibonacci[Floor[Log[Sqrt[5] * # + 3/2]/Log[GoldenRatio]]] &, n, # > 1 &], 0]], {n, 0, 143}] (* Alonso del Arte, May 14 2019 *)
    Flatten[Nest[{Flatten[#], #[[1]] + 1} &, {0, 1}, 9]] (* Paolo Xausa, Jun 17 2024 *)
  • PARI
    a(n,mx=0)=if(n<4,n>0,if(!mx,while(fibonacci(mx)n,mx--); 1+a(n-fibonacci(mx),mx-2)) \\ Charles R Greathouse IV, Feb 14 2013
    
  • PARI
    a(n)=if(n<4, n>0, my(k=2,s,t); while(fibonacci(k++)<=n,); while(k && n, t=fibonacci(k); if(t<=n, n-=t; s++); k--); s) \\ Charles R Greathouse IV, Sep 02 2015
    
  • Python
    from sympy import fibonacci
    def a(n):
        k=0
        x=0
        while n>0:
            k=0
            while fibonacci(k)<=n: k+=1
            x+=10**(k - 3)
            n-=fibonacci(k - 1)
        return str(x).count("1")
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 09 2017

Formula

a(n) = A000120(A003714(n)). - Reinhard Zumkeller, May 05 2005
a(n) = A107015(n) + A107016(n). - Reinhard Zumkeller, May 09 2005
a(n) = A143299(n+1) - 1. - Filip Zaludek, Oct 31 2016
a(n) = A007953(A014417(n)). - Amiram Eldar, Oct 10 2023

Extensions

Edited by N. J. A. Sloane Jun 27 2008 at the suggestion of R. J. Mathar and Don Reble

A182569 Primes that have two terms in their Zeckendorf representation.

Original entry on oeis.org

7, 11, 23, 29, 37, 47, 97, 149, 157, 199, 241, 379, 521, 613, 631, 1021, 1741, 2207, 3571, 9349, 10949, 11933, 17713, 46381, 46457, 46601, 50549, 75169, 196439, 203183, 214129, 560597, 832129, 2178343, 3010349, 3531343, 14930441, 15444581, 16276621, 24157961
Offset: 1

Views

Author

Alex Ratushnyak, May 05 2012

Keywords

Comments

Primes of the form Fibonacci(x)+Fibonacci(y), x-y>1.

Examples

			7 = 5+2. 11=8+3. 23=21+2. 29 =21+8.
		

Crossrefs

Programs

  • Mathematica
    nn = 40; f = Fibonacci[Range[nn]]; ps = {}; Do[ps = Union[ps, Select[f[[k]] + Delete[f, {{k-1}, {k}, {k+1}}], PrimeQ]], {k, 4, nn-1}]; ps (* T. D. Noe, May 08 2012 *)

Formula

Intersection of A000040 and A179242. - Michel Marcus, May 28 2013

Extensions

More terms from T. D. Noe, May 08 2012

A182576 Number of 1's in the Zeckendorf representation of n^2.

Original entry on oeis.org

0, 1, 2, 2, 2, 3, 2, 3, 3, 3, 3, 4, 1, 4, 4, 4, 3, 3, 3, 4, 3, 4, 4, 3, 3, 3, 4, 5, 5, 6, 4, 5, 3, 3, 5, 3, 4, 3, 6, 4, 2, 4, 4, 5, 6, 6, 7, 3, 4, 6, 5, 4, 5, 5, 5, 5, 6, 3, 5, 7, 4, 5, 6, 4, 6, 4, 5, 6, 5, 6, 6, 6, 4, 6, 7, 7, 8, 5, 6, 7, 6, 6, 7, 4, 4, 6, 3
Offset: 0

Views

Author

Alex Ratushnyak, May 05 2012

Keywords

Comments

Also the minimum number of different Fibonacci numbers that sum up to n^2. - Carmine Suriano, Jul 03 2013
See A088060 for some comments related to the occurrence of 2's. - Peter Munn, Mar 22 2021

Examples

			a(11)=4 since 11^2 = 121 = 89 + 21 + 8 + 3 = fib(11) + fib(8) + fib(6) + fib(4). - _Carmine Suriano_, Jul 03 2013
		

Crossrefs

A182570 Primes that have three terms in their Zeckendorf representation.

Original entry on oeis.org

17, 19, 31, 41, 43, 59, 61, 71, 73, 79, 103, 107, 113, 131, 151, 167, 173, 179, 181, 191, 239, 251, 257, 269, 293, 383, 401, 419, 433, 467, 479, 487, 523, 617, 619, 647, 673, 701, 733, 757, 809, 877, 991, 997, 1009, 1013, 1063, 1097, 1223, 1367, 1453, 1601
Offset: 1

Views

Author

Alex Ratushnyak, May 05 2012

Keywords

Crossrefs

A182577 Number of ones in Zeckendorf representation of n!

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 3, 5, 6, 9, 8, 11, 11, 11, 16, 17, 17, 18, 23, 23, 28, 31, 33, 27, 33, 29, 40, 37, 42, 42, 41, 44, 47, 44, 53, 56, 57, 50, 64, 55, 59, 68, 63, 72, 70, 61, 69, 85, 80, 83, 87, 97, 98, 101, 87, 91, 100, 102, 114, 108, 116, 109, 117, 117, 113, 124
Offset: 0

Views

Author

Alex Ratushnyak, May 05 2012

Keywords

Examples

			5! = {1, 0, 0, 1, 0, 1, 0, 0, 1, 0} in the Zeckendorf base.
		

Crossrefs

Programs

  • Python
    from math import factorial
    def A182577(n):
        m, tlist, s = factorial(n), [1,2], 0
        while tlist[-1]+tlist[-2] <= m:
            tlist.append(tlist[-1]+tlist[-2])
        for d in tlist[::-1]:
            if d <= m:
                s += 1
                m -= d
        return s # Chai Wah Wu, Jun 15 2018

A182571 Primes that have four terms in their Zeckendorf representation.

Original entry on oeis.org

53, 67, 83, 101, 109, 127, 137, 139, 163, 193, 223, 263, 271, 277, 281, 283, 311, 317, 331, 337, 359, 389, 397, 409, 421, 439, 443, 461, 503, 547, 557, 563, 577, 641, 653, 659, 683, 691, 709, 761, 769, 811, 853, 857, 859, 911, 919, 937, 953, 1019, 1031, 1039
Offset: 1

Views

Author

Alex Ratushnyak, May 05 2012

Keywords

Crossrefs

A182572 Primes that have five terms in their Zeckendorf representation.

Original entry on oeis.org

197, 211, 227, 229, 307, 313, 347, 349, 353, 367, 431, 449, 457, 463, 491, 509, 541, 569, 571, 587, 599, 643, 661, 677, 719, 727, 739, 743, 751, 773, 797, 823, 827, 863, 881, 883, 887, 907, 941, 947, 967, 971, 1033, 1061, 1069, 1093, 1103, 1117, 1151, 1163, 1171
Offset: 1

Views

Author

Alex Ratushnyak, May 05 2012

Keywords

Crossrefs

A182573 Primes that have six terms in their Zeckendorf representation.

Original entry on oeis.org

373, 499, 593, 601, 607, 787, 821, 829, 839, 929, 977, 1109, 1129, 1213, 1217, 1303, 1307, 1321, 1361, 1439, 1447, 1451, 1481, 1483, 1493, 1549, 1553, 1567, 1579, 1787, 1823, 1913, 1931, 1949, 1951, 2027, 2083, 2111, 2113, 2137, 2143, 2161, 2179, 2281
Offset: 1

Views

Author

Alex Ratushnyak, May 05 2012

Keywords

Crossrefs

A182574 Primes that have seven terms in their Zeckendorf representation.

Original entry on oeis.org

983, 1499, 1559, 1583, 1973, 2203, 2347, 2423, 2437, 2473, 2549, 2557, 2579, 2939, 2957, 3049, 3083, 3187, 3191, 3329, 3371, 3389, 3391, 3413, 3499, 3533, 3541, 3547, 3557, 3559, 3659, 3761, 3769, 3797, 3889, 3923, 3931, 3943, 4001, 4049, 4057, 4111, 4133
Offset: 1

Views

Author

Alex Ratushnyak, May 05 2012

Keywords

Crossrefs

Showing 1-10 of 12 results. Next