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

A196499 Numbers k such that the greatest residue of the congruence x^k (mod k) equals k-1 for x in [0..k-1].

Original entry on oeis.org

1, 2, 3, 5, 7, 9, 10, 11, 13, 15, 17, 19, 21, 23, 25, 26, 27, 29, 31, 33, 34, 35, 37, 39, 41, 43, 45, 47, 49, 50, 51, 53, 55, 57, 58, 59, 61, 63, 65, 67, 69, 71, 73, 74, 75, 77, 79, 81, 82, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 106, 107, 109, 111
Offset: 1

Views

Author

Michel Lagneau, Oct 13 2011

Keywords

Comments

All prime numbers are in the sequence.

Examples

			50 is in the sequence because the residues  of the congruence x^50 (mod 50) are {0, 1, 24, 25, 26, 49} and the greatest value is 50 - 1 = 49.
		

Crossrefs

Cf. A196082.

Programs

  • Mathematica
    lst := {}; Do[If[Max[Union[PowerMod[Range[0, n - 1], n, n]]] == n - 1, AppendTo[lst, n]], {n, 120}]; lst

A197943 Greatest residue of x^(n-1) (mod n), x=0..n-1.

Original entry on oeis.org

0, 1, 1, 3, 1, 5, 1, 7, 7, 9, 1, 11, 1, 13, 10, 15, 1, 17, 1, 19, 18, 21, 1, 23, 21, 25, 25, 27, 1, 29, 1, 31, 31, 33, 30, 35, 1, 37, 36, 39, 1, 41, 1, 43, 40, 45, 1, 47, 43, 49, 49, 51, 1, 53, 49, 55, 55, 57, 1, 59, 1, 61, 58, 63, 61, 65, 1, 67, 64, 69, 1, 71, 1, 73, 69, 75, 71, 77, 1, 79, 79, 81, 1, 83, 81, 85, 82, 87, 1, 89, 78
Offset: 1

Views

Author

Michel Lagneau, Oct 19 2011

Keywords

Comments

a(n) = 1 if n prime and a(n) = n-1 if n even.

Examples

			a(8) = 7 because x^7 == 0, 1, 3, 5, 7  (mod 8) => 7 is the greatest residue.
		

Crossrefs

Programs

  • Mathematica
    Table[Max[PowerMod[Range[0,n-1],n-1,n]], {n,100}]
  • PARI
    A197943(n) = { my(m=0); for(x=0,n-1, m = max(m,lift(Mod(x^(n-1),n)))); (m); }; \\ Antti Karttunen, Sep 10 2018

Extensions

More terms added, incorrect PARI-program removed by Antti Karttunen, Sep 10 2018

A198033 Greatest residue of x^n (mod 2n+1), x=0..2n.

Original entry on oeis.org

0, 2, 4, 6, 7, 10, 12, 14, 16, 18, 18, 22, 21, 26, 28, 30, 31, 34, 36, 38, 40, 42, 40, 46, 43, 50, 52, 54, 55, 58, 60, 62, 61, 66, 64, 70, 72, 74, 71, 78, 79, 82, 84, 86, 88, 90, 90, 94, 96, 98, 100, 102, 100, 106, 108, 110, 112, 114, 108, 118, 111, 122, 124
Offset: 0

Views

Author

Michel Lagneau, Oct 20 2011

Keywords

Comments

If 2n+1 is prime, a(n) = 2n. But there exists nonprime numbers of the form 2n+1 such that a(n) = 2n, for example n = 0, 7, 13, 17, 19, 25, 27, 31, 37, 42, …

Examples

			a(10) = 18 because x^10 == 0, 1, 4, 7, 9, 15, 16, 18 (mod 21) => 18 is the greatest residue.
		

Crossrefs

Programs

  • Mathematica
    Table[Max[Union[PowerMod[Range[0,2*n],n,2*n+1]]],{n,0,100}]

A202035 Greatest prime residue of x^n (mod n) for x=0..n-1, or 0 if no such prime exists.

Original entry on oeis.org

0, 0, 2, 0, 3, 3, 5, 0, 0, 5, 7, 0, 11, 11, 13, 0, 13, 0, 17, 5, 13, 11, 19, 0, 7, 23, 0, 0, 23, 19, 29, 0, 31, 19, 31, 0, 31, 23, 31, 0, 37, 7, 41, 37, 37, 41, 43, 0, 31, 0, 47, 29, 47, 0, 43, 0, 37, 53, 53, 0, 59, 59, 0, 0, 61, 37, 61, 17, 67, 29, 67, 0, 71
Offset: 1

Views

Author

Michel Lagneau, Dec 09 2011

Keywords

Examples

			a(7) = 3  because  k^7 ==0, 1, 2, 3, 4, 5, 6 (mod 7) => 5 is the greatest prime.
		

Crossrefs

Programs

  • Maple
    for n from 1 to 100 do: W:={}:for k from 0 to n-1 do:z:= irem(k^n,n): if type(z,prime)=true then W:=W union {z}:else fi:od: x:=nops(W): if x<>0 then printf(`%d, `,W[x]): else printf(`%d, `,0):fi: od:

A202036 Smallest prime residue of x^n (mod n) for x=0..n-1, or 0 if no such prime exists.

Original entry on oeis.org

0, 0, 2, 0, 2, 3, 2, 0, 0, 5, 2, 0, 2, 2, 2, 0, 2, 0, 2, 5, 7, 3, 2, 0, 7, 3, 0, 0, 2, 19, 2, 0, 2, 2, 2, 0, 2, 5, 5, 0, 2, 7, 2, 5, 17, 2, 2, 0, 19, 0, 2, 13, 2, 0, 11, 0, 7, 5, 2, 0, 2, 2, 0, 0, 2, 3, 2, 13, 2, 11, 2, 0, 2, 3, 7, 5, 2, 13, 2, 0, 0, 2, 2, 0
Offset: 1

Views

Author

Michel Lagneau, Dec 09 2011

Keywords

Examples

			a(7) = 2 because k^7 == 0, 1, 2, 3, 4, 5, 6 (mod 7) => 2 is the smallest prime.
		

Crossrefs

Programs

  • Maple
    for n from 1 to 100 do: W:={}:for k from 0 to n-1 do:z:= irem(k^n,n): if type(z,prime)=true then W:=W union {z}:else fi:od: x:=nops(W): if x<>0 then printf(`%d, `,W[1]): else printf(`%d, `,0):fi: od:
  • Mathematica
    Table[SelectFirst[Sort[PowerMod[Range[n-1],n,n]],PrimeQ],{n,90}]/.Missing["NotFound"]->0 (* Harvey P. Dale, May 01 2023 *)
  • PARI
    A202036(n) = { my(z,y=n); for(x=1,n-1,z = lift(Mod(x,n)^n); if(isprime(z), y = min(z,y))); if(y==n,0,y); }; \\ - Antti Karttunen, May 19 2021

A197113 Nonprime numbers n such that the greatest residue of the congruence x^n (mod n) equals n-1 where x = 0..n-1.

Original entry on oeis.org

1, 9, 10, 15, 21, 25, 26, 27, 33, 34, 35, 39, 45, 49, 50, 51, 55, 57, 58, 63, 65, 69, 74, 75, 77, 81, 82, 85, 87, 91, 93, 95, 99, 105, 106, 111, 115, 117, 119, 121, 122, 123, 125, 129, 130, 133, 135, 141, 143, 145, 146, 147, 153, 155, 159, 161, 165, 169, 170
Offset: 1

Views

Author

Michel Lagneau, Oct 13 2011

Keywords

Comments

Subset of A196499.
For all primes n, the greatest residue of the congruence x^n (mod n) where x = 0..n-1 equals n-1.

Examples

			50 is in the sequence because the residues of the congruence x^50 (mod 50) are { 0, 1, 24, 25, 26, 49} and the greatest value is 50 - 1 = 49.
		

Crossrefs

Programs

  • Maple
    with(numtheory):T:=array(1..170): for n from 1 to 170 do:for k from 1 to n do:T[k]:=irem(k^n,n):od:W:=convert(T,set):x:=nops(W):if type(n,prime) = false and W[x]= n-1 then printf(`%d, `,n):else fi:od:
Showing 1-6 of 6 results.