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.

A023140 Number of cycles of function f(x) = 8x mod n.

This page as a plain text file.
%I A023140 #23 Nov 20 2018 21:05:00
%S A023140 1,1,2,1,2,2,7,1,5,2,2,2,4,7,5,1,3,5,4,2,14,2,3,2,3,4,8,7,2,5,7,1,5,3,
%T A023140 14,5,4,4,11,2,3,14,4,2,14,3,3,2,13,3,8,4,2,8,5,7,11,2,2,5,4,7,35,1,
%U A023140 17,5,4,3,6,14,3,5,25,4,8,4,14,11,7,2,11,3,2,14,12,4,5,2,9,14,28,3,14,3,11,2,7
%N A023140 Number of cycles of function f(x) = 8x mod n.
%H A023140 T. D. Noe, <a href="/A023140/b023140.txt">Table of n, a(n) for n = 1..10000</a>
%F A023140 a(n) = Sum_{d|m} phi(d)/ord(8, d), where m is n with all factors of 2 removed. - _T. D. Noe_, Apr 21 2003
%F A023140 a(n) = (1/ord(8,m))*Sum_{j = 0..ord(8,m)-1} gcd(8^j - 1, m), where m is n with all factors of 2 removed. - _Nihar Prakash Gargava_, Nov 14 2018
%e A023140 a(10) = 2 because the function 8x mod 10 has the two cycles (0),(2,6,8,4).
%t A023140 CountFactors[p_, n_] := Module[{sum=0, m=n, d, f, i, ps, j}, ps=Transpose[FactorInteger[p]][[1]]; Do[While[Mod[m, ps[[j]]]==0, m/=ps[[j]]], {j, Length[ps]}]; d=Divisors[m]; Do[f=d[[i]]; sum+=EulerPhi[f]/MultiplicativeOrder[p, f], {i, Length[d]}]; sum]; Table[CountFactors[8, n], {n, 100}]
%Y A023140 Cf. A000374.
%Y A023140 Cf. A023135, A023136, A023137, A023138, A023139, A023141, A023142.
%K A023140 nonn
%O A023140 1,3
%A A023140 _David W. Wilson_