Problem 56: Powerful digit sum

A googol (10100) is a massive number: one followed by one-hundred zeros; 100100 is almost unimaginably large: one followed by two-hundred zeros. Despite their size, the sum of the digits in each number is only 1. Considering natural numbers of the form, ab, where a, b < 100, what is the maximum digital sum? …

Python IRC Bot

The bot doesn’t do much but tell fortunes, give a pong response to a ping, and log the chatroom. Will probably add to is as I get bored. The fortunes text file can be found here if interested. import socket import random from config import * def processChat(sock, buff): buff = buff.strip() …

Project Euler #29: Distinct Powers

Consider all integer combinations of a^b for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5: 22=4, 23=8, 24=16, 25=32 32=9, 33=27, 34=81, 35=243 42=16, 43=64, 44=256, 45=1024 52=25, 53=125, 54=625, 55=3125 If they are then placed in numerical order, with any repeats removed, we get the following sequence of 15 distinct terms: 4, …

Basic Python port scanner

This is a basic port scanner implementation in Python; it attempts to connect to the given ports of the specified host (all ports, if none indicated), and outputs to a text file and to the console if a given port is open – if it is, it then attempts to …