All pastes #168900 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-09-13 12:51 UTC
rendered paste body
print "Podaj zakres szukania liczb pierwszych, od 1 do..."
max=int(raw_input())+1
ilosc=0
LiczbyPierwsze = []
for n in range(2, max):
	for x in range(2, n):
		if n % x == 0:
			break
	else:
		LiczbyPierwsze.append(n)
		ilosc=ilosc+1
#print LiczbyPierwsze
#print "ilosc liczb pierwszych w zbiorze =", ilosc
#IloscSum=range(5,max)
#print IloscSum
#print LiczbyPierwsze[1]
for n in range(5,max):
	try:
		j=LiczbyPierwsze.index(n)
		print LiczbyPierwsze[j]
		#IloscSum[n-5]=1
	except ValueError:
		for x in LiczbyPierwsze:
			if x<=n:
				for y in LiczbyPierwsze:
					if y<=n and y<=x:
						if (x+y) == n:
							print n, "=", x, "+", y
							#IloscSum[n-5]=1
							break
#print IloscSum