login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A215022 NegaFibonacci representation code for n. 7
0, 1, 100, 101, 10010, 10000, 10001, 10100, 10101, 1001010, 1001000, 1001001, 1000010, 1000000, 1000001, 1000100, 1010010, 1010010, 1010000, 1010001, 1010100, 1010101, 100101010, 100101000, 100101001, 100100010, 100100000, 100100001, 100100100, 100100101 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

Let F_{-n} be the negative Fibonacci numbers (as defined in the first comment in A039834): F_{-1}=1, F_{-2}=-1, F_{-3}=2, F_{-4}=-3, F_{-5}=5, ..., F_{-n}=(-1)^(n-1)F_n.

Every integer has a unique representation as n = Sum_{k=1..r} c_k F_{-k} for some r, where the c_k are 0 or 1 and no two adjacent c's are 1.

Then a(n) is the concatenation c_r ... c_3 c_2 c_1.

REFERENCES

D. E. Knuth, The Art of Computer Programming, Vol. 4A, Section 7.1.3, p. 169.

LINKS

Charles R Greathouse IV, Table of n, a(n) for n = 0..1000

EXAMPLE

4 = 5 - 1 = F_{-5} + F_{-2}, so a(4) = 10010.

PROG

(PARI) a(n)=if(n<2, return(n)); my(s=1, k=1, v); while(s<n, s+=fibonacci(k+=2)); v=binary(2^k/2); n-=fibonacci(k); forstep(i=k-2, 1, -1, if(abs(n-fibonacci(-i))<abs(n), n-=fibonacci(-i); v[#v+1-i]=1; i--)); subst(Pol(v), x, 10) \\ Charles R Greathouse IV, Aug 03 2012

CROSSREFS

Cf. A039834, A215023, A215024, A000045, A014417, A003714.

Sequence in context: A085251 A178530 A063010 * A094027 A281149 A204582

Adjacent sequences:  A215019 A215020 A215021 * A215023 A215024 A215025

KEYWORD

nonn,base

AUTHOR

N. J. A. Sloane, Aug 03 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 20 09:00 EST 2018. Contains 299384 sequences. (Running on oeis4.)