Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:不知道有没有反例了...两条规律一起用

Posted by steven7gao at 2011-11-28 22:28:34 on Problem 1047
In Reply To:不知道有没有反例了...两条规律一起用 Posted by:szxyj at 2011-04-08 21:21:37
很好奇楼主是怎么想到这样的性质的,数据上只知道一个142857,怎么推出来的?
按照楼主的意见整理如下:
比较明显的两个必要条件
(1)式 N*(n+1)=999……999(n个9)
(2)式 N*(1+2+3+……+n)=(a1+a2+……+an)*111……111(n个1)

(2)式可以排除33 11111111这些伪解 (没有完全测试过...不知道会不会还是有错解...)

看到有个程序里写的是 (a1+a2+……+an)*2=9n (3)式
把(1)式和(2)式相除
  (n+1)               999……999 
--------- = -------------------------
n*(n+1)/2      (a1+a2+……+an)*111……111 
即
n/2=9/(a1+a2+……+an)
即
(a1+a2+……+an)*2=9n

因此可以利用(1)(3)式快速判断

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator