[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of zeros in the period of Fibonacci 5-step sequence A001591 mod n.
1

%I #12 Feb 27 2022 11:52:29

%S 1,4,35,7,156,70,400,12,45,624,1580,61,2380,1600,5460,18,5220,33,684,

%T 1092,14000,6320,523,52,185,9520,48,2800,2465,10920,6075,22,55300,

%U 20880,62400,28,52060,464,83300,1872,70180,28000,1903,11060,7020,1046,22,79

%N Number of zeros in the period of Fibonacci 5-step sequence A001591 mod n.

%t 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}]

%o (Python)

%o from itertools import count

%o def A193994(n):

%o a = b = (0,)*4+(1 % n,)

%o c, s = 0, 1 % n

%o for m in count(1):

%o b, s = b[1:] + (s,), (s+s-b[0])% n

%o c += int(s==0)

%o if a == b:

%o return c # _Chai Wah Wu_, Feb 22-27 2022

%Y Cf. A106303 (period of Fibonacci 5-step sequence).

%K nonn

%O 1,2

%A _T. D. Noe_, Aug 18 2011