# L-16 MCS 507 Wed 27 Sep 2023 : factorial50_sympy_assert.py
# """
# This script is the first step to test the prime factorization
# of 50! with Sage and SymPy.
#  
# The source for this test are problems C1 and C2 from
# Chapter 3 by Michael J. Wester: "A Critique of the
# Mathematical Abilities of CA Systems", pages 25-60.
# In "Computer Algebra Systems.  A Practical Guide"
# edited by Michael J. Wester, Wiley 1999.
# 
# If saved as 'factorial50_sympy_assert.py', execute this script at
# the command line as 'python factorial50_sympy_assert.py'.
#  
# The first two number problems C1 and C2 are
# (1) to compute 50! the factorial of 50; and
# (2) to factor 50! in irreducible factors.
# We can test for the number of decimal places in 50!
# and the number of distinct prime factors of 50!.
# 
# Instead of a documentation string, all documentation is
# formatted via the comment line symbols.
# """
import sympy as sp
N = sp.factorial(50)
assert(len(str(N)) == 65)
F = sp.factorint(N)
assert(len(F.keys()) == 15)
print('test passed')
