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 10 results.

A003622 The Wythoff compound sequence AA: a(n) = floor(n*phi^2) - 1, where phi = (1+sqrt(5))/2.

Original entry on oeis.org

1, 4, 6, 9, 12, 14, 17, 19, 22, 25, 27, 30, 33, 35, 38, 40, 43, 46, 48, 51, 53, 56, 59, 61, 64, 67, 69, 72, 74, 77, 80, 82, 85, 88, 90, 93, 95, 98, 101, 103, 106, 108, 111, 114, 116, 119, 122, 124, 127, 129, 132, 135, 137, 140, 142, 145, 148, 150, 153, 156, 158, 161, 163, 166
Offset: 1

Views

Author

Keywords

Comments

Also, integers with "odd" Zeckendorf expansions (end with ...+F_2 = ...+1) (Fibonacci-odd numbers); first column of Wythoff array A035513; from a 3-way splitting of positive integers. [Edited by Peter Munn, Sep 16 2022]
Also, numbers k such that A005206(k) = A005206(k+1). Also k such that A022342(A005206(k)) = k+1 (for all other k's this is k). - Michele Dondi (bik.mido(AT)tiscalenet.it), Dec 30 2001
Also, positions of 1's in A139764, the smallest term in Zeckendorf representation of n. - John W. Layman, Aug 25 2011
From Amiram Eldar, Sep 03 2022: (Start)
Numbers with an odd number of trailing 1's in their dual Zeckendorf representation (A104326), i.e., numbers k such that A356749(k) is odd.
The asymptotic density of this sequence is 1 - 1/phi (A132338). (End)
{a(n)} is the unique monotonic sequence of positive integers such that {a(n)} and {b(n)}: b(n) = a(n) - n form a partition of the nonnegative integers. - Yifan Xie, Jan 25 2025

References

  • A. Brousseau, Fibonacci and Related Number Theoretic Tables. Fibonacci Association, San Jose, CA, 1972, p. 62.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 307-308 of 2nd edition.
  • C. Kimberling, "Stolarsky interspersions", Ars Combinatoria 39 (1995) 129-138.
  • D. R. Morrison, "A Stolarsky array of Wythoff pairs", in A Collection of Manuscripts Related to the Fibonacci Sequence. Fibonacci Assoc., Santa Clara, CA, 1980, pp. 134-136.
  • J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 10.
  • N. J. A. Sloane and Simon Plouffe, Encyclopedia of Integer Sequences, Academic Press, 1995: this sequence appears twice, as both M3277 and M3278.

Crossrefs

Positions of 1's in A003849.
Complement of A022342.
The Wythoff compound sequences: Let A = A000201, B = A001950. Then AA = A003622, AB = A003623, BA = A035336, BB = A101864. The eight triples AAA, AAB, ..., BBB are A134859, A134860, A035337, A134862, A134861, A134863, A035338, A134864, resp.
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A000201 as the parent: A000201, A001030, A001468, A001950, A003622, A003842, A003849, A004641, A005614, A014675, A022342, A088462, A096270, A114986, A124841. - N. J. A. Sloane, Mar 11 2021

Programs

  • Haskell
    a003622 n = a003622_list !! (n-1)
    a003622_list = filter ((elem 1) . a035516_row) [1..]
    -- Reinhard Zumkeller, Mar 10 2013
    
  • Maple
    A003622 := proc(n)
        n+floor(n*(1+sqrt(5))/2)-1 ;
    end proc: # R. J. Mathar, Jan 25 2015
    # Maple code for the Wythoff compound sequences, from N. J. A. Sloane, Mar 30 2016
    # The Wythoff compound sequences: Let A = A000201, B = A001950. Then AA = A003622, AB = A003623, BA = A035336, BB = A101864. The eight triples AAA, AAB, ..., BBB are A134859, A134860, A035337, A134862, A134861, A134863, A035338, A134864, resp.
    # Assume files out1, out2 contain lists of the terms in the base sequences A and B from their b-files
    read out1; read out2; b[0]:=b1: b[1]:=b2:
    w2:=(i,j,n)->b[i][b[j][n]];
    w3:=(i,j,k,n)->b[i][b[j][b[k][n]]];
    for i from 0 to 1 do
    lprint("name=",i);
    lprint([seq(b[i][n],n=1..100)]):
    od:
    for i from 0 to 1 do for j from 0 to 1 do
    lprint("name=",i,j);
    lprint([seq(w2(i,j,n),n=1..100)]);
    od: od:
    for i from 0 to 1 do for j from 0 to 1 do for k from 0 to 1 do
    lprint("name=",i,j,k);
    lprint([seq(w3(i,j,k,n),n=1..100)]);
    od: od: od:
  • Mathematica
    With[{c=GoldenRatio^2},Table[Floor[n c]-1,{n,70}]] (* Harvey P. Dale, Jun 11 2011 *)
    Range[70]//Floor[#*GoldenRatio^2]-1& (* Waldemar Puszkarz, Oct 10 2017 *)
  • PARI
    a(n)=floor(n*(sqrt(5)+3)/2)-1
    
  • PARI
    a(n) = (sqrtint(n^2*5)+n*3)\2 - 1; \\ Michel Marcus, Sep 17 2022
    
  • Python
    from sympy import floor
    from mpmath import phi
    def a(n): return floor(n*phi**2) - 1 # Indranil Ghosh, Jun 09 2017
    
  • Python
    from math import isqrt
    def A003622(n): return (n+isqrt(5*n**2)>>1)+n-1 # Chai Wah Wu, Aug 11 2022

Formula

a(n) = floor(n*phi) + n - 1. [Corrected by Jianing Song, Aug 18 2022]
a(n) = floor(floor(n*phi)*phi) = A000201(A000201(n)). [See the Mathematics Stack Exchange link for a proof of the equivalence of the definition. - Jianing Song, Aug 18 2022]
a(n) = 1 + A022342(1 + A022342(n)).
G.f.: 1 - (1-x)*Sum_{n>=1} x^a(n) = 1/1 + x/1 + x^2/1 + x^3/1 + x^5/1 + x^8/1 + ... + x^F(n)/1 + ... (continued fraction where F(n)=n-th Fibonacci number). - Paul D. Hanna, Aug 16 2002
a(n) = A001950(n) - 1. - Philippe Deléham, Apr 30 2004
a(n) = A022342(n) + n. - Philippe Deléham, May 03 2004
a(n) = a(n-1) + 2 + A005614(n-2); also a(n) = a(n-1) + 1 + A001468(n-1). - A.H.M. Smeets, Apr 26 2024

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

A035337 Third column of Wythoff array.

Original entry on oeis.org

3, 11, 16, 24, 32, 37, 45, 50, 58, 66, 71, 79, 87, 92, 100, 105, 113, 121, 126, 134, 139, 147, 155, 160, 168, 176, 181, 189, 194, 202, 210, 215, 223, 231, 236, 244, 249, 257, 265, 270, 278, 283, 291, 299, 304, 312
Offset: 0

Views

Author

Keywords

Comments

Also, positions of 3's in A139764, the smallest term in Zeckendorf representation of n. - John W. Layman, Aug 25 2011
The formula a(n) = 3*A003622(n)-n+1 = 3AA(n)-n+1 conjectured by Layman below is correct, since it is well known that AA(n)+1 = B(n) = A(n)+n, where B = A001950, and so 3AA(n)-n+1 = 3B(n)-n-2 = 3A(n)+2n-2. - Michel Dekking, Aug 31 2017
From Amiram Eldar, Mar 21 2022: (Start)
Numbers k for which the Zeckendorf representation A014417(k) ends with 1, 0, 0.
The asymptotic density of this sequence is 1/phi^4 = 2/(7+3*sqrt(5)), where phi is the golden ratio (A001622). (End)

Crossrefs

Let A = A000201, B = A001950. Then AA = A003622, AB = A003623, BA = A035336, BB = A101864. The eight triples AAA, AAB, ..., BBB are A134859, A134860, A035337, A134862, A134861, A134863, A035338, A134864, resp.

Programs

  • Maple
    t := (1+sqrt(5))/2 ; [ seq(3*floor((n+1)*t)+2*n,n=0..80) ];
  • Mathematica
    Table[3 Floor[n GoldenRatio] + 2 n - 2, {n, 46}] (* Michael De Vlieger, Aug 31 2017 *)
  • PARI
    a(n) = 2*n + 3*floor((1+sqrt(5))*(n+1)/2); \\ Altug Alkan, Sep 18 2017
  • Python
    from sympy import floor
    from mpmath import phi
    def a(n): return 3*floor((n + 1)*phi) + 2*n # Indranil Ghosh, Jun 10 2017
    
  • Python
    from math import isqrt
    def A035337(n): return 3*(n+isqrt(5*n**2)>>1)+(n-1<<1) # Chai Wah Wu, Aug 11 2022
    

Formula

a(n) = F(4)A(n)+F(3)(n-1) = 3A(n)+2n-2, where A = A000201 and F = A000045. - Michel Dekking, Aug 31 2017
It appears that a(n) = 3*A003622(n) - n + 1. - John W. Layman, Aug 25 2011

A035614 Horizontal para-Fibonacci sequence: says which column of Wythoff array (starting column count at 0) contains n+1.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is probably the same as the "Fibonacci ruler function" mentioned by Knuth. - N. J. A. Sloane, Aug 03 2012
From Amiram Eldar, Mar 10 2021: (Start)
a(n) is the number of the trailing zeros in the Zeckendorf representation of (n+1) (A014417).
The asymptotic density of the occurrences of k is 1/phi^(k+2), where phi is the golden ratio (A001622).
The asymptotic mean of this sequence is phi. (End)

References

  • D. E. Knuth, The Art of Computer Programming, Vol. 4A, Section 7.1.3, p. 82, solution to Problem 179.

Crossrefs

Programs

  • Haskell
    a035614 = a122840 . a014417 . (+ 1)  -- Reinhard Zumkeller, Mar 10 2013
    
  • Mathematica
    max = 81; wy = Table[(n-k)*Fibonacci[k] + Fibonacci[k+1]*Floor[ GoldenRatio*(n - k + 1)], {n, 1, max}, {k, 1, n}]; a[n_] := Position[wy, n][[1, 2]]-1; Table[a[n], {n, 1, max}] (* Jean-François Alcover, Nov 02 2011 *)
  • Python
    from sympy import fibonacci
    def a122840(n): return len(str(n)) - len(str(int(str(n)[::-1])))
    def a014417(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 x
    def a(n): return a122840(a014417(n + 1)) # Indranil Ghosh, Jun 09 2017, after Haskell code by Reinhard Zumkeller

Formula

The segment between the first M and the first M+1 is given by the segment before the first M-1.
a(n) = A122840(A014417(n + 1)). - Indranil Ghosh, Jun 09 2017

A348853 Delete any least significant 0's from the Zeckendorf representation of n, leaving its "odd" part.

Original entry on oeis.org

1, 1, 1, 4, 1, 6, 4, 1, 9, 6, 4, 12, 1, 14, 9, 6, 17, 4, 19, 12, 1, 22, 14, 9, 25, 6, 27, 17, 4, 30, 19, 12, 33, 1, 35, 22, 14, 38, 9, 40, 25, 6, 43, 27, 17, 46, 4, 48, 30, 19, 51, 12, 53, 33, 1, 56, 35, 22, 59, 14, 61, 38, 9, 64, 40, 25, 67, 6, 69, 43, 27, 72
Offset: 1

Views

Author

Kevin Ryde, Nov 14 2021

Keywords

Comments

Terms are odd Zeckendorfs A003622 and the fixed points are where n is odd already so that a(n) = n iff n is in A003622.
A139764(n) is the least significant "10..00" part of n so Zeckendorf multiplication n = A101646(a(n), A139764(n)).
The equivalent delete least significant 0's in binary is A000265 so that conversion to Fibbinary (A003714) and back gives a(n) = A022290(A000265(A003714(n))).
a(n) = 1 iff n is a Fibonacci number >= 1 (A000045) since they are Zeckendorf 100..00.
a(n) = 4 iff n is a Lucas number >= 4 (A000032) since they are Zeckendorf 10100..00 which reduces to 101.
In the Wythoff array A035513, a(n) is the term in column 0 of the row containing n, and hence the formula below using row number A019586 to select which of the odds (column 0) is a(n).

Examples

			n    = 81 = Zeckendorf 101001000.
a(n) = 19 = Zeckendorf 101001.
		

Crossrefs

Cf. A189920 (Zeckendorf digits), A003622 (odds), A003849 (final digit), A005206, A319433 (shift down).
Cf. A000045 (Fibonacci), A000032 (Lucas).
Cf. A035513 (Wythoff array), A019586 (row number).
Cf. A003714 (Fibbinary), A022290 (its inverse).
In other bases: A000265 (binary), A004151 (decimal).

Programs

  • PARI
    my(phi=quadgen(5)); a(n) = my(q,r); while([q,r]=divrem(n+2,phi); r<1, n=q-1); n;

Formula

a(n) = n if A003849(n)=1, otherwise a(n) = a(A005206(n)) = a(A319433(n)).
a(n) = A003622(A019586(n) + 1).
Sum_{k=1..n} a(k) ~ n^2/(2*phi), where phi is the golden ratio (A001622). - Amiram Eldar, Feb 17 2024

A138182 Smallest summand in the Zeckendorf representation of the n-th prime.

Original entry on oeis.org

2, 3, 5, 2, 3, 13, 1, 1, 2, 8, 2, 3, 2, 1, 13, 1, 1, 1, 1, 3, 5, 3, 2, 89, 8, 1, 1, 5, 2, 3, 1, 8, 1, 3, 5, 2, 13, 1, 2, 8, 1, 3, 13, 2, 1, 55, 1, 3, 2, 1, 233, 1, 8, 5, 3, 1, 2, 1, 2, 1, 3, 5, 1, 2, 1, 8, 1, 2, 1, 1, 2, 3, 3, 1, 2, 1, 1, 2, 3, 3, 8, 2, 2, 1, 2, 3, 1, 1, 8, 2, 1, 13, 21, 1, 1, 3, 1, 144, 2, 2
Offset: 1

Views

Author

Colm Mulcahy, Mar 04 2008

Keywords

Examples

			a(5) = 3 because the Zeckendorf representation of the 5th prime is 11 = 3 + 8.
		

Crossrefs

Programs

  • Python
    from sympy import prime
    def A138182(n):
        m, tlist = prime(n), [1,2]
        while tlist[-1]+tlist[-2] <= m:
            tlist.append(tlist[-1]+tlist[-2])
        for d in tlist[::-1]:
            if d == m:
                return d
            elif d < m:
                m -= d # Chai Wah Wu, Jun 14 2018

Formula

a(n) = A139764(A000040(n)). [From R. J. Mathar, Oct 23 2010]

Extensions

a(8) replaced by 1. Sequence extended beyond a(18) - R. J. Mathar, Oct 23 2010

A361755 Irregular triangle T(n, k), n >= 0, k = 1..2^A007895(n), read by rows; the n-th row lists the numbers k such that the Fibonacci numbers that appear in the Zeckendorf representation of k also appear in that of n.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 3, 0, 1, 3, 4, 0, 5, 0, 1, 5, 6, 0, 2, 5, 7, 0, 8, 0, 1, 8, 9, 0, 2, 8, 10, 0, 3, 8, 11, 0, 1, 3, 4, 8, 9, 11, 12, 0, 13, 0, 1, 13, 14, 0, 2, 13, 15, 0, 3, 13, 16, 0, 1, 3, 4, 13, 14, 16, 17, 0, 5, 13, 18, 0, 1, 5, 6, 13, 14, 18, 19, 0, 2, 5, 7, 13, 15, 18, 20
Offset: 0

Views

Author

Rémy Sigrist, Mar 23 2023

Keywords

Comments

In other words, the n-th row lists the numbers k such that A003714(n) AND A003714(k) = A003714(k) (where AND denotes the bitwise AND operator).
The Zeckendorf representation is also known as the greedy Fibonacci representation (see A356771 for further details).

Examples

			Triangle T(n, k) begins:
  n   n-th row
  --  ------------------------
   0  0
   1  0, 1
   2  0, 2
   3  0, 3
   4  0, 1, 3, 4
   5  0, 5
   6  0, 1, 5, 6
   7  0, 2, 5, 7
   8  0, 8
   9  0, 1, 8, 9
  10  0, 2, 8, 10
  11  0, 3, 8, 11
  12  0, 1, 3, 4, 8, 9, 11, 12
		

Crossrefs

See A361756 for a similar sequence.

Programs

  • PARI
    See Links section.

Formula

T(n, 1) = 0.
T(n, 2) = A139764(n) for any n > 0.
T(n, 2^A007895(n)) = n.

A275392 Smallest term in the tribonacci Zeckendorf representation of n.

Original entry on oeis.org

1, 2, 1, 4, 1, 2, 7, 1, 2, 1, 4, 1, 13, 1, 2, 1, 4, 1, 2, 7, 1, 2, 1, 24, 1, 2, 1, 4, 1, 2, 7, 1, 2, 1, 4, 1, 13, 1, 2, 1, 4, 1, 2, 44, 1, 2, 1, 4, 1, 2, 7, 1, 2, 1, 4, 1, 13, 1, 2, 1, 4, 1, 2, 7, 1, 2, 1, 24, 1, 2, 1, 4, 1, 2, 7, 1, 2, 1, 4, 1, 81, 1, 2, 1, 4, 1, 2, 7, 1, 2, 1, 4, 1, 13, 1, 2, 1, 4, 1, 2, 7, 1, 2, 1
Offset: 1

Views

Author

Aresh Pourkavoos, Jul 26 2016

Keywords

Examples

			The tribonacci Zeckendorf representation of 5 is 4+1 (4 and 1 are both tribonacci numbers), the smaller term of which is 1, so a(5)=1.
		

Crossrefs

Programs

  • Python
    tribonacci = [0, 0, 1]
    seq = []
    numTerms = 100
    while tribonacci[-1] < numTerms:
      tribonacci.append(tribonacci[-1]+tribonacci[-2]+tribonacci[-3])
    tribonacci = tribonacci[3:]
    tribonacci.reverse()
    for n in range(1, numTerms):
      tmp = n
      smallestTerm = 0
      for place in tribonacci:
        if tmp >= place:
          tmp -= place
          smallestTerm = place
      seq.append(str(n)+" "+str(smallestTerm))
    print('\n'.join(seq))

Formula

a(n) = n if n is in A000073.

A356399 a(n) is the smallest term (in absolute value) in the negaFibonacci representation of n.

Original entry on oeis.org

1, 2, 1, -1, 5, 1, 2, 1, -1, -3, 1, -1, 13, 1, 2, 1, -1, 5, 1, 2, 1, -1, -3, 1, -1, -8, 1, 2, 1, -1, -3, 1, -1, 34, 1, 2, 1, -1, 5, 1, 2, 1, -1, -3, 1, -1, 13, 1, 2, 1, -1, 5, 1, 2, 1, -1, -3, 1, -1, -8, 1, 2, 1, -1, -3, 1, -1, -21, 1, 2, 1, -1, 5, 1, 2, 1, -1
Offset: 1

Views

Author

Rémy Sigrist, Aug 06 2022

Keywords

Comments

See A139764 and A356400 for similar sequences.
For n > 1, the greatest term in the negaFibonacci representation of n is A280511(n-1).

Examples

			For n = 11:
- using F(-k) = A039834(k):
- 11 = F(-1) + F(-4) + F(-7),
- so a(11) = F(-1) = 1.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=0, neg=0, pos=0, f); for (e=0, oo, f=fibonacci(-1-e); if (f<0, neg+=f, pos+=f); if (neg <=n && n <= pos, while (n, if (f<0, neg-=f, pos-=f); if (neg > n || n > pos, v=f; n-=f;); f=fibonacci(-1-e--);); return (v););); }

Formula

a(n) = n iff n belongs to A001519.

A356400 a(n) is the smallest term (in absolute value) in the negaFibonacci representation of -n.

Original entry on oeis.org

-1, 1, -3, -1, 1, 2, 1, -8, -1, 1, -3, -1, 1, 2, 1, 5, -1, 1, 2, 1, -21, -1, 1, -3, -1, 1, 2, 1, -8, -1, 1, -3, -1, 1, 2, 1, 5, -1, 1, 2, 1, 13, -1, 1, -3, -1, 1, 2, 1, 5, -1, 1, 2, 1, -55, -1, 1, -3, -1, 1, 2, 1, -8, -1, 1, -3, -1, 1, 2, 1, 5, -1, 1, 2, 1
Offset: 1

Views

Author

Rémy Sigrist, Aug 06 2022

Keywords

Comments

See A139764 and A356399 for similar sequences.

Examples

			For n = 11:
- using F(-k) = A039834(k):
- -11 = F(-4) + F(-6),
- so a(11) = F(-4) = -3.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=0, neg=0, pos=0, f); n=-n; for (e=0, oo, f=fibonacci(-1-e); if (f<0, neg+=f, pos+=f); if (neg <=n && n <= pos, while (n, if (f<0, neg-=f, pos-=f); if (neg > n || n > pos, v=f; n-=f;); f=fibonacci(-1-e--);); return (v););); }

Formula

a(n) = -n iff n belongs to A001906.
Showing 1-10 of 10 results.