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-4 of 4 results.

A036391 a(n) = sum of order of a mod n, 0 < a < n, gcd(a, n) = 1.

Original entry on oeis.org

0, 1, 3, 3, 11, 3, 21, 7, 21, 11, 63, 7, 77, 21, 23, 23, 171, 21, 183, 23, 49, 63, 333, 15, 231, 77, 183, 49, 473, 23, 441, 87, 147, 171, 161, 49, 671, 183, 161, 47, 903, 49, 903, 147, 161, 333, 1521, 47, 903, 231, 343, 161, 1727, 183, 483, 105, 427, 473, 2439, 47
Offset: 1

Views

Author

Keywords

Comments

Related to a problem of Arnold.
Row sums of triangle A139366. - Wolfdieter Lang, Sep 09 2008

Programs

  • Haskell
    a036391 = sum . a139366_row  -- Reinhard Zumkeller, May 01 2013
  • Maple
    with(numtheory):
    a:= n-> add(`if`(igcd(n, k)=1, order(k, n), 0), k=1..n-1):
    seq(a(n), n=1..60);  # Alois P. Heinz, Oct 28 2012
  • Mathematica
    a[n_] := Sum[ If[ CoprimeQ[k, n], MultiplicativeOrder[k, n], 0], {k, 1, n-1}]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Aug 19 2013 *)

Formula

On the GRH, Kurlberg & Pomerance show that a(n) = n^2/log n exp(B log log n/log log log n (1 + o(1))), where B = A218342 = 0.345372.... - Charles R Greathouse IV, Oct 26 2012
If n is in A033948 then a(n) = Sum_{divisors d of phi(n)} phi(d)*d. - Geoffrey Critzer, Jan 24 2015

Extensions

Adapted to the definition: a(1)=0 by Alois P. Heinz, Oct 28 2012

A057593 Triangle T(n, k) giving period length of the periodic sequence k^i (i >= imin) mod n (n >= 2, 1 <= k <= n-1).

Original entry on oeis.org

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

Views

Author

Gottfried Helms, Oct 05 2000

Keywords

Comments

From Wolfdieter Lang, Sep 04 2017: (Start)
i) If gcd(n, k) = 1 then imin = imin(n, k) = 0 and the length of the period P = T(n, k) = order(n, k), given in A216327 corresponding to the numbers of A038566. This is due to Euler's theorem. E.g., T(4, 3) = 2 because A216327(4, 2) = 2 corresponding to A038566(4, 2) = 3.
ii) If gcd(n, k) is not 1 then the smallest nonnegative index imin = imin(n, k) is obtained from A290601 with the corresponding length of the period given in A290602. Also in this case the sequence always becomes periodic, because one of the possible values from {0, 1, ..., n-1} has to appear a second time because the sequence has more than n entries. Example: T(4, 2) = 1 because imin is given by A290601(1, 1) = 2 (corresponding to the present n = 4, k = 2 values) with the length of the period P given by A290602(1, 1) = 1. (End)

Examples

			If n=7, k=2, (imin = 0) the sequence is 1,2,4,1,2,4,1,2,4,... of period 3, so T(7,2) = 3. The triangle T(n, k) begins:
n \ k 1   2   3  4   5   6   7   8  9  10  11  12  13  14 15 16 17 ...
2:    1
3:    1   2
4:    1   1   2
5:    1   4   4  2
6:    1   2   1  1   2
7:    1   3   6  3   6   2
8:    1   1   2  1   2   1   2
9:    1   6   1  3   6   1   3   2
10:   1   4   4  2   1   1   4   4  2
11:   1  10   5  5   5  10  10  10  5   2
12:   1   2   2  1   2   1   2   2  1   1   2
13:   1  12   3  6   4  12  12   4  3   6  12   2
14:   1   3   6  3   6   2   1   1  3   6   3   6   2
15:   1   4   4  2   2   1   4   4  2   1   2   4   4  2
16:   1   1   4  1   4   1   2   1  2   1   4   1   4  1  2
17:   1   8  16  4  16  16  16   8  8  16  16  16   4  16  8  2
18:   1   6   1  3   6   1   3   2  1   1   6   1   3   6  1  1  2
... Reformatted and extended. - _Wolfdieter Lang_, Sep 04 2017
From _Wolfdieter Lang_, Sep 04 2017: (Start)
The  table imin(n, k) begins:
n \ k 1   2   3   4   5   6   7   8  9  10  11  12  13  14  15  16 17 ...
2:    0
3:    0   0
4:    0   2   0
5:    0   0   0   0
6:    0   1   1   1   0
7:    0   0   0   0   0   0
8:    0   3   0   2   0   3   0
9:    0   0   2   0   0   2   0   0
10:   0   1   0   1   1   1   0   1  0
11:   0   0   0   0   0   0   0   0  0   0
12:   0   2   1   1   0   2   0   1  1   2   0
13:   0   0   0   0   0   0   0   0  0   0   0   0
14:   0   1   0   1   0   1   1   1  0   1   0   1   0
15:   0   0   1   0   1   1   0   0  1   1   0   1   0   0
16:   0   4   0   2   0   4   0   2  0   4   0   2   0   4   0
17:   0   0   0   0   0   0   0   0  0   0   0   0   0   0   0   0
18:   0   1   2   1   0   2   0   1  1   1   0   2   0   1   2   1  0
... (End)
		

Crossrefs

Cf. A086145 (prime rows), A216327 (entries with gcd(n,k) = 1), A139366.

Programs

  • Mathematica
    period[lst_] := Module[{n, i, j}, n=Length[lst]; For[j=2, j <= n, j++, For[i=1, iJean-François Alcover, Feb 04 2015 *)

Extensions

Constraint on k changed from 2 <= k <= n to 1 <= k < n, based on comment from Franklin T. Adams-Watters, Jan 19 2006, by David Applegate, Mar 11 2014
Name changed and table extended by Wolfdieter Lang, Sep 04 2017

A250211 Square array read by antidiagonals: A(m,n) = multiplicative order of m mod n, or 0 if m and n are not coprime.

Original entry on oeis.org

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

Views

Author

Eric Chen, Dec 29 2014

Keywords

Comments

Read by antidiagonals:
m\n 1 2 3 4 5 6 7 8 9 10 11 12 13
1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 1 0 2 0 4 0 3 0 6 0 10 0 12
3 1 1 0 2 4 0 6 2 0 4 5 0 3
4 1 0 1 0 2 0 3 0 3 0 5 0 6
5 1 1 2 1 0 2 6 2 6 0 5 2 4
6 1 0 0 0 1 0 2 0 0 0 10 0 12
7 1 1 1 2 4 1 0 2 3 4 10 2 12
8 1 0 2 0 4 0 1 0 2 0 10 0 4
9 1 1 0 1 2 0 3 1 0 2 5 0 3
10 1 0 1 0 0 0 6 0 1 0 2 0 6
11 1 1 2 2 1 2 3 2 6 1 0 2 12
12 1 0 0 0 4 0 6 0 0 0 1 0 2
13 1 1 1 1 4 1 2 2 3 4 10 1 0
etc.
A(m,n) = Least k>0 such that m^k=1 (mod n), or 0 if no such k exists.
It is easy to prove that column n has period n.
A(1,n) = 1, A(m,1) =1.
If A(m,n) differs from 0, it is period length of 1/n in base m.
The maximum number in column n is psi(n) (A002322(n)), and all numbers in column n (except 0) divide psi(n), and all factors of psi(n) are in column n.
Except the first row, every row contains all natural numbers.

Examples

			A(3,7) = 6 because:
3^0 = 1 (mod 7)
3^1 = 3 (mod 7)
3^2 = 2 (mod 7)
3^3 = 6 (mod 7)
3^4 = 4 (mod 7)
3^5 = 5 (mod 7)
3^6 = 1 (mod 7)
...
And the period is 6, so A(3,7) = 6.
		

Crossrefs

Programs

  • Maple
    f:= proc(m,n)
      if igcd(m,n) <> 1 then 0
      elif n=1 then 1
      else numtheory:-order(m,n)
      fi
    end proc:
    seq(seq(f(t-j,j),j=1..t-1),t=2..65); # Robert Israel, Dec 30 2014
  • Mathematica
    a250211[m_, n_] = If[GCD[m, n] == 1, MultiplicativeOrder[m, n], 0]
    Table[a250211[t-j, j], {t, 2, 65}, {j, 1, t-1}]

A342754 Irregular triangle read by rows: T(n, k) is the number i of iterations that every scytale of length n and k > 1 sides must process its own ciphertext before the initial plaintext returns, where k | n, k > 1 and (n-1) | (k^i-1).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Each number in this sequence is the number of times a scytale has to be fed with its own ciphertext until the apparatus generates back the initial plaintext because for every n/m integer, n > m > 1 and every integer i > 1, n^x mod (m-1) != n^i+1 mod (m-1). Tertium non datur: if n^i mod (m-1) = n^i+1 mod (m-1), i = i + 1, an absurdity. And this is why a recursive scytale does not freeze. Moreover, according to modular arithmetic, if n mod m = 1, then n +- (i*m) mod m = 1. This is why after a certain number of iterations the scytale returns the initial plaintext. Finally, for every integer y > 1, if n^i mod (m-1) = 1, then n^(y*i) mod (m-1) = 1, i < y*i. And this is why there is a first number of iterations for returning the initial plaintext, QED.

Examples

			Irregular triangle begins:
  00|01|02|03|04|05|06|...
  01|  |  |  |  |  |  |
  02|  |  |  |  |  |  |
  03|  |  |  |  |  |  |
  04|  | 2|  |  |  |  |
  05|  |  |  |  |  |  |
  06|  | 4| 4|  |  |  |
  07|  |  |  |  |  |  |
  08|  | 3|  | 3|  |  |
  09|  |  | 2|  |  |  |
  10|  | 6|  |  | 6|  |
  11|  |  |  |  |  |  |
  12|  |10| 5| 5|  |10|
  13|  |  |  |  |  |  |
  ...
		

References

  • Rodrigo Panchiniak Fernandes, OpenPGPjs in Drupal: Practical Privacy-Driven Web Development, Apress (Springer), 2021, 35-40. (in press)

Crossrefs

Row n is contained in row n-1 of A216327.
Cf. A139366.

Programs

  • JavaScript
    // m = 1..10000
    let n = 0n;
    let a = [];
    for (let m = 1n; m < 10001n; m = m + 1n){
      for (let k = 2n; k <= m; k = k + 1n){
        if ((m % k) == 0n){
          let xmod = 1n;
          for (let x = 1n; xmod != 0n; x = x + 1n){
            xmod = ((k ** x) - 1n) % (m - 1n);
            if (xmod == 0n && x != 1n){
              a[n] = x;
              n++;
            }
          }
        }
      }
    }
    console.info(a.join(','));
    
  • Maple
    with(numtheory): seq(seq(order(d,n-1), d in divisors(n) minus {1,n}), n=1..60); # Ridouane Oudra, Apr 03 2025
  • PARI
    row(n)={if(n==1, [], my(v=divisors(n)); vector(#v, i, znorder(Mod(v[i], n-1))))} \\ Andrew Howroyd, Mar 23 2021

Formula

Let n and k represent the length of the message and the number of sides of the scytale, respectively, with 1 < k < n. For each k that divides n, T(n,k) is the minimum integer i, 1 < i < n, such that n-1 divides k^i - 1.
T(n,k) = A139366(n-1,k), with k|n and 1 < k < n. - Ridouane Oudra, Apr 03 2025
Showing 1-4 of 4 results.