World!Of Numbers |
|||||||||||||||||||||||||||||||
[ December 8, 2021 ] Here I collect ever larger palindromic substrings At the end I will publish my Pari/gp code. Maybe you will become a record breaker and get
\\======================================================================== \\ Search for Palindromic SUBSTRINGS - Patrick De Geest - Pari/GP - Version [2, 11, 4] - 8/12/2021 \\======================================================================== \p100; f=1040; inp=fibonacci(f); inpd=digits(inp); linp=#(inpd); spp=linp; { print(); cnt=0; for(i=1,spp-1, for(n=1,linp-spp+1, extract=fromdigits(inpd[n..spp+n-1]); if(inpd[n]!=[0], print1(extract); d=digits(extract); lext=#(d); if(d==Vecrev(d) && (extract>9), cnt+=1; prf=isprime(extract); if(prf==1, color="\e[38;5;93m",color=""); print(" is palindromic ! "color"fib="f"\e[38;5;37m linp=["linp"] lext=[\e[38;5;92m"lext"\e[38;5;37m] at=["n"]"); lenpp1=#(inpd[1..n-1]); lenpp2=#(inpd[n..spp+n-1]); lenpp3=#(inpd[spp+n..linp]); pp3=fromdigits(inpd[spp+n..linp]); if(lenpp1!=0, pp1=fromdigits(inpd[1..n-1]); print1(pp1) ); pp2=fromdigits(inpd[n..spp+n-1]); print1("\e[38;5;92m"pp2"\e[38;5;37m"); cntzero=lenpp3-#(digits(pp3)); if(cntzero, for(k=1,cntzero, print1("0");) ); if(lenpp3!=0, print(pp3)); \\ break(2); z=1;while(z<20000000, z++); , print(); ); ); ); print(); spp-=1; ); det=0; for(k=1,linp-1, if(inpd[k]==0 && inpd[k+1]==0, det+=1);); if(cnt==0 && det, print("Fib("f") "inp" Strings of zero's detected!")); if(cnt==0 && det==0, print("Fib("f") "inp" is palfree !")); } If you are interested only in the 'first' palindromic substring | |||||||||||||||||||||||||||||||
A000212 Prime Curios! Prime Puzzle Wikipedia 212 Le nombre 212 |
[ TOP OF PAGE]