cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A350590 Prime numbers p such that iterating the map m -> m^2 + 1 on p generates a number ending with p.

This page as a plain text file.
%I A350590 #11 Feb 18 2022 23:07:33
%S A350590 2,5,7,677,948901,55904677,88948901,
%T A350590 36414201356422028396069993813455904677,
%U A350590 8964456980291877636414201356422028396069993813455904677,711873588184178964456980291877636414201356422028396069993813455904677
%N A350590 Prime numbers p such that iterating the map m -> m^2 + 1 on p generates a number ending with p.
%C A350590 Primes in A350130. All terms, except the first two terms, end with either 1 or 7.
%C A350590 It takes six iterations for a term in the sequence to generate a number ending with the term itself.
%C A350590 If two terms, a(i) and a(j) with i < j, share the same last digit of 1 or 7, then a(j) ends with a(i). For example, a(5)=948901, a(7)=88948901, and a(11)=8941500847661758065828477233177642295842210081239701539110201588948901. a(11) ends with a(7), which ends with a(5).
%e A350590 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.
%o A350590 (Python)
%o A350590 from sympy import isprime; R = []
%o A350590 for i in range(1, 100):
%o A350590     m = 1; L = [m]; m = (m*m+1)%10**i
%o A350590     while m not in L: L.append(m); m = (m*m+1)%10**i
%o A350590     del L[:L.index(m)]; {R.append(j) for j in L if isprime(j) and j not in R}
%o A350590 R.sort(); print(*R, sep = ", ")
%Y A350590 Cf. A002522, A066872, A349786, A350130.
%K A350590 nonn,base
%O A350590 1,1
%A A350590 _Ya-Ping Lu_, Jan 07 2022