algorithmuscanorj

Comment demo

Jan 4th, 2013
675
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  
  3. Demonstrative program about the reliability of the comment made by R. J. Cano at the entry A198960 on Jan 2012.
  4.  
  5. Instructions:
  6. =============
  7.  
  8. 1) Donwload b198960.txt
  9.  
  10. 2) Delete the offset column. For example in Unix/Linux systems with GNU file utils available try: user@host$ cut -d' ' -f2 b198960.txt > w.txt
  11.  
  12. 3) Run this PARI/GP script. You never should be in the output the banner "The statement about a198960 is wrong!!". (Please first ensure to have allocated enough memory)
  13.  
  14. */
  15.  
  16. default(echo,1);
  17. w=readvec("w");
  18. v=vector(#w-1,k,w[k+1]); \\ Delete the first term a(1)=2;
  19. u=vector(#v,k,(v[k]-26)/6); \\ Convert into "y" parameter of (6*y+26 == 3*9^n-1) each case;
  20. s=vector(#u-1,k,u[k+1]-u[k]); \\ Take the first differences;
  21. print("Thirty-six is: ",s[1]); \\ Consistency checking;
  22. r=vector(#s-1,k,s[k+1]/s[k]); \\ Compute the ratios between each pair of terms.
  23. r/=9; \\ PARI/GP does it like a human.
  24. if(#r==sum(j=1,#r,r[j]),print("Test approved for the given b-file."),print("The statement about a198960 is wrong!!"));
  25. quit();
RAW Paste Data