login
Number of distinct results produced when generating a graphical image of each row of the multiplication table modulo n.
1

%I #41 May 07 2021 09:41:56

%S 1,2,3,4,4,6,5,8,7,9,7,12,8,12,13,14,10,16,11,18,17,18,13,24,16,21,19,

%T 24,16,28,17,26,25,27,25,32,20,30,29,36,22,38,23,36,35,36,25,44,29,41,

%U 37,42,28,46,37,48,41,45,31,56,32,48,47,50,43,58,35,54,49,60

%N Number of distinct results produced when generating a graphical image of each row of the multiplication table modulo n.

%C The k-th row of the multiplication tables can be shown graphically by drawing a line for each i from i to k * i (mod n). The direction of the lines is not important.

%H Michael De Vlieger, <a href="/A343292/a343292.png">Scatterplot of (n, a(n))</a> for n=1..2^16.

%H Michael De Vlieger, <a href="/A343292/a343292_1.png">Annotated scatterplot of (n, a(n))</a> for n=1..240, labeling a(n), with color function related to ratio (a(n)+(n+3)/2)/((n-3)/2), black for prime n. Red dashed line has slope 1. Blue dashed line = (a(n)+3)/2.

%H Michael De Vlieger, <a href="/A343292/a343292_2.png">Annotated scatterplot of (n, (a(n)+(n+3)/2)/((n-3)/2))</a> for n=1..2^12, the highest values are labeled a(n).

%H Steve Phelps, <a href="https://www.geogebra.org/m/dqKkQEv7">Modular Times Table</a>, GeoGebra.

%F a(n) = n - A329152(n) = n - (A000010(n) - A060594(n))/2. - _Andrew Howroyd_, Apr 12 2021

%F a(p) = (p + 3)/2 for p prime. - _Michael De Vlieger_, Apr 13 2021

%e Modulo 11, the 2 and 6 time tables, the 3 and 4 time tables, the 5 and 9 time tables, and the 7 and 8 time tables give the same pattern. So there are only 7 different time tables (0,1,2,3,5,7 and 10).

%t {1}~Join~Array[# - (EulerPhi[#] - Sum[Boole[Mod[k^2, #] == 1], {k, #}])/2 &, 69, 2] (* _Michael De Vlieger_, Apr 13 2021 *)

%o (PARI)

%o G(n,r)={Set(vector(n, i, my(j=i*r%n); [min(i,j), max(i,j)]))}

%o a(n)={#Set(vector(n, k, concat(G(n,k-1))))} \\ _Andrew Howroyd_, Apr 12 2021

%o (PARI) \\ here b(n) is A060594(n).

%o b(n)={my(o=valuation(n, 2)); 2^(omega(n>>o)+max(min(o-1, 2), 0))}

%o a(n)={n - (eulerphi(n)-b(n))/2} \\ _Andrew Howroyd_, Apr 12 2021

%Y Cf. A000010, A018253, A060594, A329152.

%K nonn

%O 1,2

%A _Sébastien Dumortier_, Apr 12 2021