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.

A008832 Discrete logarithm of n to the base 2 modulo 19.

This page as a plain text file.
%I A008832 #31 Aug 14 2021 16:03:27
%S A008832 0,1,13,2,16,14,6,3,8,17,12,15,5,7,11,4,10,9
%N A008832 Discrete logarithm of n to the base 2 modulo 19.
%C A008832 Equivalently, a(n) is the multiplicative order of n with respect to base 2 (modulo 19), i.e., a(n) is the base-2 logarithm of the smallest k such that 2^k mod 19 = n. - _Jon E. Schoenfield_, Aug 13 2021
%D A008832 Carl Friedrich Gauss, "Disquisitiones Arithmeticae", Yale University Press, 1965; see p. 37.
%D A008832 I. M. Vinogradov, Elements of Number Theory, p. 221.
%H A008832 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DiscreteLogarithm.html">Discrete Logarithm</a>.
%F A008832 2^a(n) == n (mod 19). - _Michael S. Branicky_, Aug 13 2021
%e A008832 From _Jon E. Schoenfield_, Aug 13 2021: (Start)
%e A008832 Sequence is a permutation of the 18 integers 0..17:
%e A008832    k     2^k  2^k mod 19
%e A008832   --  ------  ----------
%e A008832    0       1           1  so a(1)  =  0
%e A008832    1       2           2  so a(2)  =  1
%e A008832    2       4           4  so a(4)  =  2
%e A008832    3       8           8  so a(8)  =  3
%e A008832    4      16          16  so a(16) =  4
%e A008832    5      32          13  so a(13) =  5
%e A008832    6      64           7  so a(7)  =  6
%e A008832    7     128          14  so a(14) =  7
%e A008832    8     256           9  so a(9)  =  8
%e A008832    9     512          18  so a(18) =  9
%e A008832   10    1024          17  so a(17) = 10
%e A008832   11    2048          15  so a(15) = 11
%e A008832   12    4096          11  so a(11) = 12
%e A008832   13    8192           3  so a(3)  = 13
%e A008832   14   16384           6  so a(6)  = 14
%e A008832   15   32768          12  so a(12) = 15
%e A008832   16   65536           5  so a(5)  = 16
%e A008832   17  131072          10  so a(10) = 17
%e A008832   18  262144           1
%e A008832 but a(1) = 0, so the sequence is finite with 18 terms.
%e A008832 (End)
%p A008832 [ seq(mlog(n,2,19), n=1..18) ];
%t A008832 a[1]=0; a[n_]:=MultiplicativeOrder[2, 19, {n}]; Array[a, 18] (* _Vincenzo Librandi_, Mar 21 2020 *)
%o A008832 (PARI) a(n) = znlog(n, Mod(2, 19)); \\ _Kevin Ryde_, Aug 13 2021
%o A008832 (Python)
%o A008832 from sympy.ntheory import discrete_log
%o A008832 def a(n): return discrete_log(19, n, 2)
%o A008832 print([a(n) for n in range(1, 19)]) # _Michael S. Branicky_, Aug 13 2021
%Y A008832 Cf. A036120.
%K A008832 nonn,base,fini,full
%O A008832 1,3
%A A008832 _N. J. A. Sloane_
%E A008832 Offset corrected by _Jon E. Schoenfield_, Aug 12 2021