OFFSET
1,2
MATHEMATICA
n = 5; Table[a = Join[{1}, Table[0, {n - 1}]]; a = Mod[a, i]; a0 = a; k = 0; zeros = 0; While[k++; s = Mod[Plus @@ a, i]; a = RotateLeft[a]; If[s == 0, zeros++]; a[[n]] = s; a != a0]; zeros, {i, 100}]
PROG
(Python)
from itertools import count
def A193994(n):
a = b = (0, )*4+(1 % n, )
c, s = 0, 1 % n
for m in count(1):
b, s = b[1:] + (s, ), (s+s-b[0])% n
c += int(s==0)
if a == b:
return c # Chai Wah Wu, Feb 22-27 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Aug 18 2011
STATUS
approved