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.

Showing 1-2 of 2 results.

A139366 Table with the order r=r(N,n) of n modulo N, for given N and n, with gcd(N,n)=1.

Original entry on oeis.org

0, 1, 0, 1, 2, 0, 1, 0, 2, 0, 1, 4, 4, 2, 0, 1, 0, 0, 0, 2, 0, 1, 3, 6, 3, 6, 2, 0, 1, 0, 2, 0, 2, 0, 2, 0, 1, 6, 0, 3, 6, 0, 3, 2, 0, 1, 0, 4, 0, 0, 0, 4, 0, 2, 0, 1, 10, 5, 5, 5, 10, 10, 10, 5, 2, 0, 1, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 1, 12, 3, 6, 4, 12, 12, 4, 3, 6, 12, 2, 0, 1, 0, 6, 0, 6, 0, 0, 0, 3, 0
Offset: 1

Views

Author

Wolfdieter Lang, May 21 2008

Keywords

Comments

In the table a 0 appears for 1 <= n <= N if gcd(N,n) is not 1. In particular, this is the case for the main diagonal with N > 1. Also for N=n=1 one sets r=0 because 1^m congruent to 0 (mod 1) for all m.
For given N and n with gcd(N,n)=1 the function F(N,n;a):=n^a (mod N) has period r=r(N,n): F(N,n;a+r) congruent F(N,n;a) (mod N).
The period r is used for factoring integers in quantum computing. See e.g. the Ekert and Jozsa reference.

Examples

			Triangle begins:
  [0];
  [1,0];
  [1,2,0];
  [1,0,2,0];
  [1,4,4,2,0];
  ...
For N=5, the order r of 3 (mod 5) is 4 because 3^1 == 3 (mod 5), 3^2 == 4 (mod 5), 3^3 == 2 (mod 5), 3^4 == 1 (mod 5). Hence F(5,3;a+4) == F(5,3;a) (mod 5).
		

Crossrefs

Cf. A036391 (row sums).
See A250211 for another version.

Programs

  • Haskell
    a139366 1 1               = 0
    a139366 n k | gcd n k > 1 = 0
                | otherwise   = head [r | r <- [1..], k ^ r `mod` n == 1]
    a139366_row n = map (a139366 n) [1..n]
    a139366_tabl = map a139366_row [1..]
    -- Reinhard Zumkeller, May 01 2013
  • Mathematica
    r[n_, k_] := If[ CoprimeQ[k, n], MultiplicativeOrder[k, n], 0]; Table[r[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Aug 19 2013 *)
  • PARI
    r(N,n)=if(N<2||gcd(n,N)>1,0,znorder(Mod(n,N)))
    for(N=1,9,for(n=1,N,print1(r(N,n)", "))) \\ Charles R Greathouse IV, Feb 18 2013
    

Formula

r(N,n) is the smallest positive number with n^r == 1 (mod N), n=1..N, if gcd(N,n)=1, otherwise 0. This r is called the order of n (mod N) if gcd(N,n)=1.

A323376 Square array read by ascending antidiagonals: T(n,k) is the multiplicative order of the n-th prime modulo the k-th prime, or 0 if n = k, n >= 1, k >= 1.

Original entry on oeis.org

0, 1, 2, 1, 0, 4, 1, 2, 4, 3, 1, 1, 0, 6, 10, 1, 2, 4, 6, 5, 12, 1, 1, 1, 0, 5, 3, 8, 1, 2, 4, 3, 10, 4, 16, 18, 1, 1, 4, 2, 0, 12, 16, 18, 11, 1, 2, 2, 6, 10, 12, 16, 9, 11, 28, 1, 2, 4, 6, 10, 0, 16, 3, 22, 28, 5, 1, 1, 2, 3, 10, 6, 4, 3, 22, 14, 30, 36
Offset: 1

Views

Author

Jianing Song, Jan 12 2019

Keywords

Comments

The maximum element in the k-th column is prime(k) - 1. By Dirichlet's theorem on arithmetic progressions, all divisors of prime(k) - 1 occur infinitely many times in the n-th column.

Examples

			Table begins
     |  k  | 1  2  3  4   5   6   7   8   9  10  ...
   n | p() | 2  3  5  7  11  13  17  19  23  29  ...
  ---+-----+----------------------------------------
   1 |   2 | 0, 2, 4, 3, 10, 12,  8, 18, 11, 28, ...
   2 |   3 | 1, 0, 4, 6,  5,  3, 16, 18, 11, 28, ...
   3 |   5 | 1, 2, 0, 6,  5,  4, 16,  9, 22, 14, ...
   4 |   7 | 1, 1, 4, 0, 10, 12, 16,  3, 22,  7, ...
   5 |  11 | 1, 2, 1, 3,  0, 12, 16,  3, 22, 28, ...
   6 |  13 | 1, 1, 4, 2, 10,  0,  4, 18, 11, 14, ...
   7 |  17 | 1, 2, 4, 6, 10,  6,  0,  9, 22,  4, ...
   8 |  19 | 1, 1, 2, 6, 10, 12,  8,  0, 22, 28, ...
   9 |  23 | 1, 2, 4, 3,  1,  6, 16,  9 , 0,  7, ...
  10 |  29 | 1, 2, 2, 1, 10,  3, 16, 18, 11,  0, ...
  ...
		

Crossrefs

Cf. A250211.
Cf. A014664 (1st row), A062117 (2nd row), A211241 (3rd row), A211243 (4th row), A039701 (2nd column).
Cf. A226367 (lower diagonal), A226295 (upper diagonal).

Programs

  • Maple
    A:= (n, k)-> `if`(n=k, 0, (p-> numtheory[order](p(n), p(k)))(ithprime)):
    seq(seq(A(1+d-k, k), k=1..d), d=1..14);  # Alois P. Heinz, Feb 06 2019
  • Mathematica
    T[n_, k_] := If[n == k, 0, MultiplicativeOrder[Prime[n], Prime[k]]];Table[T[n, k], {n, 1, 10}, {k, 1, 10}] (* Peter Luschny, Jan 20 2019 *)
  • PARI
    T(n,k) = if(n==k, 0, znorder(Mod(prime(n), prime(k))))

Formula

T(n,k) = A250211(prime(n), prime(k)).
Showing 1-2 of 2 results.