\(\Rightarrow\left(a^{101}+b^{101}\right)^2=\left(a^{100}+b^{100}\right)\left(a^{102}+b^{102}\right)\)
\(\Rightarrow a^{202}+b^{202}+2a^{101}b^{101}=a^{202}+b^{202}+a^{100}b^{102}+a^{102}b^{100}\)
\(\Rightarrow2ab\left(ab\right)^{100}=\left(ab\right)^{100}\left(a^2+b^2\right)\)
\(\Rightarrow a^2+b^2=2ab\Leftrightarrow\left(a-b\right)^2=0\Rightarrow a=b\)
\(\Rightarrow2a^{100}=2a^{101}=2a^{102}\)
\(\Rightarrow a=1\Rightarrow b=1\)
\(\Rightarrow P=2\)