World!Of
Numbers

WON plate
|

[ December 8, 2021 ]
Record palindromic substrings in the decimal expansion
of various types of numbers
Patrick De Geest

Here I collect ever larger palindromic substrings
(named palsubs from now on) of various types of numbers
like Fibonacci numbers, factorial numbers and integer powers
just to start with.

At the end I will publish my Pari/gp code.
Feel free to use it, to amend it, whatever you like
or use your own program written in another language.

Maybe you will become a record breaker and get
your newly found results published in the table as well.

Palindromic substrings in FibonacciSublengthPosition/Length
Fib(1040)...{ 28614841682 }...11174/217

Palindromic substrings in factorialsSublengthPosition/Length
148!...{ 117929711 }...9178/259

Palindromic substrings in powers A^BSublengthPosition/Length
2^468...{ 1218558121 }...10106/141
2^517...{ 6079339706 }...1036/156



\\========================================================================
\\ 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
please activate the 'break(2)' by removing the backslashes.
Otherwise with large numbers it can take a long time for the program
to scan down to the last twodigit substring.


A000212 Prime Curios! Prime Puzzle
Wikipedia 212 Le nombre 212














[ TOP OF PAGE]


( © All rights reserved )

Patrick De Geest - Belgium - Short Bio - Some Pictures
E-mail address : pdg@worldofnumbers.com