|
|
back to boardan idea Posted by HuaLee 28 Oct 2010 18:15 假设第n个1的位置在a(n);a(1)=1,a(n+1)=a(n)+n;所以we get a(n)=n*(n-1)/2+1;所以if you input number k.when k==1 or 2,得到1;else 令n=int(sqrt(2.0*k))+1,if a(n)==k,得到1,否则得到0. Re: an idea Posted by Jason 28 Jan 2011 04:18 Spoiler alert!!! |
|
|