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.

A197943 Greatest residue of x^(n-1) (mod n), x=0..n-1.

Original entry on oeis.org

0, 1, 1, 3, 1, 5, 1, 7, 7, 9, 1, 11, 1, 13, 10, 15, 1, 17, 1, 19, 18, 21, 1, 23, 21, 25, 25, 27, 1, 29, 1, 31, 31, 33, 30, 35, 1, 37, 36, 39, 1, 41, 1, 43, 40, 45, 1, 47, 43, 49, 49, 51, 1, 53, 49, 55, 55, 57, 1, 59, 1, 61, 58, 63, 61, 65, 1, 67, 64, 69, 1, 71, 1, 73, 69, 75, 71, 77, 1, 79, 79, 81, 1, 83, 81, 85, 82, 87, 1, 89, 78
Offset: 1

Views

Author

Michel Lagneau, Oct 19 2011

Keywords

Comments

a(n) = 1 if n prime and a(n) = n-1 if n even.

Examples

			a(8) = 7 because x^7 == 0, 1, 3, 5, 7  (mod 8) => 7 is the greatest residue.
		

Crossrefs

Programs

  • Mathematica
    Table[Max[PowerMod[Range[0,n-1],n-1,n]], {n,100}]
  • PARI
    A197943(n) = { my(m=0); for(x=0,n-1, m = max(m,lift(Mod(x^(n-1),n)))); (m); }; \\ Antti Karttunen, Sep 10 2018

Extensions

More terms added, incorrect PARI-program removed by Antti Karttunen, Sep 10 2018