- #1
- 36
- 0
How can I get a general function that represents a series of 1 and 0, for example :
1,0,1,0,1,0,1,0...; but also
1,1,0,1,1,0,1,1,0...;
1,1,1,0,1,1,1,0,1... and so on; the first one is not difficult: a = n mod 2; where a=1 or 0; n=1,2,3...
but if n=1 than a=2 (for the first one), and 2 is not solution
That s one of the other difficulties in that problem.
So I just need a general function for an x number of 1 (1,1,1,1...1,0,1,1,1,1,...0...). Always after a certain period of number 1 comes 0
The function must be valuable for all n; as you can see in my example when I put n=1, a=2, and that isn t solution
1,0,1,0,1,0,1,0...; but also
1,1,0,1,1,0,1,1,0...;
1,1,1,0,1,1,1,0,1... and so on; the first one is not difficult: a = n mod 2; where a=1 or 0; n=1,2,3...
but if n=1 than a=2 (for the first one), and 2 is not solution
That s one of the other difficulties in that problem.
So I just need a general function for an x number of 1 (1,1,1,1...1,0,1,1,1,1,...0...). Always after a certain period of number 1 comes 0
The function must be valuable for all n; as you can see in my example when I put n=1, a=2, and that isn t solution