def powerDigitSum(power): number = 2**power numList = peUtilities.integerToList(number) digitSum = 0 for digit in numList: digitSum += digit return digitSum
def getChampernownes(digit): counter = 0 number = 1 string = '0' while counter < digit: string += str(number) counter += len(peUtilities.integerToList(number)) number += 1 return string
def factorialDigitSum(number): total = 1 for i in range(number, 0, -1): total *= i numList = peUtilities.integerToList(total) digitSum = 0 for j in range(len(numList)): digitSum += numList[j] return digitSum
def isPandigital(number): numList = peUtilities.integerToList(number) for i in range(len(numList)): if not containsNumber(numList, i + 1): return False return True