I try to find a balanced exercise on it with Desmos.
It seems we have:
$$\sum_{n=1}^{\infty}\frac{\gcd\left(1+n!,1+n^{2}\right)}{n!}\overset?=e$$
It seems non trivial as you can remark in replacing the square by a cube.
At first glance we can think it's problem with hidden rearrrangement theorem. Keeping in mind that I try the Riemann theorem on sequence and rearrangemnt without success. I keep in mind also the Wilson's theorem but cannot progress.
Notice I check the result with Wolfram Alpha.
How to (dis)prove it?
Thanks in advance for the help.
Side notes :
It's a strange idea but why calculus couldn't be here I mean ,and I think it's stupid but let's try that :
$$\gcd\left(\operatorname{floor}\left(\sqrt{2\pi n}\left(\frac{n}{e}\right)^{n}\right)+1,n^{2}+1\right)=^?1,n\in N^+$$
I think it's not very useful but why not ? I think that because it's really not the same problem but as Leibniz said knowledge is like path between some islands...
Ps: It's the floor function .
As second notes see also Bounds on the difference between the polylogarithm with negative base and the gamma function
Edit 04/02/2023
There is also where $x$ is a prime : $$\gcd(x!-x^x,1+x^2)=1$$
Then I was thinking to Green-Tao theorem but nothing consistent at all.
Edit 01/11/2023 :
We can represent (I suggest to show it) that :
$\exists a,r,n,m,u>0$ such that :
$$n!+1=\lfloor(1-a^r)^{-m}\rfloor=P$$
And :
$$n^2+1=\lfloor(1-a^r)^{-u}\rfloor=Q$$
Then it seems we have if $a$ is irrational and $P,Q$ have the prime factorization :
$$P=\prod_{i=1}^{v}p^{b_i}_{a_i},Q=\prod_{i=1}^{N}p^{c_i}_{d_i}$$
If so $\exists a_k,b_k,c_k,d_k$ such that $p^{b_k}_{a_k}$ is not in the prime factorization of $Q$ and vice versa .
A simple progress :
If $p$ is a prime having as last digit a $9$ and let $(p-1)^2+1=M$ then if $M$ have $9$ representation as sum of two square and $M^2$ have $4$ pythagorean triples then the conclusion follows and the conjecture is true .To understand that try an example like $p=269$
it seems also $p=883$ works too $25<882,37<882,29×29<882$ .Build it is rather easily .
Remark see https://publications.ias.edu/deligne/paper/357 and Can we invert these analogous "Dirichlet" series for GCD / LCM convolution?
Some works :
If $n,n+2$ is a twin pairs then :
$$4(n-1)!+4+n=0\operatorname{mod}(n(n+2))$$
Or $\exists k$ such that :
$$4(n-1)!+4+n=kn(n+2)$$
Or :
$$4(n-1)!+4=kn^2+(2k-1)n$$
It's divisible by four next we compare with :
$$kn^2+(2k-1)n=4q((n-1)^2+1)$$
Or :
$$(k-4q)n^2+(2k-1+8q)n-8q=0$$
If the discriminant is not a perfect square then the roots are irrational and so there is no solution in $q$:
$$2(10k^2-6k+1)$$
Is never a perfect square using $k$ is odd and (optional) the Hasse-Minkowski theorem so it's true that $\gcd((n-1)!+1,(n-1)^2+1)=1$ when $n,n+2$ are prime numbers if $10k^2-6k+1,(n-1)^2+1$ have no common prime factor .
We can enlarge with $$f\left(x,y\right)=\gcd\left(\left(10\cdot\left(2\operatorname{floor}\left(x\right)+1\right)^{2}-6\left(2\operatorname{floor}\left(x\right)+1\right)+1\right),\left(\operatorname{floor}\left(y\right)\right)^{2}+1\right)$$ Let introduce :
$$f\left(x,y\right)=\gcd\left(10\left(2x+1\right)^{2}-6\left(2x+1\right)+1,y^2+1\right)$$
Conjecture :
Let $n>1$ be a natural number then :
$$f(n^3,n)=1$$ Or : $$f(n^3,n)=\prod_{i=1}^{m}p_{a_i}$$
Where $p_{a_j}$ is a prime number here distinct
As a factorial cannot be a perfect power greater than one we delete some cases
I know that if $n-1$ finishes with a $8$ then $(n-1)^2+1$ divisible by $5$ and primes then I cannot go further
One example :
It's known that it can be write as a sum of square and squared as a sum of square too. The prime factorization of the number in the sum of square is not in $(n-1)^2+1$ but could be in $(n-1)!+1$ as the example $n=29$
To be continued.
In formalism it gives (all the unknow are positive integers and here $p,p+2$ are twin primes):
Theorem 1 :
Using Wilson's theorem for a prime $p$ Then $p$ is the smallest prime divisor of $(p-1)!+1$ if $p-1$ ends with a $8$ .
Theorem 2 :
If $p-1$ have as last digit $8$ then $(p-1)^2+1=P$ is divisible by $5$ .Then if $P=a^2+b^2,P^2=c^2+d^2$ then the integer factors in the prime decomposition of $a,b,c,d$ are not in the prime decomposition of $P$. Finally one of $a,b,c,d$ share a prime with $(p-1)!+1=K$ .This prime is the smallest divisor excepting $1$ of $K$.
Theorem 3 with condition of theorem 2 :
Recalling theorem 1 ,$p$ is the smallest divisor excepting $1$ of $K$. The smallest prime divisor of $K$ greater than $p$ is greater than the greater divisor of $P$ which is a prime number as divisor, if $P^2$ have $4$ representation as sum of two square .
Some materials for a proof :
Let says with the conditions of theorem 1,2,3 on $K$ and let $K$ have $C_p$ prime factor distinct then it seems we have :
$$C_p<\ln\left(\left(p-\frac{3}{2}\right)\ln\left(p\right)-p-1+\frac{1}{2}\ln\left(2\pi\right)\right)+\frac{1}{\sqrt{p}}$$
Using Ramanujan-Hardy theorem and Binet's formula .
For $P$ which have $T_p$ prime factor distinct it seems we have for $p$ sufficiently large :
$$T_p<\ln\left(\ln\left(\left(p-1\right)^{2}+1\right)\right)+\frac{1}{2}\sqrt{\ln\left(\ln\left(\left(p-1\right)^{2}+1\right)\right)}$$
Reference :

for(k=1,50,for(i=2,400,if(gcd(1+i!,1+i^(2*k))>1,print(i," ",gcd(1+i!,1+i^(2*k))," ",k)))). – TheSimpliFire Nov 24 '22 at 22:31$$P=25×(4k+1)^2(4k'+1)$$
Where $4k+1,4k'+1$ are primes numbers $k<k'$ can be write as one sum of two square and one time as hypotenuse of a Pythagorean triples .
Check If the number $P$ have 9 representations as sum of square and $4$ as hypotenuse of a primitive Pythagorean triples .
Now check If $\sqrt{P-1}=A$ Where $A$ is a positive integer
If not come back to 1)
To see beyond the million
– Barackouda Apr 29 '24 at 18:44