Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include <cmath>
- using namespace std;
- int zn(int x){
- x=abs(x);
- x+=4;
- x=x/5;
- x=(int)(pow(2.0,x+0.0))%2;
- return x;
- }
- int main(){
- int n,b;
- double x;
- cin>>b;
- b-=1;
- x=1;
- n=2;
- while(n<b){
- n++;
- int k=(int)(x*(1+sqrt(5))/2);
- x=k+zn(n%3)*(k%2)+(1-zn(n%3))*zn(k%2);
- cout<<(int)(x)<<endl;
- }
- x-=zn(b);
- cout<<x;
- return 0;
- }
Add Comment
Please, Sign In to add comment