Monthly Archives: April 2011

Dumbbell Nebula – Messier 27

The Dumbbell Nebula (Messier 27 or NGC 6853) is a planetary nebula in the Vulpecula constellation, at a distance of about 1360 LY. Its central region contains the largest known white dwarf star.

For this image I used three 240 second exposures on Lightbuckets LB-0003 with the following filters:
Hydrogen-Alpha in Green
Sodium II in Red
Oxygen III in Blue

MaximDL was used to stack, align and screen stretch. The image was then cropped using Gimp.

Euler Problem 80

Python rocks. No surprise here. Its got a Decimal module that does everything. This routine runs inside of a second.

import decimal
from math import sqrt, floor
class Problem80:
    def __init__(self):
    def Solution(self):
        count = 0
        decimal.getcontext().prec = 110
        for n in range (1, 101):
            num = int(floor(sqrt(n)))
            text = str(decimal.Decimal(n).sqrt())[2:102]
            if len(text) == 100:
                count += num
                for i in range (0,99):
                    count += int(text[i])
            print n,count
        return "Answer = " + str(count)
if __name__ == '__main__':
    P = Problem80()
    print P.Solution()

Euler Problem 79

Just a simple substitution routine.

class Problem79:
    def __init__(self, list):
        self.list = list
    def Solution(self):
        code = [0,1,2,3,4,5,6,7,8,9]
        used = [0,1,2,3,4,5,6,7,8,9]
        for n in self.list:
            d0 = int(str(n)[0])
            if d0 in used:
            i0 = code.index(d0)
            d1 = int(str(n)[1])
            if d1 in used:
            i1 = code.index(d1)
            d2 = int(str(n)[2])
            if d2 in used:
            i2 = code.index(d2)
            print d0, d1, d2, i0, i1, i2, used, code,
            if i1 < i0:
                code.insert(i0+1, d1)
            if i2 < i1:
                code.insert(i1+1, d2)
            print code
        for n in used:
        answer = ""
        for n in code:
            answer += str(n)
        return "Answer = " + answer
if __name__ == '__main__':
    P = Problem79([319,680,180,690,129,620,762,689,762,318,368,710,720,710,629,168,160,689,
    print P.Solution()