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.

Showing 1-3 of 3 results.

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

Original entry on oeis.org

5, 5, 17, 13, 37, 5, 5, 41, 101, 61, 5, 5, 197, 113, 257, 5, 5, 181, 401, 13, 5, 5, 577, 313, 677, 5, 5, 421, 17, 13, 5, 5, 13, 613, 1297, 5, 5, 761, 1601, 29, 5, 5, 13, 1013, 29, 5, 5, 1201, 41, 1301, 5, 5, 2917, 17, 3137, 5, 5, 1741, 13, 1861, 5, 5, 17, 2113, 4357, 5, 5
Offset: 2

Views

Author

Nick Hobson, Nov 26 2006

Keywords

Comments

Any odd prime divisor of n^2+1 is congruent to 1 modulo 4.
n^2+1 is never a power of 2 for n > 1; hence a prime divisor congruent to 1 modulo 4 always exists.
a(n) = 5 if and only if n is congruent to 2 or -2 modulo 5.
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

Examples

			The prime divisors of 8^2 + 1 = 65 are 5 and 13, so a(7) = 5.
		

References

  • D. M. Burton, Elementary Number Theory, McGraw-Hill, Sixth Edition (2007), p. 191.

Crossrefs

Programs

  • Maple
    with(numtheory, factorset);
    A125256 := proc(n) local t1,t2;
    if n <= 1 then return(-1); fi;
    if (n mod 5) = 2 or (n mod 5) = 3 then return(5); fi;
    t1 := numtheory[factorset](n^2+1);
    t2:=sort(convert(t1,list));
    if (n mod 2) = 1 then return(t2[2]); fi;
    t2[1];
    end;
    [seq(A125256(n),n=1..40)]; # N. J. A. Sloane, Nov 04 2017
  • Mathematica
    Table[Select[First/@FactorInteger[n^2+1],OddQ][[1]],{n,2,68}] (* James C. McMahon, Dec 16 2024 *)
  • PARI
    vector(68, n, if(n<2, "-", factor(n^2+1)[1+(n%2),1]))
    
  • PARI
    A125256(n)=factor(n^2+1)[1+bittest(n,0),1] \\ M. F. Hasler, Nov 06 2017

A294657 Largest number in the orbit of n under iteration of the map A125256: x -> smallest odd prime divisor of n^2+1.

Original entry on oeis.org

13, 13, 17, 13, 37, 13, 13, 421, 5101, 1861, 13, 13, 197, 113, 257, 17, 18, 16381, 401, 21, 22, 23, 577, 313, 677, 27, 28, 421, 30, 31, 32, 33, 34, 613, 1297, 37, 38, 761, 1601, 421, 42, 43, 44, 1013, 421, 47, 48, 1201, 421, 1301, 52, 53, 2917, 55, 3137, 57, 58, 1515541, 60
Offset: 2

Views

Author

M. F. Hasler, Nov 06 2017

Keywords

Comments

The orbit (or trajectory) under A125256 appears to end in the cycle 5 -> 13 -> 5 -> etc. for any initial value n.

Crossrefs

Cf. A125256, A294656 (size of the orbit).

Programs

  • Mathematica
    Table[Max[NestWhileList[SelectFirst[FactorInteger[#^2+1][[All,1]], OddQ]&, n,#!=13&]],{n,2,60}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 04 2019 *)
  • PARI
    A294657(n,S=[n])={while(#S<#S=setunion(S,[n=A125256(n)]),); vecmax(S)}

A294658 Number of steps required to reach either 5 or 13, starting with n, when iterating the map A125256: x -> smallest odd prime divisor of n^2+1; or a(n) = -1 in case 5 is never reached.

Original entry on oeis.org

1, 1, 2, 0, 2, 1, 1, 4, 3, 5, 1, 0, 2, 2, 2, 1, 1, 4, 3, 1, 1, 1, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 3, 3, 3, 1, 1, 1, 2, 3, 1, 1, 2, 4, 3, 1, 1, 2, 2, 2, 1, 1, 4, 1, 4, 1, 1, 2, 2, 2, 1, 1, 5, 1, 3, 1, 1, 2, 3, 2, 1, 1, 4, 2, 2, 1, 1, 2, 2, 1, 1
Offset: 2

Views

Author

M. F. Hasler, Nov 06 2017

Keywords

Comments

The orbit or trajectory under A125256 appears to end in the cycle 5 -> 13 -> 5 -> etc. for any initial value n.
Sequence A294656 gives the size of the complete orbit of n under the map A125256, including the two elements 5 and 13 of the terminating cycle. Thus a(n) is 2 less than A294656(n) for all n. This is confirmed by careful examination of special cases - assuming, of course, that all trajectories end in the cycle (5, 13).

Examples

			For n = 1 the map A125256 is not defined.
a(2) = 1 because under A125256, 2 -> 2^2+1 = 5 (= its smallest odd prime factor), so 5 is reached after just a(2) = 1 iteration of this map.
a(3) = 1 because A125256(3) = 5, least odd prime factor of 3^2+1 = 10 = 2*5, so here again 5 is reached after just a(2) = 1 iteration of A125256.
a(4) = 2 because A125256(4) = 4^2 + 1 = 17, and A125256(17) = 5 = least odd prime factor of 17^2 + 1 = 289 + 1 = 2*5*29, so 5 is reached after a(4) = 2 iterations of A125256.
a(5) = a(13) = 0 because for these initial values 5 and 13, no iteration is needed until either 5 or 13 is reached.
		

Crossrefs

Programs

  • PARI
    A294658(n)=for(k=0,oo,bittest(8224,n)&&return(k);n=A125256(n)) \\ 8224 = 2^5 + 2^13. One could add 2^0 + 2^1 = 3 to avoid an error message for initial values 0 and 1, for which A125256 is not defined.

Formula

a(n) = A294656(n) - 2.
Showing 1-3 of 3 results.