diff r ce324e28c333 sage/rings/arith.py
a

b


619  619  [(3, 1024)] 
620  620  sage: is_pseudoprime_small_power(2^256, get_data=True) 
621  621  [(2, 256)] 
 622  sage: is_pseudoprime_small_power(31, get_data=True) 
 623  [(31, 1)] 
622  624  sage: is_pseudoprime_small_power(15, get_data=True) 
623  625  False 
624  626  """ 
625  627  n = ZZ(n) 
626   if n.is_pseudoprime() or n == 1: 
 628  if n == 1: 
 629  # canonical way to write 1 as a prime power? 
627  630  return True 
628   if n < 0: 
 631  if n <= 0: 
629  632  return False 
630   for i in range(2, bound + 1): 
 633  if n.is_pseudoprime(): 
 634  if get_data == True: 
 635  return [(n, 1)] 
 636  else: 
 637  return True 
 638  for i in xrange(2, bound + 1): 
631  639  p, boo = n.nth_root(i, truncate_mode=True) 
632  640  if boo: 
633  641  if p.is_pseudoprime(): 