login
Discrete logarithm of n to the base 2 modulo 13.
2

%I #24 Aug 06 2024 07:11:56

%S 0,1,4,2,9,5,11,3,8,10,7,6

%N Discrete logarithm of n to the base 2 modulo 13.

%C This is also a (12,1)-sequence.

%C Equivalently, a(n) is the multiplicative order of n with respect to base 2 (modulo 13), i.e., a(n) is the base-2 logarithm of the smallest k such that 2^k mod 13 = n.

%D I. M. Vinogradov, Elements of Number Theory, p. 220.

%H H. Y. Song and S. W. Golomb, <a href="https://citeseerx.ist.psu.edu/pdf/20e087f1e3d60c14180d4c27a3183f942de29e94">Generalized Welch-Costas sequences and their application to Vatican arrays</a>, in Proc. 2nd International Conference on Finite Fields: Theory, Algorithms and Applications (Las Vegas 1993) Contemp. Math. vol. 168 344 1994.

%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DiscreteLogarithm.html">Discrete Logarithm</a>.

%F 2^a(n) == n (mod 13). - _Michael S. Branicky_, Aug 22 2021

%e From _Jon E. Schoenfield_, Aug 21 2021: (Start)

%e Sequence is a permutation of the 12 integers 0..11:

%e k 2^k 2^k mod 13

%e -- ------ ----------

%e 0 1 1 so a(1) = 0

%e 1 2 2 so a(2) = 1

%e 2 4 4 so a(4) = 2

%e 3 8 8 so a(8) = 3

%e 4 16 3 so a(3) = 4

%e 5 32 6 so a(6) = 5

%e 6 64 12 so a(12) = 6

%e 7 128 11 so a(11) = 7

%e 8 256 9 so a(9) = 8

%e 9 512 5 so a(5) = 9

%e 10 1024 10 so a(10) = 10

%e 11 2048 7 so a(7) = 11

%e 12 4096 1

%e but a(1) = 0, so the sequence is finite with 12 terms.

%e (End)

%p [ seq(numtheory[mlog](n, 2, 13), n=1..12) ];

%t a[1] = 0; a[n_] := MultiplicativeOrder[2, 13, {n}]; Array[a, 12] (* _Jean-François Alcover_, Feb 09 2018 *)

%o (Python)

%o from sympy.ntheory import discrete_log

%o def a(n): return discrete_log(13, n, 2)

%o print([a(n) for n in range(1, 13)]) # _Michael S. Branicky_, Aug 22 2021

%Y A row of A054503.

%K nonn,base,fini,full

%O 1,3

%A _N. J. A. Sloane_