login
Numbers k such that the total number of 1's in the dual Zeckendorf representation of the first k integers is a multiple of k.
3

%I #5 Apr 02 2020 19:30:52

%S 1,2,8,21,100,204,401,3062,5974,11402,22597,22598,43553,85519,166243,

%T 1218380,8854646,248592083,248592084,485966511

%N Numbers k such that the total number of 1's in the dual Zeckendorf representation of the first k integers is a multiple of k.

%C The corresponding quotients are 1, 1, 2, 3, 5, 6, 7, 10, 11, ...

%C No more terms below 3*10^9.

%e 8 is a term since the numbers 1, 2, ... 8 in the dual Zeckendorf representation are 1, 10, 11, 101, 110, 111, 1010, 1011, and the sum of their numbers of digits of 1 is 1 + 1 + 2 + 2 + 2 + 3 + 2 + 3 = 16 which is divisible by 8.

%t fibTerms[n_] := Module[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, fr = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[fr, 1]; t = t - Fibonacci[k], AppendTo[fr, 0]]; k--]; fr];

%t dualZeckSum[n_] := Module[{v = fibTerms[n]}, nv = Length[v]; i = 1; While[i <= nv - 2, If[v[[i]] == 1 && v[[i + 1]] == 0 && v[[i + 2]] == 0, v[[i]] = 0; v[[i + 1]] = 1; v[[i + 2]] = 1; If[i > 2, i -= 3]]; i++]; i = Position[v, _?(# > 0 &)]; If[i == {}, 0, Total[v[[i[[1, 1]] ;; -1]]]]];

%t seq = {}; sum = 0; Do[sum += dualZeckSum[n]; If[Divisible[sum, n], AppendTo[seq, n]], {n, 1, 10^6}]; seq

%Y Cf. A095376, A104326, A112310, A114136, A333702, A333703, A333704.

%K nonn,more

%O 1,2

%A _Amiram Eldar_, Apr 02 2020