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

A294656 Size of the orbit of n under iteration of the map A125256: x -> smallest odd prime divisor of n^2+1.

Original entry on oeis.org

3, 3, 4, 2, 4, 3, 3, 6, 5, 7, 3, 2, 4, 4, 4, 3, 3, 6, 5, 3, 3, 3, 4, 4, 4, 3, 3, 4, 4, 3, 3, 3, 3, 4, 4, 3, 3, 5, 5, 5, 3, 3, 3, 4, 5, 3, 3, 4, 6, 5, 3, 3, 4, 4, 4, 3, 3, 6, 3, 6, 3, 3, 4, 4, 4, 3, 3, 7, 3, 5, 3, 3, 4, 5, 4, 3, 3, 6, 4, 4, 3, 3, 4, 4, 3, 3, 3, 4, 8, 6, 3
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 A294658 gives the number of steps to reach either 5 or 13, i.e. an element of this terminating cycle. Therefore a(n) (which counts these two elements as well as the initial value) is 2 more than A294658(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) = 3 = # { 2, 5, 13 }, because under A125256, 2 -> 2^2+1 = 5 (= its smallest odd prime factor), 5 -> least odd prime factor(5^2+1 = 26) = 13, 13 -> least odd prime factor(13^2 + 1 = 170 = 2*5*17) = 5, etc.
a(3) = 3 = # { 3, 5, 13 }, because under A125256, 3 -> smallest odd prime factor(3^2+1 = 10) = 5, 5 -> 13, 13 -> 5 etc.
a(4) = 4 = # { 4, 17, 5, 13 }, because under A125256, 4 -> 4^2+1 = 17 (= its smallest odd prime factor), 17 -> smallest odd prime factor(17^2+1 = 290 = 2*5*29) = 5, 5 -> 13, 13 -> 5 etc.
		

Crossrefs

Cf. A125256, A294657: largest number in the orbit, A294658: number of steps to reach the cycle (5, 13).

Programs

  • PARI
    A294656(n,f=A125256,S=[n])={while(#S<#S=setunion(S,[n=f(n)]),); #S} \\ Does not assume the terminating cycle is (5, 13): also works correctly in case there are other terminating cycles.

Formula

a(n) = A294658(n) + 2.

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.