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.

A233519 The number of times x^x == x (mod prime(n)) for x in 0 < x < prime(n).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 2, 2, 2, 3, 2, 5, 3, 2, 1, 1, 4, 3, 2, 5, 4, 1, 4, 5, 3, 4, 1, 2, 5, 5, 3, 5, 4, 2, 5, 7, 3, 2, 2, 1, 5, 3, 9, 3, 7, 6, 2, 1, 2, 6, 3, 8, 5, 5, 2, 1, 8, 3, 10, 2, 1, 8, 6, 9, 1, 9, 12, 1, 5, 5, 2, 4, 6, 6, 2, 1, 4, 5, 9, 4, 4, 3, 6, 4, 5, 6
Offset: 1

Views

Author

T. D. Noe, Feb 19 2014

Keywords

Comments

This is A065295 restricted to the primes. The plot is significantly different.

Crossrefs

Programs

  • Mathematica
    f[p_] := Module[{x = Range[p - 1]}, Count[PowerMod[x, x, p] - x, 0]]; Table[f[n], {n, Prime[Range[100]]}]

A233520 The number of distinct values of x^x (mod n) - x for x in 0 < x < n.

Original entry on oeis.org

0, 1, 2, 2, 4, 2, 5, 4, 5, 5, 6, 4, 10, 7, 8, 9, 11, 5, 12, 9, 12, 10, 15, 9, 14, 12, 14, 12, 19, 11, 21, 19, 18, 16, 19, 12, 28, 18, 18, 18, 30, 13, 33, 20, 22, 23, 36, 18, 28, 20, 23, 27, 39, 17, 35, 24, 32, 30, 43, 20, 46, 33, 26, 37, 37, 22, 49, 34, 34, 30
Offset: 1

Views

Author

T. D. Noe, Feb 19 2014

Keywords

Comments

According to Kurlberg et al. (who quote Crocker and Somer), for primes p, the count is between floor(sqrt((p-1)/2)) and 3p/4 + O(p^(1/2 + o(1))).
Note that the subtraction is not done mod n. - Robert Israel, Dec 17 2014

Examples

			For n = 5 the a(5) = 4 values are 1-1=0, 4-2=2, 2-3=-1, 1-4=-3. - _Robert Israel_, Dec 17 2014
		

Crossrefs

Programs

  • Maple
    f:= n -> nops({seq((x &^ x mod n - x) , x = 1 .. n-1)}):
    seq(f(n), n=1..100); # Robert Israel, Dec 17 2014
  • Mathematica
    fs[p_] := Module[{x = Range[p - 1]}, Length[Union[PowerMod[x, x, p] - x]]]; Table[fs[n], {n, 100}]
  • PARI
    a(n) = #Set(vector(n-1, j, lift(Mod(j, n)^j) - j)); \\ Michel Marcus, Dec 16 2014

A233521 Number of disjoint subsets s of 0..(n-1) such that, for every x in s, x^x (mod n) is in s.

Original entry on oeis.org

1, 1, 1, 2, 1, 4, 2, 4, 3, 5, 1, 7, 2, 5, 7, 7, 3, 9, 2, 10, 8, 7, 3, 13, 5, 10, 5, 13, 3, 15, 4, 11, 9, 10, 9, 15, 2, 7, 12, 19, 6, 20, 4, 12, 15, 7, 4, 22, 11, 16, 12, 15, 2, 16, 14, 18, 10, 9, 1, 30, 7, 8, 22, 19, 16, 21, 4, 17, 9, 23, 4, 27, 5, 10, 19, 14, 14
Offset: 1

Views

Author

T. D. Noe, Feb 19 2014

Keywords

Comments

This is very loosely based on the work of Kurlberg et al. It appears that a(n) = 1 at only six n: 1, 2, 3, 5, 11, 59.

Examples

			The simplest nontrivial case is n = 4. In this case, a(4) = 2 because there are two subsets: {0,1,2} and {3}. Note that 0^0 == 1 (mod 4), 1^1 == 1 (mod 4), 2^2 == 0 (mod 4), and 3^3 == 3 (mod 4).
		

Crossrefs

Programs

  • Mathematica
    Table[toDo = Range[0, n-1]; sets = {}; While[Length[toDo] > 0, k = toDo[[1]]; toDo = Rest[toDo]; lst = {k}; While[q = PowerMod[k, k, n]; ! MemberQ[lst, q], AppendTo[lst, q]; toDo = Complement[toDo, {q}]; k = q]; AppendTo[sets, lst]]; Do[int = Intersection[sets[[i]], sets[[j]]]; If[int != {}, sets[[i]] = Union[sets[[i]], sets[[j]]]; sets[[j]] = {}], {i, Length[sets]}, {j, i+1, Length[sets]}]; Length[DeleteCases[sets, {}]], {n, 100}]
Showing 1-3 of 3 results.