<jupyter_start><jupyter_text>Q031 Coin sumsIn England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation:1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p).It is possible to make £2 in the following way:1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1pHow many different ways can £2 be made using any number of coins?<jupyter_code>import numpy as np
coins=np.array([1,2,5,10,20,50,100,200])
n=200
max_coins=n/coins
mc=max_coins
c=coins

import itertools
for element in itertools.product(np.arange(mc[0]+1),np.arange(mc[1]+1),np.arange(mc[2]+1),np.arange(mc[3]+1),np.arange(mc[4]+1),np.arange(mc[5]+1),np.arange(mc[6]+1),np.arange(mc[7]+1)):
    if np.dot(element,c) == n:
         count+=1
print count<jupyter_output><empty_output><jupyter_text>Q032 Pandigital productsWe shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital.The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital.Find the sum of all products whose multiplicand/multiplier/product identity can be written as a 1 through 9 pandigital.HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.  Q033 Digit cancelling fractionsThe fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that 49/98 = 4/8, which is correct, is obtained by cancelling the 9s.We shall consider fractions like, 30/50 = 3/5, to be trivial examples.There are exactly four non-trivial examples of this type of fraction, less than one in value, and containing two digits in the numerator and denominator.If the product of these four fractions is given in its lowest common terms, find the value of the denominator.  Q034 Digit factorials145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.Find the sum of all numbers which are equal to the sum of the factorial of their digits.Note: as 1! = 1 and 2! = 2 are not sums they are not included.<jupyter_code>import math
math.factorial(7)<jupyter_output><empty_output><jupyter_text>Q036 Double-base palindromesThe decimal number, 585 = 10010010012 (binary), is palindromic in both bases.Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.(Please note that the palindromic number, in either base, may not include leading zeros.)<jupyter_code>i=1
sum=0
while i < 1e6:
    if str(i)[::-1] == str(i):
        b="{0:b}".format(i)
        if b == b[::-1]:
            sum+=i
    i+=1
print sum<jupyter_output>872187
{'fraction_non_alphanumeric': 0.09555555555555556, 'fraction_numerical': 0.06555555555555556, 'mean_word_length': 4.638830897703549, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '34604', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1010, 'n_tokens_neox': 870, 'n_words': 364, 'path': 'Q031-Q040.ipynb', 'repo_name': 'ryan-leung/SolvingProjectEuler', 'size': '2700'}