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

A008328 Number of divisors of prime(n)-1.

Original entry on oeis.org

1, 2, 3, 4, 4, 6, 5, 6, 4, 6, 8, 9, 8, 8, 4, 6, 4, 12, 8, 8, 12, 8, 4, 8, 12, 9, 8, 4, 12, 10, 12, 8, 8, 8, 6, 12, 12, 10, 4, 6, 4, 18, 8, 14, 9, 12, 16, 8, 4, 12, 8, 8, 20, 8, 9, 4, 6, 16, 12, 16, 8, 6, 12, 8, 16, 6, 16, 20, 4, 12, 12, 4, 8, 12, 16, 4, 6, 18, 15, 16, 8, 24, 8
Offset: 1

Views

Author

Keywords

Comments

Also the number of irreducible factors of Phi(p,x)-1, for cyclotomic polynomial Phi(p,x) and prime p. The formula is Phi(p,x)-1 = x*Product_{n>1, n|p-1} Phi(n,x). - T. D. Noe, Oct 17 2003

Crossrefs

Programs

  • Maple
    for i from 1 to 500 do if isprime(i) then print(tau(i-1)); fi; od;
    A008328 := proc(n)
        numtheory[tau](ithprime(n)-1) ;
    end proc: # R. J. Mathar, Oct 30 2015
  • Mathematica
    DivisorSigma[0,#-1]&/@Prime[Range[90]] (* Harvey P. Dale, Dec 08 2011 *)
  • PARI
    a(n) = numdiv(prime(n)-1); \\ Michel Marcus, Feb 25 2021

Formula

a(n) = A000005(A006093(n)) = A066800(prime(n)). - R. J. Mathar, Oct 01 2017
From Amiram Eldar, Apr 16 2024: (Start)
Formulas from Prachar (1955):
Sum_{prime(n) < x} a(n) = x * log(log(x)) + B*x + O(x/log(x)), where B is a constant.
There is a constant c > 0 such that for infinitely many values of n we have a(n) > exp(c * log(prime(n))/log(log(prime(n)))). (End)

A066799 Square array read by antidiagonals of eventual period of powers of k mod n; period of repeating digits of 1/n in base k.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Dec 20 2001

Keywords

Comments

The determinant of the n X n matrix made from the northwest corner of this array is 0^(n-1). - Iain Fox, Mar 12 2018

Examples

			Rows start: 1,1,1,1,1,...; 1,1,1,1,1,...; 1,2,1,1,2,...; 1,1,2,1,1; 1,4,4,2,1,... T(3,2)=2 since the powers of 2 become 1,2,1,2,1,2,... mod 3 with period 2. T(4,2)=1 since the powers of 2 become 1,2,0,0,0,0,... mod 4 with eventual period 1.
Beginning of array:
+-----+--------------------------------------------------------------------
| n\k |  1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  ...
+-----+--------------------------------------------------------------------
|  1  |  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, ...
|  2  |  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, ...
|  3  |  1,  2,  1,  1,  2,  1,  1,  2,  1,  1,  2,  1,  1,  2,  1,  1, ...
|  4  |  1,  1,  2,  1,  1,  1,  2,  1,  1,  1,  2,  1,  1,  1,  2,  1, ...
|  5  |  1,  4,  4,  2,  1,  1,  4,  4,  2,  1,  1,  4,  4,  2,  1,  1, ...
|  6  |  1,  2,  1,  1,  2,  1,  1,  2,  1,  1,  2,  1,  1,  2,  1,  1, ...
|  7  |  1,  3,  6,  3,  6,  2,  1,  1,  3,  6,  3,  6,  2,  1,  1,  3, ...
|  8  |  1,  1,  2,  1,  2,  1,  2,  1,  1,  1,  2,  1,  2,  1,  2,  1, ...
| ... |
		

Crossrefs

Columns are A000012, A007733, A007734, A007735, A007736, A007737, A007738, A007739, A007740, A007732. A002322 is the highest value in each row and the least common multiple of each row, while the number of distinct values in each row is A066800.

Programs

  • Mathematica
    t[n_, k_] := For[p = PowerMod[k, n, n]; m = n + 1, True, m++, If[PowerMod[k, m, n] == p, Return[m - n]]]; Flatten[Table[t[n - k + 1, k], {n, 1, 14}, {k, n, 1, -1}]] (* Jean-François Alcover, Jun 04 2012 *)
  • PARI
    a(n, k) = my(p=k^n%n); for(m=n+1, +oo, if(k^m%n==p, return(m-n))) \\ Iain Fox, Mar 12 2018

Formula

T(n, k) = T(n, k-n) if k > n.
T(n, n) = T(n, n+1) = 1.
T(n, n-1) = 2.

A265120 Irregular array read by rows: Row n gives the number of elements in the multiplicative group mod n, (Z/nZ, *), that have order d for each divisor d of the exponent of the group.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 3, 1, 1, 2, 2, 1, 1, 2, 1, 1, 4, 4, 1, 3, 1, 1, 2, 2, 2, 4, 1, 1, 2, 2, 1, 3, 4, 1, 3, 4, 1, 1, 2, 4, 8, 1, 1, 2, 2, 1, 1, 2, 2, 6, 6, 1, 3, 4, 1, 3, 2, 6, 1, 1, 4, 4, 1, 1, 10, 10, 1, 7, 1, 1, 2, 4, 4, 8
Offset: 2

Views

Author

Geoffrey Critzer, Dec 01 2015

Keywords

Comments

The exponent of the multiplicative group mod n is Carmichael lambda(n) given in A002322.
The row lengths are tau(lambda(n)) = A000005(A002322(n)) = A066800(n).
The invariant factor decomposition of (Z/nZ,*) is given in A258446.
The row sums are phi(n) = A000010(n).
It appears that column 2 is A155828.

Examples

			{1}
{1, 1}
{1, 1}
{1, 1, 2}
{1, 1}
{1, 1, 2, 2}
{1, 3}
{1, 1, 2, 2}
{1, 1, 2}
{1, 1, 4, 4}
{1, 3}
{1, 1, 2, 2, 2, 4}
{1, 1, 2, 2}
{1, 3, 4}
{1, 3, 4}
{1, 1, 2, 4, 8}
{1, 1, 2, 2}
{1, 1, 2, 2, 6, 6}
{1, 3, 4}
{1, 3, 2, 6}
{1, 1, 4, 4}
{1, 1, 10, 10}
{1, 7},
{1, 1, 2, 4, 4, 8}
The row for n=21 reads: 1,3,2,6 because the multiplicative group mod 21,  (Z/21*Z,*) is isomorphic to C_6 X C_2. The exponent of this group is 6. This group contains one element of order 1, three elements of order 2, two elements of order 3, and six elements of order 6.
		

Crossrefs

Programs

  • Mathematica
    f[{p_, e_}] := {FactorInteger[p - 1][[All, 1]]^
        FactorInteger[p - 1][[All, 2]],
       FactorInteger[p^(e - 1)][[All, 1]]^
        FactorInteger[p^(e - 1)][[All, 2]]};
    fun[lst_] :=
    Module[{int, num, res},
      int = Sort /@ GatherBy[Join @@ (FactorInteger /@ lst), First];
      num = Times @@ Power @@@ (Last@# & /@ int);
      res = Flatten[Map[Power @@ # &, Most /@ int, {2}]];
      {num, res}]
    rec[lt_] :=
    First@NestWhile[{Append[#[[1]], fun[#[[2]]][[1]]],
         fun[#[[2]]][[2]]} &, {{}, lt}, Length[#[[2]]] > 0 &];
    t[list_] :=
    Table[Count[Map[PermutationOrder, GroupElements[AbelianGroup[list]]],
        d], {d, Divisors[First[list]]}];
    Map[t, Table[
       If[! IntegerQ[n/8],
        DeleteCases[rec[Flatten[Map[f, FactorInteger[n]]]], 1],
        DeleteCases[
         rec[Join[{2, 2^(FactorInteger[n][[1, 2]] - 2)},
           Flatten[Map[f, Drop[FactorInteger[n], 1]]]]], 1]], {n, 2,
        25}] /. {} -> {1}]
Showing 1-3 of 3 results.