A350590 Prime numbers p such that iterating the map m -> m^2 + 1 on p generates a number ending with p.
2, 5, 7, 677, 948901, 55904677, 88948901, 36414201356422028396069993813455904677, 8964456980291877636414201356422028396069993813455904677, 711873588184178964456980291877636414201356422028396069993813455904677
Offset: 1
Examples
2 is a term because 2 is a prime and iterating the map on 2 gives: 2 -> 5 -> 26 -> 677 -> 458330 -> 210066388901 -> 44127887745906175987802, which ends with 2.
Programs
-
Python
from sympy import isprime; R = [] for i in range(1, 100): m = 1; L = [m]; m = (m*m+1)%10**i while m not in L: L.append(m); m = (m*m+1)%10**i del L[:L.index(m)]; {R.append(j) for j in L if isprime(j) and j not in R} R.sort(); print(*R, sep = ", ")
Comments