Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

r""" 

Cunningham table 

""" 

 

import os 

from sage.misc.cachefunc import cached_function 

from sage.rings.integer import Integer 

from sage.structure.sage_object import load 

from sage.env import SAGE_SHARE 

 

@cached_function 

def cunningham_prime_factors(): 

""" 

List of all the prime numbers occuring in the so called Cunningham table. 

They occur in the factorization of numbers of type $b^n+1$ or $b^n-1$ with $b \in \{2,3,5,6,7,10,11,12\}$. 

Data from http://cage.ugent.be/~jdemeyer/cunningham/ 

""" 

file = os.path.join(SAGE_SHARE,'cunningham_tables','cunningham_prime_factors.sobj') 

if os.path.exists(file): 

return [Integer(_) for _ in load(file)] 

else: 

from warnings import warn 

warn("You might consider installing the optional package for factoring Cunningham numbers with the following command: ``sage -i cunningham_tables``") 

return []