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.

Previous Showing 21-24 of 24 results.

A174621 a(n) is the smallest generator for the group of numbers relatively prime to n under multiplication mod n; a(n) = -1 if n is not a power of a prime or twice a power of a prime.

Original entry on oeis.org

1, 2, 3, 2, 5, 3, -1, 2, 3, 2, -1, 2, 3, -1, -1, 3, 5, 2, -1, -1, 7, 5, -1, 2, 7, 2, -1, 2, -1, 3, -1, -1, 3, -1, -1, 2, 3, -1, -1, 6, -1, 3, -1, -1, 5, 5, -1, 3, 3, -1, -1, 2, 5, -1, -1, -1, 3, 2, -1, 2, 3, -1, -1, -1, -1, 2, -1, -1, -1, 7, -1, 5, 5, -1, -1, -1, -1, 3, -1, 2, 7, 2, -1, -1, 3, -1, -1, 3, -1, -1, -1, -1, 5, -1, -1, 5, 3, -1, -1
Offset: 2

Views

Author

Keywords

Comments

Same as A046145, except for taking -1 instead of 0. - Joerg Arndt, Jan 16 2015

Crossrefs

Cf. A046145.

Programs

  • Maple
    subs(FAIL=-1, [seq(numtheory:-primroot(n), n=2..1000)]); # Robert Israel, Jan 11 2015
  • Mathematica
    lst = {}; f[n_] := PrimitiveRoot[n]; Do[If[IntegerQ@f[n], g = f[n], g = -1]; AppendTo[lst, g], {n, 2, 73}]; Prepend[lst, -1]

Extensions

Name changed by Arkadiusz Wesolowski, Jul 19 2012
Offset changed and ambiguous term a(0) removed by Arkadiusz Wesolowski, Jul 20 2012
a(1) removed by Joerg Arndt, Jan 11 2015

A251865 Irregular triangle read by rows in which row n lists the maximal-order elements (

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 5, 3, 5, 3, 5, 7, 2, 5, 3, 7, 2, 6, 7, 8, 5, 7, 11, 2, 6, 7, 11, 3, 5, 2, 7, 8, 13, 3, 5, 11, 13, 3, 5, 6, 7, 10, 11, 12, 14, 5, 11, 2, 3, 10, 13, 14, 15, 3, 7, 13, 17, 2, 5, 10, 11, 17, 19, 7, 13, 17, 19, 5, 7, 10, 11, 14, 15, 17, 19, 20, 21, 5, 7, 11, 13, 17, 19, 23, 2, 3, 8, 12, 13, 17, 22, 23
Offset: 1

Views

Author

Eric Chen, May 20 2015

Keywords

Comments

Conjecture: Triangle contains all nonsquare numbers infinitely many times.
The orders of the numbers in n-th row mod n are equal to A002322(n).
First and last terms of the n-th row are A111076(n) and A247176(n).
Length of the n-th row is A111725(n).
The n-th row is the same as A046147 for n with primitive roots.

Examples

			Read by rows:
n     maximal-order elements (<n) mod n
1     0
2     1
3     2
4     3
5     2, 3
6     5
7     3, 5
8     3, 5, 7
9     2, 5
10    3, 7
11    2, 6, 7, 8
12    5, 7, 11
13    2, 6, 7, 11
14    3, 5
15    2, 7, 8, 13
16    3, 5, 11, 13
17    3, 5, 6, 7, 10, 11, 12, 14
18    5, 11
19    2, 3, 10, 13, 14, 15
20    3, 7, 13, 17
etc.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Select[Range[0, n-1], GCD[#, n] == 1 && MultiplicativeOrder[#, n] == CarmichaelLambda[n]& ]; Table[a[n], {n, 1, 36}]
  • PARI
    c(n)=lcm((znstar(n))[2])
    a(n)=for(k=0,n-1,if(gcd(k, n)==1 && znorder(Mod(k,n))==c(n), print1(k, ",")))
    n=1; while(n<37, a(n); n++)

A248207 Primitive root of the multiplicative group mod n as returned by PARI version 2.7.2, or 0 when there is no primitive root.

Original entry on oeis.org

1, 2, 3, 2, 5, 3, 0, 2, 7, 2, 0, 2, 3, 0, 0, 3, 11, 2, 0, 0, 13, 5, 0, 2, 15, 2, 0, 2, 0, 3, 0, 0, 3, 0, 0, 2, 21, 0, 0, 6, 0, 3, 0, 0, 5, 5, 0, 3, 27, 0, 0, 2, 29, 0, 0, 0, 31, 2, 0, 2, 3, 0, 0, 0, 0, 2, 0, 0, 0, 7, 0, 5, 39, 0, 0, 0, 0, 3, 0, 2, 47, 2, 0, 0, 3, 0, 0, 3, 0, 0, 0, 0, 5, 0, 0, 5, 3, 0, 0
Offset: 2

Views

Author

Joerg Arndt, Jan 11 2015

Keywords

Crossrefs

Cf. A174621 (smallest primitive root, taking -1 for n with no primitive root).
Cf. A046145 (smallest primitive root, taking 0 for n with no primitive root).

Programs

  • PARI
    a(n) = if(#znstar(n)[3]>1,0,lift(znprimroot(n)));
    vector(99,n,a(n+1))

A259484 Smallest nonprime number having least positive primitive root n, or 0 if no such root exists.

Original entry on oeis.org

1, 0, 9, 4, 0, 6, 1681, 22, 0, 0, 97969, 118, 16900321, 914, 1062961, 542, 0, 262, 2827367929, 382
Offset: 0

Views

Author

Robert G. Wilson v, Jun 28 2015

Keywords

Comments

The value 0 at indices 4, 8, 9, 16, ..., says 0 has no primitive roots (A001597), but the 0 at index 1 says 1 has a primitive root of 0, the only real 0 in the sequence.
a(n) cannot be 2, 4, the odd power of a prime or twice the odd power of a prime.
Conjecture: each odd-indexed value will be populated before either of its even-indexed neighbors.

Examples

			a(2) = 9 because the least primitive root of the nonprime number 9 is 2 and no nonprime less than 9 meets this criterion.
		

References

  • A. E. Western and J. C. P. Miller, Tables of Indices and Primitive Roots. Royal Society Mathematical Tables, Vol. 9, Cambridge Univ. Press, 1968, p. XLIV.

Crossrefs

Programs

  • Mathematica
    smallestPrimitiveRoot[n_ /; n <= 1] = 0; smallestPrimitiveRoot[n_] := Block[{pr = PrimitiveRoot[n], g}, If[ !NumericQ[pr], g = 0, g = 1; While[g <= pr, If[ CoprimeQ[g, n] && MultiplicativeOrder[g, n] == EulerPhi[n], Break[]]; g++]]; g]; (* This part of the code is from Jean-François Alcover as found in A046145, Feb 15 2012 *)
    t = Table[-1, {1000}];  ppQ[n_] := GCD @@ Last /@ FactorInteger@ n > 1; ppQ[1] = True; k = 1; While[ k < 1001, If[ ppQ@ k, t[[k]] = 0]; k++]; k = 1; While[k < 200000001, If[ !PrimeQ[k], a = smallestPrimitiveRoot[k]; If[ t[[a]] == -1, t[[a]] = k]]; k++]; t

Formula

a(n) = 0 if n is a perfect power (A001597).

Extensions

a(18)-a(19) from Robert G. Wilson v, Sep 26 2015
Previous Showing 21-24 of 24 results.