OFFSET
1,1
COMMENTS
LINKS
Hillel Wayne, Table of n, a(n) for n = 1..1002
George Marsaglia, Random Number Generators, Journal of Modern Applied Statistical Methods, Volume 2, Issue 1 (2003).
Kenneth Shum, Cyclotomic cosets.
EXAMPLE
For a(4) the 8 cycles are:
(1 10 22 25 16 4)
(2 20 5 11 32 8)
(3 30 27 36 9 12)
(6 21 15 33 18 24)
(7 31 37 19 34 28)
(13)
(14 23 35 38 29 17)
(26)
PROG
(Python)
def get_num_orbits(n: int) -> int:
orbits = 0
mod = 10*n - 1
seen = set()
for i in range(1, mod):
if i not in seen:
seen.add(i)
orbits += 1
x = 10*i % mod
while x != i:
seen.add(x)
x = 10*x % mod
return orbits
(Python)
from sympy import totient, n_order, divisors
def A366494(n): return sum(totient(d)//n_order(10, d) for d in divisors(10*n-1, generator=True) if d>1) # Chai Wah Wu, Apr 09 2024
(PARI)
a(n)=sumdiv(10*n-1, d, eulerphi(d)/znorder(Mod(10, d)))-1;
vector(100, n, a(n-1)) \\ Joerg Arndt, Jan 22 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Hillel Wayne, Oct 10 2023
STATUS
approved