e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

"Mirror prime" numbers

published at 3/2/20, 5:46:20 pm

Sade eded hissesinde nezere alin ki, 1 sade eded deyil. Eks halda 20% numuneler sehv olacaq. Yoxlama ucun bezi numuneler:

Giris: 1 2 Cixis: 1

Giris: 1 100 Cixis: 13

Giris: 10 99 Cixis: 9

published at 3/23/20, 4:01:23 pm

x, y = [int(x) for x in input().split()] count1=0 count = 0 if 1<=x<= y<=10000: for val in range(x, y + 1): if val > 1: for n in range(2, val): if (val % n) == 0: break else:

            #print(val)
            value = int(str(val)[::-1])

            count +=1

            if value % 2 == 0 or value % 3 == 0 or value % 4 == 0 or value % 5 == 0 or value % 6 == 0 or value % 7 == 0 or value % 8 == 0 or value % 9 == 0:

                count1 += 1

if count==0: pass else: print(count-count1)

published at 3/24/20, 2:36:49 pm

Сначала подумал, что нужно найти количество таких пар, но всё оказалось намного проще...