找回密码
 欢迎注册
楼主: 王守恩

[求助] 数码和是7倍数的n位数

[复制链接]
发表于 2024-11-25 22:11:34 | 显示全部楼层
Length[Select[Range[10^9, 10^10 - 1], Mod[Total@IntegerDigits@#, 10] == 0 &]] 暴力枚举太耗时,找递推公式即可
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2024-11-25 22:36:26 | 显示全部楼层
王守恩 发表于 2024-11-25 18:44
还是提问题。这样的10,11,12,13,...位数答案不踏实(1——9没问题)。
n位数, 各位数字之和等于n的倍数。

对于k位数,首位有1-9,9种选法,后面的k-1位有0-9 10种选法

  1. Table[Coefficient[( (x - x^10)  (1 - x^10)^(k - 1))/(1 - x)^k, x,
  2.   k], {k, 30}]
复制代码

{1,2,6,20,70,252,924,3432,12870,48619,184735,705222,2702609,10390940,40062132,154830696,599641425,2326640877,9042327525,35194002709,137160956815,535193552973,2090558951396,8174176541450,31990402045260,125301956523471,491168514123342,1926694512320176,7562801635932290,29704360002538662}
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2024-11-25 22:36:26 | 显示全部楼层
王守恩 发表于 2024-11-25 18:44
还是提问题。这样的10,11,12,13,...位数答案不踏实(1——9没问题)。
n位数, 各位数字之和等于n的倍数。

对于k位数,首位有1-9,9种选法,后面的k-1位有0-9 10种选法

  1. Table[Coefficient[( (x - x^10)  (1 - x^10)^(k - 1))/(1 - x)^k, x,
  2.   k], {k, 30}]
复制代码

{1,2,6,20,70,252,924,3432,12870,48619,184735,705222,2702609,10390940,40062132,154830696,599641425,2326640877,9042327525,35194002709,137160956815,535193552973,2090558951396,8174176541450,31990402045260,125301956523471,491168514123342,1926694512320176,7562801635932290,29704360002538662}
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2024-11-25 22:39:31 | 显示全部楼层
n位数, 各位数字之和等于n的倍数,展开后对1n-9n 项的系数求和即可

  1. Table[Sum[Coefficient[( (x-x^10) (1-x^10)^(k-1))/(1-x)^k,x,r k],{r,9}],{k,30}]
复制代码


{9,45,300,2249,18000,149991,1285774,11249985,100000000,900000000,8181818181,74999999501,692307584595,6428564424863,59999717638617,562491672466081,5293918597046695,49995907208582972,473609016175792282,4498733541313295104,42837232212522918635,408794838045095140277,3908837936775126273473,37442500308713197788969,359238774813254052475625,3451733981871081223676244,33210004769845318870361800,319908753084273214311674685,3085051810541178940946326518,29780804272800238762381211289}

点评

谢谢 elim !!! 很多数学思想(不是数学公式) 美得不得了! 把组合问题归结为多项式系数的思想了不起!  发表于 2024-11-26 05:02

评分

参与人数 1威望 +12 金币 +12 贡献 +12 经验 +12 鲜花 +12 收起 理由
王守恩 + 12 + 12 + 12 + 12 + 12

查看全部评分

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2024-11-26 17:07:14 | 显示全部楼层
这个帖子收获很大, 知识点有点多(慢慢消化),  回归主帖。

数码和是7倍数的n位数。

这样的1位数有1个。

这样的2位数有12个。

这样的3位数有126个。

这样的4位数有1282个。
......

{1, 12, 126, 1282, 12860, 128598, 1285774, 12857176, 128571220, 1285713534, 12857141804, 128571429416, 1285714293398, 12857142874408, 128571428581010, 1285714285653962,
12857142856925458, 128571428571124002, 1285714285714529960, 12857142857145079250, 128571428571433564458, 1285714285714288485208, 12857142857142839697416, ......

公式(1)。NestList[Dot[NestList[RotateRight, {2, 1, 1, 1, 1, 2, 2}, 6], #] &, {1, 2, 2, 1, 1, 1, 1}, 22][[All, 1]]

公式(2)。LinearRecurrence[{14, -49, 98, -84, 42, -21, 10}, {1, 12, 126, 1282, 12860, 128598, 1285774}, 23]

还可以有公式(3)吗?谢谢!
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2024-11-26 19:14:24 | 显示全部楼层
王守恩 发表于 2024-11-26 17:07
这个帖子收获很大, 知识点有点多(慢慢消化),  回归主帖。

数码和是7倍数的n位数。
  1. q=Sum[x^k,{k,9}];Table[Sum[Coefficient[q*(1+q)^(k-1),x,7 r],{r,9k/7}],{k,20}]
复制代码
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2024-11-27 16:00:33 | 显示全部楼层
(01)。数码和是1倍数的n位数。{9, 90, 900, 9000, 90000, 900000, 9000000, 90000000, 900000000, 9000000000, 90000000000, 900000000000, 9000000000000, 90000000000000, 900000000000000, 9000000000000000, 90000000000000000}
(02)。数码和是2倍数的n位数。{4, 45, 450, 4500, 45000, 450000, 4500000, 45000000, 450000000, 4500000000, 45000000000, 450000000000, 4500000000000, 45000000000000, 450000000000000, 4500000000000000, 45000000000000000}
(03)。数码和是3倍数的n位数。{3, 30, 300, 3000, 30000, 300000, 3000000, 30000000, 300000000, 3000000000, 30000000000, 300000000000, 3000000000000, 30000000000000, 300000000000000, 3000000000000000, 30000000000000000}
(04)。数码和是4倍数的n位数。{2, 22, 224, 2249, 22500, 225002, 2250004, 22500004, 225000000, 2249999992, 22499999984, 224999999984, 2250000000000, 22500000000032, 225000000000064, 2250000000000064, 22500000000000000}
(05)。数码和是5倍数的n位数。{1, 18, 180, 1800, 18000, 180000, 1800000, 18000000, 180000000, 1800000000, 18000000000, 180000000000, 1800000000000, 18000000000000, 180000000000000, 1800000000000000, 18000000000000000}
(06)。数码和是6倍数的n位数。{1, 14, 151, 1503, 14997, 149991, 1500009, 15000027, 149999973, 1499999919, 15000000081, 150000000243, 1499999999757, 14999999999271, 150000000000729, 1500000000002187, 14999999999997813}
(07)。数码和是7倍数的n位数。{1, 12, 126, 1282, 12860, 128598, 1285774, 12857176, 128571220, 1285713534, 12857141804, 128571429416, 1285714293398, 12857142874408, 128571428581010, 1285714285653962, 12857142856925458}
(08)。数码和是8倍数的n位数。{1, 11, 112, 1124, 11248, 112496, 1124992, 11249985, 112499976, 1124999972, 11249999992, 112500000074, 1125000000280, 11250000000692, 112500000001384, 1125000000002340, 11250000000003264}
(09)。数码和是9倍数的n位数。{1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000, 100000000000, 1000000000000, 10000000000000, 100000000000000, 1000000000000000, 10000000000000000}
(10)。数码和是10倍数的n位数。{0, 9, 90, 900, 9000, 90000, 900000, 9000000, 90000000, 900000000, 9000000000, 90000000000, 900000000000, 9000000000000, 90000000000000, 900000000000000, 9000000000000000, 90000000000000000}
(11)。数码和是11倍数的n位数。{0, 8, 82, 818, 8182, 81818, 818182, 8181818, 81818182, 818181818, 8181818181, 81818181819, 818181818182, 8181818181818, 81818181818182, 818181818181818, 8181818181818182, 81818181818181818}
(12)。数码和是12倍数的n位数。{0, 7, 76, 748, 7504, 74993, 749994, 7500059, 74999910, 750000001, 7500000200, 74999999501, 750000000944, 7499999999031, 74999999998090, 750000000009683, 7499999999984066, 75000000000005245}
(13)。数码和是13倍数的n位数。{0, 6, 72, 684, 6933, 69297, 692049, 6923265, 69231861, 692302884, 6923085159, 69230782122, 692307584595, 6923077148598, 69230769343458, 692307690281355, 6923076928701546, 69230769228514479}
(14)。数码和是14倍数的n位数。{0, 5, 70, 630, 6375, 64601, 642645, 6425599, 64297713, 642856767, 6428421494, 64286170240, 642857602231, 6428564424863, 64285730047092, 642857181352496, 6428571116489480, 64285714761152326}
(15)。数码和是15倍数的n位数。{0, 4, 69, 603, 5817, 60378, 602133, 5987904, 59994303, 600225342, 5999520723, 59997327243, 600015197949, 6000007240428, 59999717638617, 600000601182243, 6000003351236328, 59999980942125519}
(16)。数码和是16倍数的n位数。{0, 3, 66, 599, 5332, 55956, 569584, 5618444, 56103129, 562918205, 5627520744, 56235963162, 562469405642, 5625371327946, 56250000000692, 562491672466081, 5625015387280082, 56250158324512242}
(17)。数码和是17倍数的n位数。{0, 2, 61, 607, 5005, 51090, 539103, 5335482, 52635691, 528573446, 5303297495, 52955278635, 529146620809, 5293987371496, 52948567080626, 529408195240026, 5293918597046695, 52941466543240964}
(18)。数码和是18倍数的n位数。{0, 1, 54, 616, 4884, 46300, 503700, 5118916, 49881084, 496175516, 5003824484, 50123007764, 499876992236, 4996043649836, 50003956350164, 500127249814052, 4999872750185948, 49995907208582972}
(19)。数码和是19倍数的n位数。{0, 0, 45, 615, 4950, 42459, 461055, 4904064, 47998149, 468183583, 4708257444, 47541493289, 474905200991, 4731718185444, 47318535154702, 473822169622558, 4738808901078066, 47365330213246505}
(20)。数码和是20倍数的n位数。{0, 0, 36, 597, 5124, 40242, 415140, 4624980, 46674240, 448239640, 4428061744, 44928061744, 452795788288, 4508531241376, 44902816850752, 449457017475904, 4502885274370048, 45027958693108096}

  1. Table[Sum[Coefficient[Sum[x^k, {k, 9}] (Sum[x^k, {k, 9}] + 1)^(k - 1), x, a*r], {r, 9 k/a}], {a, 1, 16}, {k, 24}]
复制代码
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2024-11-27 16:50:48 | 显示全部楼层
王守恩 发表于 2024-11-17 15:42
通项公式可以有。就是太丑了。

(11)。数码和是11倍数的n位数。{0, 8, 82, 818, 8182, 81818, 818182, 8181818, 81818182, 818181818, 8181818181, 81818181819, 818181818182, 8181818181818, 81818181818182, 818181818181818, 8181818181818182, 81818181818181818}

只有(11)。数码和是11倍数的n位数。可以有类似34楼的通项公式。虽然丑一点。后面的数字串就是丑一点, 也没有了。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2024-11-29 13:12:01 | 显示全部楼层
mathe 发表于 2024-11-6 13:25
\(\begin{bmatrix}1&2&2&1&1&1&1\end{bmatrix} \begin{bmatrix}2&2&2&1&1&1&1\\1&2&2&2&1&1&1\\1&1&2&2&2&1 ...

谢谢 mathe!!! 这公式还是厉害些!
  1. Table[NestList[Dot[NestList[RotateRight, IntegerDigits[2^k + 2^9 - 1, 2, k + 1], k], #] &, IntegerDigits[2^k - 2^(k - 9), 2, k + 1], 17][[All, 1]], {k, 9, 28}]
复制代码

(01)。数码和是1倍数的n位数。{9, 90, 900, 9000, 90000, 900000, 9000000, 90000000, 900000000, 9000000000, 90000000000, 900000000000, 9000000000000, 90000000000000, 900000000000000, 9000000000000000, 90000000000000000}
(02)。数码和是2倍数的n位数。{4, 45, 450, 4500, 45000, 450000, 4500000, 45000000, 450000000, 4500000000, 45000000000, 450000000000, 4500000000000, 45000000000000, 450000000000000, 4500000000000000, 45000000000000000}
(03)。数码和是3倍数的n位数。{3, 30, 300, 3000, 30000, 300000, 3000000, 30000000, 300000000, 3000000000, 30000000000, 300000000000, 3000000000000, 30000000000000, 300000000000000, 3000000000000000, 30000000000000000}
(04)。数码和是4倍数的n位数。{2, 22, 224, 2249, 22500, 225002, 2250004, 22500004, 225000000, 2249999992, 22499999984, 224999999984, 2250000000000, 22500000000032, 225000000000064, 2250000000000064, 22500000000000000}
(05)。数码和是5倍数的n位数。{1, 18, 180, 1800, 18000, 180000, 1800000, 18000000, 180000000, 1800000000, 18000000000, 180000000000, 1800000000000, 18000000000000, 180000000000000, 1800000000000000, 18000000000000000}
(06)。数码和是6倍数的n位数。{1, 14, 151, 1503, 14997, 149991, 1500009, 15000027, 149999973, 1499999919, 15000000081, 150000000243, 1499999999757, 14999999999271, 150000000000729, 1500000000002187, 14999999999997813}
(07)。数码和是7倍数的n位数。{1, 12, 126, 1282, 12860, 128598, 1285774, 12857176, 128571220, 1285713534, 12857141804, 128571429416, 1285714293398, 12857142874408, 128571428581010, 1285714285653962, 12857142856925458}
(08)。数码和是8倍数的n位数。{1, 11, 112, 1124, 11248, 112496, 1124992, 11249985, 112499976, 1124999972, 11249999992, 112500000074, 1125000000280, 11250000000692, 112500000001384, 1125000000002340, 11250000000003264}
(09)。数码和是9倍数的n位数。{1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000, 100000000000, 1000000000000, 10000000000000, 100000000000000, 1000000000000000, 10000000000000000}
(10)。数码和是10倍数的n位数。{0, 9, 90, 900, 9000, 90000, 900000, 9000000, 90000000, 900000000, 9000000000, 90000000000, 900000000000, 9000000000000, 90000000000000, 900000000000000, 9000000000000000, 90000000000000000}
(11)。数码和是11倍数的n位数。{0, 8, 82, 818, 8182, 81818, 818182, 8181818, 81818182, 818181818, 8181818181, 81818181819, 818181818182, 8181818181818, 81818181818182, 818181818181818, 8181818181818182, 81818181818181818}
(12)。数码和是12倍数的n位数。{0, 7, 76, 748, 7504, 74993, 749994, 7500059, 74999910, 750000001, 7500000200, 74999999501, 750000000944, 7499999999031, 74999999998090, 750000000009683, 7499999999984066, 75000000000005245}
(13)。数码和是13倍数的n位数。{0, 6, 72, 684, 6933, 69297, 692049, 6923265, 69231861, 692302884, 6923085159, 69230782122, 692307584595, 6923077148598, 69230769343458, 692307690281355, 6923076928701546, 69230769228514479}
(14)。数码和是14倍数的n位数。{0, 5, 70, 630, 6375, 64601, 642645, 6425599, 64297713, 642856767, 6428421494, 64286170240, 642857602231, 6428564424863, 64285730047092, 642857181352496, 6428571116489480, 64285714761152326}
(15)。数码和是15倍数的n位数。{0, 4, 69, 603, 5817, 60378, 602133, 5987904, 59994303, 600225342, 5999520723, 59997327243, 600015197949, 6000007240428, 59999717638617, 600000601182243, 6000003351236328, 59999980942125519}
(16)。数码和是16倍数的n位数。{0, 3, 66, 599, 5332, 55956, 569584, 5618444, 56103129, 562918205, 5627520744, 56235963162, 562469405642, 5625371327946, 56250000000692, 562491672466081, 5625015387280082, 56250158324512242}
(17)。数码和是17倍数的n位数。{0, 2, 61, 607, 5005, 51090, 539103, 5335482, 52635691, 528573446, 5303297495, 52955278635, 529146620809, 5293987371496, 52948567080626, 529408195240026, 5293918597046695, 52941466543240964}
(18)。数码和是18倍数的n位数。{0, 1, 54, 616, 4884, 46300, 503700, 5118916, 49881084, 496175516, 5003824484, 50123007764, 499876992236, 4996043649836, 50003956350164, 500127249814052, 4999872750185948, 49995907208582972}
(19)。数码和是19倍数的n位数。{0, 0, 45, 615, 4950, 42459, 461055, 4904064, 47998149, 468183583, 4708257444, 47541493289, 474905200991, 4731718185444, 47318535154702, 473822169622558, 4738808901078066, 47365330213246505}
(20)。数码和是20倍数的n位数。{0, 0, 36, 597, 5124, 40242, 415140, 4624980, 46674240, 448239640, 4428061744, 44928061744, 452795788288, 4508531241376, 44902816850752, 449457017475904, 4502885274370048, 45027958693108096}
(21)。数码和是21倍数的n位数。{0, 0, 28, 564, 5318, 39814, 373327, 4257781, 45247819, 436940959, 4203612028, 42237989270, 430403180040, 4318885704619, 42873915907996, 427136419253877, 4280690450082956, 42906423299276119},
(22)。数码和是22倍数的n位数。{0, 0, 21, 519, 5465, 40909, 342531, 3830055, 43107021, 430324609, 4067803414, 39791380024, 405828327164, 4132191361796, 41228700104788, 408346458179408, 4072530775092692, 40873078728369612},
(23)。数码和是23倍数的n位数。{0, 0, 15, 465, 5520, 42999, 326796, 3402165, 40005165, 421929825, 4015305614, 38039545603, 380763807239, 3918682413337, 39702546659487, 393767982767586, 3895329112873457, 38917753783501426},
(24)。数码和是24倍数的n位数。{0, 0, 10, 405, 5460, 45464, 326556, 3039256, 36126849, 406147125, 4001610250, 37219365121, 359631428364, 3678322478042, 37935664292588, 381392881265011, 3762350098218829, 37219852374909939},
(25)。数码和是25倍数的n位数。{0, 0, 6, 342, 5283, 47757, 339291, 2789685, 31952940, 380512875, 3965587680, 37181174265, 346581662075, 3445279720300, 35772868790700, 367441289159325, 3661162712706600, 35966744400571500},
(26)。数码和是26倍数的n位数。{0, 0, 3, 279, 4998, 49488, 360864, 2675682, 28056429, 346151442, 3856245834, 37461129369, 342920665075, 3266992419028, 33407288613937, 349150070540774, 3555835163480783, 35114955454707434},
(27)。数码和是27倍数的n位数。{0, 0, 1, 219, 4620, 50413, 386727, 2694120, 24930511, 306816399, 3649461057, 37492291378, 346450438830, 3176913779355, 31275582443221, 326843073213153, 3410727440409699, 34351481452917616},
(28)。数码和是28倍数的n位数。{0, 0, 0, 165, 4170, 50412, 412764, 2823018, 22890318, 267392223, 3351046590, 36813730077, 352560385658, 3178406721221, 29819823777614, 303860739629215, 3214285558244740, 33280426266832651},
(29)。数码和是29倍数的n位数。{0, 0, 0, 120, 3675, 49467, 435765, 3030213, 22046520, 232528065, 2989841118, 35193107787, 356061516838, 3245017470529, 29280382725973, 284803132371826, 2986317296390089, 31665783163960501},
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2024-11-29 22:17:14 | 显示全部楼层
本帖最后由 northwolves 于 2024-11-30 14:41 编辑
王守恩 发表于 2024-11-27 16:50
(11)。数码和是11倍数的n位数。{0, 8, 82, 818, 8182, 81818, 818182, 8181818, 81818182, 818181818, 818 ...


$a_n=\lfloor \frac{1}{2} \left(1-(-1)^{(n % 2)}\right)+\frac{9\* 10^{n-1}}{11}\rfloor -(-1)^{\lfloor \frac{n-1}{11}\rfloor } ((9 n+1) \left(n^4+n^3+n^2+n+1\right) \left(n^5+1\right) % 11)$
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2024-12-26 20:44 , Processed in 0.027878 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表