[go: up one dir, main page]

login
A333705
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
1, 2, 8, 21, 100, 204, 401, 3062, 5974, 11402, 22597, 22598, 43553, 85519, 166243, 1218380, 8854646, 248592083, 248592084, 485966511
OFFSET
1,2
COMMENTS
The corresponding quotients are 1, 1, 2, 3, 5, 6, 7, 10, 11, ...
No more terms below 3*10^9.
EXAMPLE
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.
MATHEMATICA
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];
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]]]]];
seq = {}; sum = 0; Do[sum += dualZeckSum[n]; If[Divisible[sum, n], AppendTo[seq, n]], {n, 1, 10^6}]; seq
KEYWORD
nonn,more
AUTHOR
Amiram Eldar, Apr 02 2020
STATUS
approved