计算大于正整数1600000的最小双基回文数
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了计算大于正整数1600000的最小双基回文数相关的知识,希望对你有一定的参考价值。
def judge(n): count=0 for i in xrange(2,10+1): x=‘‘ tmp=n while tmp!=0: x+=str(tmp%i) tmp/=i if x==x[::-1]: count+=1 if count==2: return True return False def foo(): n=1600000 while True: n+=1 if judge(n): print n break pass if __name__ == ‘__main__‘: foo() print ‘ok‘ pass
以上是关于计算大于正整数1600000的最小双基回文数的主要内容,如果未能解决你的问题,请参考以下文章