A Fi-binary number is a number that contains only 0 and 1. It does not contain any leading 0. And also it does not contain 2 consecutive 1. The first few such number are 1, 10, 100, 101, 1000, 1001, 1010, 10000, 10001, 10010, 10100, 10101 and so on. I have n. How to calculate the nth Fi-binary number ?


closed as off-topic by user230715, Claude Leibovici, kjetil b halvorsen, drhab, Did Aug 20 '15 at 9:59

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Community, Claude Leibovici, kjetil b halvorsen, drhab, Did
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 5
    $\begingroup$ Actually, I don't have to calculate the $n$th FiBinary number, you do. So, what steps have you taken to do so? $\endgroup$ – Gerry Myerson Aug 20 '15 at 7:15
  • $\begingroup$ My question is , How to calculate nth Fi-binary number ? n can be 10^9, so what sill be the 10^9th Fi-binary number ? $\endgroup$ – M S Hossain Aug 20 '15 at 7:19
  • $\begingroup$ I know what your question is. My question remains: what steps have you taken toward answering your question? $\endgroup$ – Gerry Myerson Aug 20 '15 at 7:21
  • $\begingroup$ I attempt a naive step , check the number one by one, it is Fi-binary or not? if it is , take the number in the queue of Fi-binary number. if queue size is n then the last value of queue is answer. but it should be optimized . It has a pattern to calculate , I think . I am asking for this pattern. $\endgroup$ – M S Hossain Aug 20 '15 at 7:28
  • $\begingroup$ The question is interesting. Describe your efforts within the question, and show your attempts towards reaching a solution on your own. Thus, you will increase your chances of being taken more seriously, and perhaps even getting some proper answers to your question. $\endgroup$ – barak manos Aug 20 '15 at 7:51

Hint: Let $F_k$ denote the $k$-th Fibonacci number; i.e., $F_0=0$, $F_1=1$, and $F_k=F_{k-1}+F_{k-2}$ for all integers $k\geq 2$. Every positive integer $n$ can uniquely be written as a sum of nonconsecutive pairwise distinct Fibonacci numbers $F_k$'s with $k\geq 2$. If $n=\sum_{j=1}^m\,F_{k_j}$ is such a representation, then the $n$-th Fi-binary number is $\sum_{j=1}^m\,10^{k_j-2}$. If you are talking about the base-$2$ representation, then replace $10$ by $2$.

  • $\begingroup$ but how the idea about the final result come ? explain please @Batominovski $\endgroup$ – M S Hossain Aug 20 '15 at 8:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.