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.
%I A089120 #28 Sep 08 2022 08:45:12 %S A089120 2,5,2,17,2,37,2,5,2,101,2,5,2,197,2,257,2,5,2,401,2,5,2,577,2,677,2, %T A089120 5,2,17,2,5,2,13,2,1297,2,5,2,1601,2,5,2,13,2,29,2,5,2,41,2,5,2,2917, %U A089120 2,3137,2,5,2,13,2,5,2,17,2,4357,2,5,2,13,2,5,2,5477,2,53,2,5,2,37,2,5,2 %N A089120 Smallest prime factor of n^2 + 1. %C A089120 This includes A002496, primes that are of the form n^2+1. %C A089120 Note that a(n) is the smallest prime p such that n^(p+1) == -1 (mod p). - _Thomas Ordowski_, Nov 08 2019 %D A089120 H. Rademacher, Lectures on Elementary Number Theory, pp. 33-38. %H A089120 Michael De Vlieger, <a href="/A089120/b089120.txt">Table of n, a(n) for n = 1..10000</a> %F A089120 a(2k+1)=2; a(10k +/- 2)=5, else a(26k +/- 8)=13, else a(34k +/- 4)=17, else a(58k +/- 12)=29, else a(74k +/- 6)=37,... - _M. F. Hasler_, Mar 11 2012 %F A089120 A089120(n) = 2 if n is odd, else A089120(n) = min { A002144(k) | n = +/- A209874(k) (mod 2*A002144(k)) }. %t A089120 Array[FactorInteger[#^2 + 1][[1, 1]] &, {83}] (* _Michael De Vlieger_, Sep 08 2015 *) %o A089120 (PARI) smallasqp1(m) = { for(a=1,m, y=a^2 + 1; f = factor(y); v = component(f,1); v1 = v[length(v)]; print1(v[1]",") ) } %o A089120 (PARI) A089120(n)=factor(n^2+1)[1,1] \\ _M. F. Hasler_, Mar 11 2012 %o A089120 (Magma) [Min(PrimeDivisors(n^2+1)):n in [1..100]]; // _Marius A. Burtea_, Nov 13 2019 %Y A089120 Cf. A002496, A014442, A085722, A144255, A193432. %K A089120 easy,nonn %O A089120 1,1 %A A089120 _Cino Hilliard_, Dec 05 2003