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-2 of 2 results.

A111076 Smallest positive number of maximal order mod n.

Original entry on oeis.org

1, 1, 2, 3, 2, 5, 3, 3, 2, 3, 2, 5, 2, 3, 2, 3, 3, 5, 2, 3, 2, 7, 5, 5, 2, 7, 2, 3, 2, 7, 3, 3, 2, 3, 2, 5, 2, 3, 2, 3, 6, 5, 3, 3, 2, 5, 5, 5, 3, 3, 5, 7, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 7, 5, 5, 5, 2, 3, 2, 7, 3, 3, 2, 7, 2, 5, 3, 3, 2, 3, 3, 7, 2, 3, 11, 5, 2, 5, 5, 3, 2, 3
Offset: 1

Views

Author

Keywords

Examples

			a(6)=5 because order of 1 is 1 and 2 through 4 are not relatively prime to 6, but 5 has order 2, which is the maximum possible.
		

Crossrefs

Cf. A002322 (orders); same as A046145 for n with primitive roots; see also A001918 (for primes), A229708.

Programs

  • Mathematica
    Table[Min[
      Select[Range[n],
       CoprimeQ[#, n] &&
         MultiplicativeOrder[#, n] == CarmichaelLambda[n] &]], {n, 1, 100}]
    (* Geoffrey Critzer, Jan 04 2015 *)
  • PARI
    a(n)=if(n==1, return(1)); if(n<5,return(n-1)); my(o=lcm(znstar(n)[2]),k=1); while(gcd(k++,n)>1 || znorder(Mod(k,n))Charles R Greathouse IV, Jul 31 2013

Formula

a(n) = A229708(n) if and only if a(n) is prime. - Jonathan Sondow, May 17 2017

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

Original entry on oeis.org

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, 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, 5, 2, 5, 2, 17, 13, 5, 5, 5, 2, 13, 2, 37, 29, 13, 2, 13, 2, 5
Offset: 5

Views

Author

Eric M. Schmidt, Sep 27 2013

Keywords

Comments

The sequence is undefined at n=4, as all the primitive roots are congruent to 3 mod 4.
Terms are not necessarily prime. For example, a(109) = 10.
a(prime(n)) = A229709(n).

Examples

			The integer 5 = 2^2 + 1^2 has order 2 mod 12, the maximum, so a(12) = 5.
		

Crossrefs

Programs

  • 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)))
Showing 1-2 of 2 results.