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.

A125256 Smallest odd prime divisor of n^2 + 1.

This page as a plain text file.
%I A125256 #43 Dec 17 2024 00:50:23
%S A125256 5,5,17,13,37,5,5,41,101,61,5,5,197,113,257,5,5,181,401,13,5,5,577,
%T A125256 313,677,5,5,421,17,13,5,5,13,613,1297,5,5,761,1601,29,5,5,13,1013,29,
%U A125256 5,5,1201,41,1301,5,5,2917,17,3137,5,5,1741,13,1861,5,5,17,2113,4357,5,5
%N A125256 Smallest odd prime divisor of n^2 + 1.
%C A125256 Any odd prime divisor of n^2+1 is congruent to 1 modulo 4.
%C A125256 n^2+1 is never a power of 2 for n > 1; hence a prime divisor congruent to 1 modulo 4 always exists.
%C A125256 a(n) = 5 if and only if n is congruent to 2 or -2 modulo 5.
%C A125256 If the map "x -> smallest odd prime divisor of n^2+1" is iterated, does it always terminate in the 2-cycle (5 <-> 13)? - _Zoran Sunic_, Oct 25 2017
%D A125256 D. M. Burton, Elementary Number Theory, McGraw-Hill, Sixth Edition (2007), p. 191.
%H A125256 Ray Chandler, <a href="/A125256/b125256.txt">Table of n, a(n) for n = 2..20001</a> (first 999 terms from Nick Hobson)
%e A125256 The prime divisors of 8^2 + 1 = 65 are 5 and 13, so a(7) = 5.
%p A125256 with(numtheory, factorset);
%p A125256 A125256 := proc(n) local t1,t2;
%p A125256 if n <= 1 then return(-1); fi;
%p A125256 if (n mod 5) = 2 or (n mod 5) = 3 then return(5); fi;
%p A125256 t1 := numtheory[factorset](n^2+1);
%p A125256 t2:=sort(convert(t1,list));
%p A125256 if (n mod 2) = 1 then return(t2[2]); fi;
%p A125256 t2[1];
%p A125256 end;
%p A125256 [seq(A125256(n),n=1..40)]; # _N. J. A. Sloane_, Nov 04 2017
%t A125256 Table[Select[First/@FactorInteger[n^2+1],OddQ][[1]],{n,2,68}] (* _James C. McMahon_, Dec 16 2024 *)
%o A125256 (PARI) vector(68, n, if(n<2, "-", factor(n^2+1)[1+(n%2),1]))
%o A125256 (PARI) A125256(n)=factor(n^2+1)[1+bittest(n,0),1] \\ _M. F. Hasler_, Nov 06 2017
%Y A125256 Cf. A002522, A002496, A014442, A057207, A031439.
%Y A125256 For bisections see A256970, A293958.
%Y A125256 See also A125257, A125258, A294656, A294657, A294658.
%K A125256 easy,nonn
%O A125256 2,1
%A A125256 _Nick Hobson_, Nov 26 2006