Advertisement
lavalamp

Euler 206

Oct 23rd, 2014
3,156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.  
  3. n = 1010101030;
  4. n2 = n*n;
  5.  
  6. while(n<1389026571,
  7.    
  8.     d=digits(n2);
  9.     if(d[3]==2 && d[5]==3 && d[7]==4 && d[9]==5 && d[11]==6 && d[13]==7 && d[15]==8 && d[17]==9 && d[19]==0,break);
  10.    
  11.     n+=40;
  12.     n2+=80*n-1600;
  13.    
  14.     d=digits(n2);
  15.     if(d[3]==2 && d[5]==3 && d[7]==4 && d[9]==5 && d[11]==6 && d[13]==7 && d[15]==8 && d[17]==9 && d[19]==0,break);
  16.    
  17.     n+=60;
  18.     n2+=120*n-3600;
  19.    
  20. );
  21.  
  22. print(n,", ",n2);
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement