euler/python/e836.py

28 lines
869 B
Python

import re
TEXT = """
<p>Let $A$ be an <b>affine plane</b> over a <b>radically integral local field</b> $F$ with residual characteristic $p$.</p>
<p>We consider an <b>open oriented line section</b> $U$ of $A$ with normalized Haar measure $m$.</p>
<p>Define $f(m, p)$ as the maximal possible discriminant of the <b>jacobian</b> associated to the <b>orthogonal kernel embedding</b> of $U$ <span style="white-space:nowrap;">into $A$.</span></p>
<p>Find $f(20230401, 57)$. Give as your answer the concatenation of the first letters of each bolded word.</p>
"""
def euler_836():
r = ''
for m in re.findall(r'<b>(.*?)</b>', TEXT):
words = m.split(' ')
for word in words:
r += word[0]
return r
if __name__ == "__main__":
solution = euler_836()
print("e836.py: " + str(solution))
assert(solution == 'aprilfoolsjoke')