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.

A121380 Sums of primitive roots for n (or 0 if n has no primitive roots).

This page as a plain text file.
%I A121380 #14 Feb 16 2025 08:33:02
%S A121380 0,1,2,3,5,5,8,0,7,10,23,0,26,8,0,0,68,16,57,0,0,56,139,0,100,52,75,0,
%T A121380 174,0,123,0,0,136,0,0,222,114,0,0,328,0,257,0,0,208,612,0,300,200,0,
%U A121380 0,636,156,0,0,0,348,886,0,488,216,0,0,0,0,669,0,0,0
%N A121380 Sums of primitive roots for n (or 0 if n has no primitive roots).
%C A121380 In Article 81 of his Disquisitiones Arithmeticae (1801), Gauss proves that the sum of all primitive roots (A001918) of a prime p, mod p, equals MoebiusMu[p-1] (A008683). "The sum of all primitive roots is either = 0 (mod p) (when p-1 is divisible by a square), or = +-1 (mod p) (when p-1 is the product of unequal prime numbers; if the number of these is even the sign is positive but if the number is odd, the sign is negative)."
%D A121380 J. C. F. Gauss, Disquisitiones Arithmeticae, 1801.
%H A121380 T. D. Noe, <a href="/A121380/b121380.txt">Table of n, a(n) for n = 1..10000</a>
%H A121380 Eric Weisstein, <a href="https://mathworld.wolfram.com/PrimitiveRoot.html">Primitive Roots</a>.
%e A121380 The primitive roots of 13 are 2, 6, 7, 11. Their sum is 26, or 0 (mod 13). By Gauss, 13-1=12 is thus divisible by a square number.
%t A121380 primitiveRoots[n_] := If[n == 1, {}, If[n == 2, {1}, Select[Range[2, n-1], MultiplicativeOrder[#, n] == EulerPhi[n] &]]]; Table[Total[primitiveRoots[n]], {n,100}]
%t A121380 (* From version 10 up: *)
%t A121380 Table[Total @ PrimitiveRootList[n], {n, 1, 100}] (* _Jean-François Alcover_, Oct 31 2016 *)
%Y A121380 Cf. A001918, A008683, A046147 (primitive roots of n), A088144, A088145, A123475, A222009.
%K A121380 nice,nonn
%O A121380 1,3
%A A121380 _Ed Pegg Jr_, Jul 25 2006