OFFSET
1,2
EXAMPLE
For n=3, 0->0 (cycle length 1), 1->1 (cycle length 1) and 2->1->2 (cycle length 2); 1+1+2 = 4.
The triangle of the cycle lengths is:
1 ;
1, 1 ;
1, 1, 2 ;
1, 1, 1, 2 ;
1, 1, 4, 4, 2 ;
1, 1, 2, 1, 1, 2 ;
1, 1, 3, 6, 3, 6, 2 ;
1, 1, 1, 2, 1, 2, 1, 2 ;
1, 1, 6, 1, 3, 6, 1, 3, 2 ;
1, 1, 4, 4, 2, 1, 1, 4, 4, 2 ;
MAPLE
A285055Tr := proc(n, m)
local a, nmap, cyc ;
nmap := n ;
cyc := [n] ;
for a from 1 do
nmap := modp(nmap*n, m) ;
if member(nmap, cyc, 'i') then
return nops(cyc)-i+1;
else
cyc := [op(cyc), nmap] ;
end if;
end do:
end proc:
A285055 := proc(m)
add(A285055Tr(n, m), n=0..m-1) ;
end proc:
seq(A285055(m), m=1..30) ; # R. J. Mathar, May 06 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Chad Brewbaker, Apr 08 2017
STATUS
approved