Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. for (unsigned long long int i = 2; i<=100000000;i++){
  2. if (i%2==0) {
  3. x[i] =(3*x[i/2] + 2*x[(unsigned long long int)(i/4)])&1152921504606846975;
  4. }
  5. else{
  6. x[i] =(2*x[(i-1)/2] + 3*x[(unsigned long long int)((i-1)/4)])&1152921504606846975;
  7. }
  8.  
  9. }//these code for listing
  10. unsigned long long int xtrans(unsigned long long int k){
  11. if (k<=100000000)return x[k];
  12. unsigned long long int result;
  13. if (k%2==0) {
  14. result =(3*xtrans(k/2) + 2*xtrans((unsigned long long int)(k/4)))&1152921504606846975;
  15. }
  16. else{
  17. result =(2*xtrans((k-1)/2) + 3*xtrans((unsigned long long int)((k-1)/4)))&1152921504606846975;
  18. }
  19. return result;
  20. }//These code for calculating x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement