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 A204187 #58 Jan 10 2022 13:28:56 %S A204187 0,1,2,0,4,3,6,0,6,5,10,0,12,7,10,0,16,9,18,0,14,11,22,0,20,13,18,0, %T A204187 28,15,30,0,22,17,0,0,36,19,26,0,40,21,42,0,21,23,46,0,42,25,34,0,52, %U A204187 27,0,0,38,29,58,0,60,31,42,0,52,33,66,0,46,35,70,0 %N A204187 a(n) = Sum_{m=1..n-1} m^(n-1) modulo n. %C A204187 a(n) = n - 1 if n is 1 or a prime, by Fermat's little theorem. It is conjectured that the converse is also true; see A055032 and A201560 and note that a(n) = n-1 <==> A055032(n) = 1 <==> A201560(n) = 0. %C A204187 As of 1991, Giuga and Bedocchi had verified no composite n < 10^1700 satisfies a(n) = n - 1 (Ribemboim, 1991). - _Alonso del Arte_, May 10 2013 %D A204187 Steve Dinh, The Hard Mathematical Olympiad Problems And Their Solutions, AuthorHouse, 2011, Problem 6 of Hong Kong Mathematical Olympiad 2007 (find a(7)), page 134. %D A204187 Richard K. Guy, Unsolved Problems in Number Theory, A17. %D A204187 Paulo Ribemboim, The Little Book of Big Primes. New York: Springer-Verlag (1991): 17. %H A204187 Ivan Neretin, <a href="/A204187/b204187.txt">Table of n, a(n) for n = 1..10000</a> %H A204187 John Clark, <a href="https://scholarcommons.usf.edu/etd/178">On a conjecture involving Fermat's Little Theorem</a>, Thesis, 2008, University of South Florida. %H A204187 Hong Kong Mathematics Olympiad (2007-2008), <a href="https://fadjarp3g.files.wordpress.com/2011/04/2007d.pdf">Final Event 2 (Group)</a>, problem 2, p. 437. %H A204187 Bernard Schott, <a href="/A204187/a204187_1.txt">Proof that a(n)=n/2 if n is of the form 4k+2</a>. %H A204187 <a href="/index/O#Olympiads">Index to sequences related to Olympiads</a>. %F A204187 a(p) = p - 1 if p is prime, and a(4n) = 0. %F A204187 a(n) + 1 == A201560(n) (mod n). %F A204187 a(n) = n/2 iff n is of the form 4k+2 (conjectured). - _Ivan Neretin_, Sep 23 2016 %F A204187 a(4*k+2) = 2*k+1; for a proof see corresponding link. - _Bernard Schott_, Dec 29 2021 %e A204187 Sum(m^3, m = 1 .. 3) = 1^3 + 2^3 + 3^3 = 36 == 0 (mod 4), so a(4) = 0. %t A204187 Table[Mod[Sum[i^(n - 1), {i, n - 1}], n], {n, 75}] (* _Alonso del Arte_, May 10 2013 *) %o A204187 (PARI) a(n) = lift(sum(i=1, n, Mod(i, n)^(n-1))); \\ _Michel Marcus_, Feb 23 2020 %o A204187 (Python) %o A204187 def a(n): return sum(pow(m, n-1, n) for m in range(1, n))%n %o A204187 print([a(n) for n in range(1, 73)]) # _Michael S. Branicky_, Jan 02 2022 %Y A204187 Cf. A055023, A055030, A055031, A055032, A201560. %Y A204187 Cf. A191677 (zeros). %K A204187 nonn,easy %O A204187 1,3 %A A204187 _Jonathan Sondow_, Jan 12 2012