Demo entry 3617622

test

   

Submitted by anonymous on Feb 14, 2016 at 12:48
Language: Python 3. Code size: 521 Bytes.

from math import sqrt

def istPrim(n):
    for i in range(2, int(sqrt(n)) + 1):
        if n%i==0:
            return False
    return True

def teiler(n):
    teilermenge=[1]
    for i in range(2,n+1):
        if n%i==0:
            teilermenge.append(i)
    return teilermenge

def istVollkommen(n):
    if sum(teiler(n))==2*n:
        return True
    else:
        return False

def istZwilling(k):
    if istPrim(k) and istPrim(k+2):
        return True
    else:
        return False
    

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).