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.

A229710 Least m of maximal order mod n such that m is a sum of two squares.

This page as a plain text file.
%I A229710 #10 Nov 07 2015 17:38:56
%S A229710 2,5,5,5,2,13,2,5,2,5,2,5,5,5,2,13,2,13,5,5,2,37,2,5,2,13,13,5,2,5,2,
%T A229710 5,2,13,2,13,13,5,5,13,2,5,5,5,5,13,5,37,2,5,2,5,2,37,2,13,2,13,2,5,2,
%U A229710 5,2,5,2,17,13,5,5,5,2,13,2,37,29,13,2,13,2,5
%N A229710 Least m of maximal order mod n such that m is a sum of two squares.
%C A229710 The sequence is undefined at n=4, as all the primitive roots are congruent to 3 mod 4.
%C A229710 Terms are not necessarily prime. For example, a(109) = 10.
%C A229710 a(prime(n)) = A229709(n).
%H A229710 Eric M. Schmidt, <a href="/A229710/b229710.txt">Table of n, a(n) for n = 5..10000</a>
%H A229710 Christopher Ambrose, <a href="http://www.emis.de/journals/INTEGERS/papers/n55/n55.Abstract.html">On the Least Primitive Root Expressible as a Sum of Two Squares</a>, INTEGERS, Electronic J. of Combinatorial Number Theory, Vol. 13, Paper A55, 2013.
%e A229710 The integer 5 = 2^2 + 1^2 has order 2 mod 12, the maximum, so a(12) = 5.
%o A229710 (Sage) def A229710(n) : m = Integers(n).unit_group_exponent(); return 0 if n==1 else next(i for i in PositiveIntegers() if mod(i,n).is_unit() and mod(i,n).multiplicative_order() == m and all(p%4 != 3 or e%2==0 for (p,e) in factor(i)))
%Y A229710 Cf. A001481, A111076, A229708, A229709.
%K A229710 nonn
%O A229710 5,1
%A A229710 _Eric M. Schmidt_, Sep 27 2013