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.

A195812 Sum of the distinct residues of x^n (mod n), x=0..n-1.

This page as a plain text file.
%I A195812 #31 Oct 30 2018 10:31:02
%S A195812 0,1,3,1,10,8,21,1,9,25,55,14,78,42,105,1,136,20,171,22,84,110,253,26,
%T A195812 50,169,27,84,406,150,465,1,528,289,595,38,666,342,273,42,820,130,903,
%U A195812 198,315,460,1081,50,147,125,1275,156,1378,56,385,140,570,841
%N A195812 Sum of the distinct residues of x^n (mod n), x=0..n-1.
%C A195812 a(n) has the following properties :
%C A195812 If n is a power of 2 then a(n)= 1 ;
%C A195812 Except for n = 9 where a(9)=9, if a(n) is the square of a prime p, the sequence shows that n is of the form n = 2p.
%C A195812 The numbers m such that a(m) are square are : 1, 2, 4, 8, 9, 10, 16, 26, 32, 34, 58, 64, 74, 81, ...
%H A195812 Zak Seidov, <a href="/A195812/b195812.txt">Table of n, a(n) for n = 1..1000</a>
%e A195812 a(10) = 25 because the residues (mod 10) of x^10 are 0, 1, 4, 5, 6, 9 and the sum 25 is a square => a(10) = a(2*5)= 5^2.
%p A195812 sumDistRes := proc(n)
%p A195812         local re, x, r ;
%p A195812         re := {} ;
%p A195812         for x from 0 to n-1 do
%p A195812                 re := re union { modp(x^n, n) } ;
%p A195812         end do:
%p A195812         add(r, r=re) ;
%p A195812 end proc:
%p A195812 for n from 1 to 100 do
%p A195812           printf("%d, ", sumDistRes(n));
%p A195812 end do: # (Program of _R. J. Mathar_ - see A196546)
%t A195812 Table[{m,Total[Union[Table[PowerMod[x,m,m],{x,m-1}]]]},{m,1000}] (* _Zak Seidov_, Oct 06 2011 *)
%o A195812 (PARI) a(n) = vecsum(Set(vector(n, k, lift(Mod(k-1,n)^n)))); \\ _Michel Marcus_, Jun 01 2015
%Y A195812 Cf. A196546, A196547.
%K A195812 nonn
%O A195812 1,3
%A A195812 _Michel Lagneau_, Oct 05 2011