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-10 of 22 results. Next

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

Original entry on oeis.org

0, 1, 2, 1, 4, 4, 6, 1, 8, 9, 10, 9, 12, 11, 14, 1, 16, 10, 18, 16, 20, 20, 22, 16, 24, 25, 26, 25, 28, 25, 30, 1, 32, 33, 34, 28, 36, 36, 38, 25, 40, 36, 42, 37, 44, 41, 46, 33, 48, 49, 50, 48, 52, 28, 54, 49, 56, 57, 58, 45, 60, 59, 62, 1, 64, 64, 66, 64, 68
Offset: 1

Views

Author

Michel Lagneau, Sep 27 2011

Keywords

Comments

a(n) = 1 if n is of the form 2^p and a(n) = n-1 if n prime.

Examples

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

Crossrefs

Programs

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

A365100 Number of distinct residues of x^n (mod n^3), x=0..n^3-1.

Original entry on oeis.org

1, 3, 7, 6, 21, 8, 43, 18, 55, 22, 111, 20, 157, 44, 147, 65, 273, 56, 343, 30, 105, 112, 507, 68, 501, 158, 487, 110, 813, 88, 931, 257, 777, 274, 903, 140, 1333, 344, 371, 102, 1641, 64, 1807, 280, 1155, 508, 2163, 260, 2059, 502, 1911, 200, 2757, 488, 483, 374, 805, 814
Offset: 1

Views

Author

Albert Mukovskiy, Aug 21 2023

Keywords

Crossrefs

Programs

  • PARI
    a(n) = #Set(vector(n^3, x, Mod(x-1,n^3)^n)); \\ Michel Marcus, Aug 22 2023
    
  • Python
    def A365100(n): return len({pow(x,n,n**3) for x in range(n**3)}) # Chai Wah Wu, Aug 23 2023

A365101 Number of distinct residues of x^n (mod n^4), x=0..n^4-1.

Original entry on oeis.org

1, 4, 21, 18, 101, 30, 295, 130, 487, 153, 1211, 170, 2029, 444, 1919, 1025, 4625, 732, 6499, 442, 1881, 1818, 11639, 1290, 12501, 3045, 13123, 2516, 23549, 1530, 28831, 8193, 23009, 6939, 29795, 4148, 49285, 9750, 12863, 3354, 67241, 1500, 77659, 10302, 49187, 17460, 101615
Offset: 1

Views

Author

Albert Mukovskiy, Aug 21 2023

Keywords

Crossrefs

Programs

  • PARI
    a(n) = #Set(vector(n^4, x, Mod(x-1,n^4)^n)); \\ Michel Marcus, Aug 22 2023
    
  • Python
    def A365101(n): return len({pow(x,n,n**4) for x in range(n**4)}) # Chai Wah Wu, Aug 23 2023

A365103 Number of distinct quartic residues x^4 (mod 4^n), x=0..4^n-1.

Original entry on oeis.org

1, 2, 2, 6, 18, 70, 274, 1094, 4370, 17478, 69906, 279622, 1118482, 4473926, 17895698, 71582790, 286331154, 1145324614, 4581298450, 18325193798, 73300775186, 293203100742, 1172812402962, 4691249611846, 18764998447378
Offset: 0

Views

Author

Albert Mukovskiy, Aug 24 2023

Keywords

Comments

a(n) = A364811(2n).
For n>=2, A319281(a(n)) == 4^n + [n mod 2 == 1].
For n>=2, a(n)=k: [ A319281(k) == 4^n + [n mod 2 == 1] ].

Crossrefs

Programs

  • Mathematica
    a[n_] = Ceiling[4^n/15] + Boole[Mod[n,2]==1]; Array[a, 24]
  • PARI
    a(n) = ceil(4^n/15)+(Mod(n,2)==1);
    
  • Python
    def A365103(n): return len({pow(x,4,1<<(n<<1)) for x in range(1<<(n<<1))}) # Chai Wah Wu, Sep 18 2023

Formula

a(n) = ceiling(4^n/15) + (n mod 2).

A365099 Number of distinct residues of x^n (mod n^2), x=0..n^2-1.

Original entry on oeis.org

1, 2, 3, 2, 5, 4, 7, 3, 7, 6, 11, 4, 13, 8, 15, 5, 17, 8, 19, 4, 9, 12, 23, 6, 21, 14, 19, 8, 29, 12, 31, 9, 33, 18, 35, 8, 37, 20, 15, 6, 41, 8, 43, 12, 35, 24, 47, 10, 43, 22, 51, 8, 53, 20, 15, 12, 21, 30, 59, 8, 61, 32, 21, 17, 65, 24, 67, 10, 69, 24, 71, 12, 73, 38, 63
Offset: 1

Views

Author

Albert Mukovskiy, Aug 21 2023

Keywords

Crossrefs

Programs

  • PARI
    a(n) = #Set(vector(n^2, x, Mod(x-1,n^2)^n)); \\ Michel Marcus, Aug 22 2023
    
  • Python
    def A365099(n): return len({pow(x,n,n**2) for x in range(n**2)}) # Chai Wah Wu, Aug 22 2023

A365102 Number of distinct residues of x^n (mod n^5), x=0..n^5-1.

Original entry on oeis.org

1, 7, 57, 70, 501, 140, 2059, 1029, 4377, 1255, 13311, 1820, 26365, 5150, 27555, 16386, 78609, 10940, 123463, 8190, 37785, 33280, 267675, 28700, 312501, 65915, 354295, 66950, 682893, 35140, 893731, 262145, 732105, 196525, 1031559, 142220, 1823509, 308660
Offset: 1

Views

Author

Albert Mukovskiy, Aug 22 2023

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=CountDistinct[Table[PowerMod[x-1,n,n^5],{x,0,n^5-1}]]; Array[a,38] (* Stefano Spezia, Aug 24 2023 *)
  • PARI
    a(n) = #Set(vector(n^5, x, Mod(x-1, n^5)^n));
    
  • Python
    def A365102(n): return len({pow(x,n,n**5) for x in range(n**5)}) # Chai Wah Wu, Aug 23 2023

A365104 Number of distinct quintic residues x^5 (mod 5^n), x=0..5^n-1.

Original entry on oeis.org

1, 5, 5, 21, 101, 501, 2505, 12505, 62521, 312601, 1563001, 7815005, 39075005, 195375021, 976875101, 4884375501, 24421877505, 122109387505, 610546937521, 3052734687601, 15263673438001, 76318367190005, 381591835950005, 1907959179750021, 9539795898750101, 47698979493750501, 238494897468752505, 1192474487343762505, 5962372436718812521, 29811862183594062601
Offset: 0

Views

Author

Albert Mukovskiy, Aug 24 2023

Keywords

Comments

It appears that for a prime p>2 the number of distinct residues x^p (mod p^n) is a(n) = (p-1)*p^(n-2) + a(n-p), with a(n<1)=1, a(1)=p.

Crossrefs

Programs

  • Mathematica
    a[n_]:=CountDistinct[Table[PowerMod[x-1, 5, 5^(n-1)], {x, 1, 5^(n-1)}]]; Array[a, 13]
  • Python
    def A365104(n): return len({pow(x,5,5**n) for x in range(5**n)}) # Chai Wah Wu, Sep 17 2023

Formula

For n >= 6, a(n) = 4*5^(n-2) + a(n-5) = 5*a(n-1) + a(n-5) - 5*a(n-6). O.g.f: (-5*x^5 - 4*x^4 - 4*x^3 - 20*x^2 + 1)/(5*x^6 - x^5 - 5*x + 1). - Max Alekseyev, Feb 19 2024

Extensions

Terms a(16) onward from Max Alekseyev, Feb 19 2024

A196546 Numbers n such that the sum of the distinct residues of x^n (mod n), x=0..n-1, is divisible by n.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 14, 15, 17, 19, 21, 22, 23, 25, 27, 28, 29, 30, 31, 33, 35, 37, 38, 39, 41, 43, 45, 46, 47, 49, 51, 52, 53, 55, 57, 59, 61, 62, 63, 65, 66, 67, 69, 70, 71, 73, 75, 77, 78, 79, 81, 83, 85, 86, 87, 89, 91, 92, 93, 94, 95, 97, 98, 99, 101
Offset: 1

Views

Author

Michel Lagneau, Oct 03 2011

Keywords

Comments

All odd prime numbers are in the sequence.
The sum of the distinct residues is 0, 1, 3, 1, 10, 8, 21, 1, 9, 25, 55, 14, 78, 42, 105, 1, 136,.. for n>=1.

Examples

			n= 14 is in the sequence because x^14 == 0, 1, 2, 4, 7, 8, 9, or 11 (mod 14), and the sum  0+1+2+4+7+8+9+11 = 42 is divisible by 14.
		

Crossrefs

Cf. A195637.

Programs

  • Maple
    sumDistRes := proc(n)
            local re,x,r ;
            re := {} ;
            for x from 0 to n-1 do
                    re := re union { modp(x^n,n) } ;
            end do:
            add(r,r=re) ;
    end proc:
    for n from 1 to 100 do
            if sumDistRes(n) mod n = 0 then
                    printf("%d,",n);
            end if;
    end do: # R. J. Mathar, Oct 04 2011
  • Mathematica
    sumDistRes[n_] := Module[{re = {}, x}, For[x = 0, x <= n-1, x++, re = re ~Union~ {PowerMod[x, n, n]}]; Total[re]];
    Select[Range[100], Mod[sumDistRes[#], #] == 0&] (* Jean-François Alcover, Oct 20 2023, after R. J. Mathar *)

A197929 Number of distinct residues of x^(n-1) (mod n), x=0..n-1.

Original entry on oeis.org

1, 2, 2, 3, 2, 6, 2, 5, 4, 10, 2, 9, 2, 14, 6, 9, 2, 14, 2, 15, 8, 22, 2, 15, 6, 26, 10, 9, 2, 30, 2, 17, 12, 34, 12, 21, 2, 38, 14, 25, 2, 42, 2, 33, 8, 46, 2, 27, 8, 42, 18, 15, 2, 38, 18, 35, 20, 58, 2, 45, 2, 62, 16, 33, 8, 18, 2, 51, 24, 30, 2, 35, 2, 74
Offset: 1

Views

Author

Michel Lagneau, Oct 19 2011

Keywords

Comments

a(n) = 2 if n prime because the residues are 0 and 1 (Fermat's little theorem).
a(n) = n if n = 2p, p prime > 2. But there exists nonprime numbers q such that a(2q) = 2q, for example q = 1, 15, 21, 39,...

Examples

			a(8) = 5 because x^7 == 0, 1, 3, 5, 7  (mod 8) => 5 distinct residues.
		

Crossrefs

Programs

  • Mathematica
    Length[Union[#]]& /@ Table[Mod[k^(n-1), n], {n, 74}, {k, n}]

A197930 Numbers n such that the number of distinct residues in x^(n-1) (mod n), x=0..n-1, equals n.

Original entry on oeis.org

1, 2, 6, 10, 14, 22, 26, 30, 34, 38, 42, 46, 58, 62, 74, 78, 82, 86, 94, 102, 106, 110, 114, 118, 122, 134, 138, 142, 146, 158, 166, 170, 174, 178, 182, 194, 202, 206, 210, 214, 218, 222, 226, 230, 254, 258, 262, 266, 274, 278, 282, 290, 298, 302, 314, 318
Offset: 1

Views

Author

Michel Lagneau, Oct 19 2011

Keywords

Comments

a(n) = n if n = 2p, p prime > 2, or n = 2q with q nonprime such that q = 1, 15, 21, 39, 51, 55, 57, 69, 85, 87, 91,…

Examples

			a(8) = 30 because x^29  == 0,1,2, …,28,29  (mod 30) with 30 distinct residues.
		

Crossrefs

Programs

  • Mathematica
    lst={}; Table[If[Length[Union[PowerMod[Range[0,n-1],n-1,n]]]==n, AppendTo[lst,n]], {n,320}]; lst
    Select[Range[400],Length[Union[PowerMod[Range[0,#-1],#-1,#]]]==#&] (* Harvey P. Dale, Nov 06 2016 *)

Formula

n such that A197929(n) = n.
Showing 1-10 of 22 results. Next