找回密码
 欢迎注册
查看: 11918|回复: 6

[擂台] 50个1,50个2,50个3可组成多少种相邻数位都不相同的数

[复制链接]
发表于 2011-1-8 22:56:01 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?欢迎注册

×
帖子由n个1,m个2,k个3可组成多少种相邻数位都不相同的数? northwolves 指出找不到简单的公式。 那么,能否编程计算出n=m=k=50的结果? 或者给10分钟时间能计算到多大的n?(n=m=k)
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-1-8 23:45:25 | 显示全部楼层
n=1-9: 6 30 174 1092 7188 48852 339720 2403588 17236524
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-1-8 23:53:08 | 显示全部楼层
n a(n,n,n) 1 6 2 30 3 174 4 1092 5 7188 6 48852 7 339720 8 2403588 9 17236524 10 124948668 11 913820460 12 6732898800 13 49918950240 14 372104853600 15 2786716100592 16 20955408717396 17 158149624268220 18 1197390368733804 19 9091866006950892 20 69214297980023256 A110706 Number of linear arrangements of n blue, n red and n green items such that there are no adjacent items of the same color. 7 6, 30, 174, 1092, 7188, 48852, 339720, 2403588, 17236524, 124948668, 913820460, 6732898800, 49918950240, 372104853600, 2786716100592, 20955408717396, 158149624268220, 1197390368733804, 9091866006950892, 69214297980023256 (list; graph; listen; history; internal format) OFFSET 1,1 COMMENTS The number of circular arrangements is given by A110707 and A110710. FORMULA a(n) = 2 *( Sum[k=0..[n/2]] binomial(n-1, k) * ( binomial(n-1, k)*binomial(2n+1-2k, n+1) + binomial(n-1, k+1)*binomial(2n-2k, n+1)) ) PROG (PARI) a(n)=2*sum(k=0, n\2, binomial(n-1, k)*(binomial(n-1, k)*binomial(2*n+1-2*k, n+1)+binomial(n-1, k+1)*binomial(2*n-2*k, n+1))) CROSSREFS Cf. A110707, A110710. Sequence in context: A026331 A135490 A175925 * A001341 A089896 A057754 Adjacent sequences: A110703 A110704 A110705 * A110707 A110708 A110709 KEYWORD nonn AUTHOR Max Alekseyev (maxale(AT)gmail.com), Aug 04 2005
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-1-9 00:08:03 | 显示全部楼层
(00:02) gp > for(i=1,100,print("a(",i,")=",a(i))) a(1)=6 a(2)=30 a(3)=174 a(4)=1092 a(5)=7188 a(6)=48852 a(7)=339720 a(8)=2403588 a(9)=17236524 a(10)=124948668 a(11)=913820460 a(12)=6732898800 a(13)=49918950240 a(14)=372104853600 a(15)=2786716100592 a(16)=20955408717396 a(17)=158149624268220 a(18)=1197390368733804 a(19)=9091866006950892 a(20)=69214297980023256 a(21)=528150412279712856 a(22)=4038744418776845400 a(23)=30944390624047065984 a(24)=237516699913494859872 a(25)=1826086013748254354208 a(26)=14060749765349707607712 a(27)=108419462768852853411360 a(28)=837093723433477717410048 a(29)=6470979121569898636819584 a(30)=50079488713677575202500736 a(31)=387982401816883700210450784 a(32)=3008830071902513451691172340 a(33)=23355578609725312573413915996 a(34)=181454222489643445523121055308 a(35)=1410929075530217028966809771436 a(36)=10979559944932052584082034521160 a(37)=85504296448497664597176138172200 a(38)=666342090836575342810869307529640 a(39)=5196335866734293020072581291205680 a(40)=40548366159334986692251519592601144 a(41)=316600984318396358474067788054034792 a(42)=2473440399385321384181863105104711240 a(43)=19334338888097872133851929530263756008 a(44)=151211589346113407153873155612750437984 a(45)=1183201226095769143646013094593076929792 a(46)=9262761619343186896823542620683814327552 a(47)=72547402980720379307408101513774534473600 a(48)=568452882815731546922765274196011792412128 a(49)=4456054722123240923861790762275029981470624 a(50)=34944809867704420868762968362778850357165088 a(51)=274147371430665747033390016677581958159958560 a(52)=2151534123458342115664855183404876911768980800 a(53)=16891531014474743854827700730868265556544402240 a(54)=132660194992052638969652508875883676718351833920 a(55)=1042215716008997256156556500064910970795266407680 a(56)=8190582645372677718998263559678002957579518625920 a(57)=64388345049275795566012972006592224213972237987200 a(58)=506326155840395399722070165469770926974502777284480 a(59)=3982719132441830391958025714413424756984142532295040 a(60)=31336538308967379514657708421332661699444650175354880 a(61)=246626868347757426733648905645916297821821733669542400 a(62)=1941529484597800619620248555166987497423747232503360000 a(63)=15288265189039516569579953426135402450770672610746257600 a(64)=120414723092796156935730610443933392848561703471173154100 a(65)=948647469431830568173953387333513442924745469058124773020 a(66)=7475338284326073560709171028209634311725556165278385051660 a(67)=58918893989724828620259792011383097301935575680480059846700 a(68)=464486600168276476971060123234819703628399405372867807196840 a(69)=3662553007163831949948326207614139638295516036436782087893320 a(70)=28885783174772649638034285754252706807977228804193305563113160 a(71)=227861713323275822155965738601048793309733827940033202353666960 a(72)=1797807312928206882515923413338087340692159834272372424654277000 a(73)=14187216205357558899322140119941032318527100791446969198944436440 a(74)=111977630558250899351453851787690802535568466334635043570192828920 a(75)=883981694886194045915099682978724755614353746303013399314869204952 a(76)=6979609676484784779479286235526006893666327628653965268501081655136 a(77)=55117930081516616868772910479943869742814147606953974962324217730880 a(78)=435338093826904809506215082651967273805639376712008719095049713716544 a(79)=3438987775396227121017816949360617135314057290266529095422080019278752 a(80)=27170837832636974615809398863308843280350611707989242703275162872569368 a(81)=214705010694294097833729941669857415117829959725904643678957359285996232 a(82)=1696861732732598717138290444049715998410003925078107246379541728900386920 a(83)=13412640714774197250337848310466022807751108601087060377932407112815164008 a(84)=10603376350259707306709715822098819259989299189016291626860126019063786478 4 a(85)=83836792323606489665785221064655941533008759275410813321703672657330088020 8 a(86)=66295540572673231614558833865752795559799380789683434958940866976668909095 20 a(87)=52431442525072731993565189299456507022786176356512807970395232311875922531 200 a(88)=41472079493310195901973064849076649199251001405042627330139796160505775660 9280 a(89)=32807645684770679406571228177130201850370139117963559592814297812692232811 25120 a(90)=25956632124000022572974848787440766003997376665426522840048123984998670521 371392 a(91)=20538771112619686524406639425444805447852564799934190976359151824771269915 9211776 a(92)=16253700710456333429237496479021633753647588331978107934974387097161960850 56235520 a(93)=12864136589743950878360274144667404126747571476330915085443335432211631708 401921024 a(94)=10182596467765213807262897746550247534910696147121275685418734605997891907 6633725952 a(95)=80609251683143174591143075467859123926434751235828567714159073429907999014 1953446656 a(96)=63820279759174533659960335415845615245758520514652669772954583696231719150 48013353696 a(97)=50533455746072892090831361168063647414851515211097794702053168753099768300 933633725600 a(98)=40017027661016197999968124142437310845597536838521254446457074856188078489 9515255661344 a(99)=31692410443796524399433430052506862667502430439101916683254414842724153372 85300766955552 a(100)=2510206447012118942233591574635838380954104797212707759731753805266535970 4475946419493056 (00:02) gp >

评分

参与人数 1鲜花 +8 收起 理由
wayne + 8 很壮观!

查看全部评分

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2011-1-9 22:01:27 | 显示全部楼层
回复楼上: 能否解释一下公式的意义: a(n) = 2 *( Sum[k=0..[n/2]] binomial(n-1, k) * ( binomial(n-1, k)*binomial(2n+1-2k, n+1) + binomial(n-1, k+1)*binomial(2n-2k, n+1)) ) ---------------------------------------------------------- 我算得的结果:n从1到18,结果相同,但n>18,都不相同,我算得的略小。 f(19,19,19)=9091864886599260 f(20,20,20)=69214252708323576 f(50,50,50)=34914786015865910415118221775722841668386016
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2011-1-10 23:10:37 | 显示全部楼层
northwolves 的结果是对的。 我的递推公式,没错: f(x,y,z)=g(x,y,z)+g(x,z,y)+g(y,z,x) g(x,y,z)=f(x,y,z-1)-g(x,y,z-1) g(x,y,z)表示最后一个数等于确定数(z代表的那个数)时的总个数 f(x,y,z)表示所要求的总个数 g(x,x,0)=2 g(x+1,x,0)=1 g(x,y,0)=0 ( x-y>1) --------------------------- 但是大数计算程序出了问题。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

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

GMT+8, 2024-11-21 21:11 , Processed in 0.026207 second(s), 17 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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