OFFSET
1,1
COMMENTS
EXAMPLE
n | The n iterations
--+------------------------------------------------------
1 | 3 -> 3/2
2 | 21 -> 7 -> 7/3
3 | 345 -> 69 -> 23 -> 23/4
4 | 10625 -> 2125 -> 425 -> 85 -> 85/4
5 | 74375 -> 10625 -> 2125 -> 425 -> 85 -> 85/4
6 | 860625 -> 95625 -> 10625 -> 2125 -> 425 -> 85 -> 85/4
MATHEMATICA
s[n_] := s[n] = Module[{bw = DigitCount[n, 2, 1]}, If[bw == 1, 0, If[!Divisible[n, bw], 1, 1 + s[n/bw]]]]; seq[len_] := Module[{v = Table[0, {len}], c = 0, k = 3, i}, While[c < len, i = s[k]; If[v[[i]] == 0, c++; v[[i]] = k]; k += 2]; v]; seq[5]
PROG
(PARI) s(n) = {my(w = hammingweight(n)); if(w == 1, 0, if(n % w, 1, 1 + s(n/w))); }
lista(len) = {my(v = vector(len), c = 0, k = 3, i); while(c < len, i = s(k); if(v[i] == 0, c++; v[i] = k); k += 2); v; }
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Amiram Eldar, Sep 30 2024
STATUS
approved