def polignac(num,p):
    """
    input: num can be any positive integer and p and prime number.

    output: Gives the total number of factors of p in num! (num factorial).
    Stated another way, this function returns the total number of factors
    of p of all numbers between 1 and num; de Polignac's formula is pretty 
    nifty if you are into working with prime numbers.
    """
    factorsDict={}
    if num>1 and p==1:
        print("Invalid entry since 1 is the identity.")
    else:
        while num>1:
            factorsDict[num//p]=num//p
            num=num//p
        return sum(factorsDict)

    input: num can be any positive integer and p and prime number.

    output: Gives the total number of factors of p in num! (num factorial).
    Stated another way, this function returns the total number of factors
    of p of all numbers between 1 and num; de Polignac's formula is pretty 
    nifty if you are into working with prime numbers.
    
recipes/Python/578632_de_Polignacs_Formula/recipe-578632.py