/* Demonstrative PARI/GP program about some structural properties of the A217626 sequence. Usage instructions: 1) Download and decompress (format Gzip), the following file: http://www.oeis.org/w/images/d/d7/B-file_woOffset.txt.gz 2) Place together both files (the data file and this program) in the same directory of your choice. 3) Before running ensure that the usual favorable conditions are present in your system. (file/execution permissions, the GP interpreter works properly, ...) 4) Run the program. */ print("PARI/GP: Setting up execution environment (Assuming: Intel Atom 1.66Ghz, 32-Bit 1GB RAM.)"); default(parisize,11!*25); /*-------------- Atomic code stub -------------------*/ Omega=10; \\ Defined according the data. It meas (10!/2) terms of A217626 stored in the data file to be uploaded. unit=vector(Omega); y=[9,2,9]; count929(Q)={unit[Q]=1;z=0+(Q==3);for(s=3,Q!/2,e=1;for(k=0,2,e*=(y[3-k]==x[s-k]));if(e,z++);if(x[s]==1,unit[Q]++));if(Q>=3,unit[Q]*=2);(if(Q>3,2,1)*z)}; /*-----------------------------Dont split it! ------------*/ antifac(n)={ans=0;while((ans+1)!<= n, ans++);ans}; print("Loading data..."); x=readvec("B-file_woOffset.txt"); print("Counting \"{1}929{1}\" Please wait..."); z=vector(Omega,w,count929(w)); tab=" "; print(" "); print(" #terms in Counts:"); print(" data file",tab,tab,"{1}929{1} unit(total) unit(NOT belonging to such palindromic)"); for(u=2,Omega,print(tab,u,"!-1",tab,tab,antifac(z[u]),"!",tab,antifac(unit[u]),"!",tab,tab,2*(u==2)+(u-3)*(u-2)!,if(u>=7,"= 20*"," "),if(u>=7,((u-3)*(u-2)!)/20," "))); print(" "); print(" Notice from the table that every multiple of (N-2)! is 0 (mod 20) for N equal or greater than 7."); print(" "); print(" Upon being true as consequence of the identity: (N-2)!=5!*prod_{k=1..N-7}(5+k) when N>=7..."); print(" "); print(" Such fact doesn't come randomly. It is strongly related to a combinatorial-periodic pattern recently"); print(" identified while studying A218976, when the 5-adic valuation of \"y\" -any given positive integer-"); print(" was replaced with the overestimation: f(y)=floor(y/20)+floor(y/5)"); print(" "); quit;