Path: blob/master/src/sage/databases/cunningham_tables.py
8814 views
import os1from sage.misc.cachefunc import cached_function2from sage.rings.integer import Integer3from sage.structure.sage_object import load4from sage.misc.misc import SAGE_SHARE56@cached_function7def cunningham_prime_factors():8"""9List of all the prime numbers occuring in the so called Cunningham table.10They 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\}$.11Data from http://cage.ugent.be/~jdemeyer/cunningham/12"""13file = os.path.join(SAGE_SHARE,'cunningham_tables','cunningham_prime_factors.sobj')14if os.path.exists(file):15return map(Integer,load(file))16else:17from warnings import warn18warn("You might consider installing the optional package for factoring Cunningham numbers with the following command: ``sage -i cunningham_tables``")19return []2021222324