Thursday, May 9, 2024

A366136 Contribution to the OEIS

 

A366136Minimal number of factorials or their negatives that add to n.2
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 (listgraphrefslistenhistoryedittextinternal 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
Sequence in context: A204018 A261915 A109037 * A366693 A147680 A192895
KEYWORD
nonn,look
AUTHOR
James C. McMahon, Sep 30 2023
STATUS
approved

No comments:

Post a Comment

Hongkonger Mathematicians

(Image: https://www.iconfinder.com/search/icons?family=flagikon) This is a short list of famous Hongkonger mathematicians. I invite readers ...

Popular in last 30 days