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.
%I A197943 #14 Sep 11 2018 17:03:10 %S A197943 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, %T A197943 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, %U A197943 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 %N A197943 Greatest residue of x^(n-1) (mod n), x=0..n-1. %C A197943 a(n) = 1 if n prime and a(n) = n-1 if n even. %H A197943 Antti Karttunen, <a href="/A197943/b197943.txt">Table of n, a(n) for n = 1..11111</a> %e A197943 a(8) = 7 because x^7 == 0, 1, 3, 5, 7 (mod 8) => 7 is the greatest residue. %t A197943 Table[Max[PowerMod[Range[0,n-1],n-1,n]], {n,100}] %o A197943 (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 %Y A197943 Cf. A196082, A197929, A197930. %K A197943 nonn,easy %O A197943 1,4 %A A197943 _Michel Lagneau_, Oct 19 2011 %E A197943 More terms added, incorrect PARI-program removed by _Antti Karttunen_, Sep 10 2018