| 0, 1, 1, 2, 2, 2, 1, 2, 2, 3, 3, 3, 2, 3, 3, 4, 3, 3, 2, 3, 3, 3, 2, 2, 1, 2, 2, 3, 3, 3, 2, 3, 3, 4, 4, 4, 3, 4, 4, 5, 4, 4, 3, 4, 4, 4, 3, 3, 2, 3, 3, 4, 4, 4, 3, 4, 4, 5, 5, 5, 4, 5, 5, 6, 5, 5, 4, 5, 5, 5, 4, 4, 3, 4, 4, 5, 5, 5, 4, 5, 5, 6, 5, 5, 4, 5, 5 (list; graph; refs; listen; history; edit; text; internal format) |
|
| OFFSET | 0,4 | | LINKS | | | EXAMPLE | 11 = 6 + 6 - 1 (three factorials), so a(11) = 3. 15 = 6 + 6 + 2 + 1 or 15 = 24 - 6 - 2 - 1 (four factorials), so a(15) = 4. | | MATHEMATICA | seq[m_] := Module[{s = Table[m!, {m!}], d, b, sum}, Do[d = PadLeft[Most@ IntegerDigits[k, MixedRadix[Range[m, 1, -1]]], m]; Do[b = 2*PadLeft[ IntegerDigits[i, 2], m] - 1; sum = Total[b * d * Range[m, 1, -1]!]; If[0 < sum <= m!, s[[sum]] = Min[s[[sum]], Total[d]]], {i, 1, 2^m - 1}], {k, 1, 2*m!}]; Join[{0}, s]]; seq[5] (* Amiram Eldar, Oct 03 2023 *) | | CROSSREFS | | | KEYWORD | | | AUTHOR | | | STATUS | approved |
|
No comments:
Post a Comment