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.

A023153 Number of cycles of function f(x) = x^2 mod n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Not multiplicative; the smallest counterexample is a(63). - T. D. Noe, Nov 14 2006

References

  • Earle Blanton, Spencer Hurd and Judson McCranie, On the Digraph Defined by Squaring Mod m, When m Has Primitive Roots, Congressus Numerantium, vol. 82, 167-177, 1992.

Crossrefs

Cf. A023154-A023161 (cycles of the functions f(x)=x^k mod n for k=3..10).

Programs

  • Mathematica
    Table[Length[ConnectedComponents[Graph[Range[0,n-1],Table[UndirectedEdge[i,Mod[i^2,n]],{i,0,n-1}]]]],{n,100}] (* Keyang Li, Nov 04 2024 *)

Formula

In case (Z/nZ)^* is cyclic there is a formula (see Chasse and Rogers). Let C_m denote the cyclic group of order m. Let a(m) denote the number of cycles in the graph of C_m relative to the mapping f. Then the number of cycles equals a(m) = Sum_{d|n} phi(d)/ord_d(2). - Pieter Moree, Jul 04 2002