Showing posts with label Generator - Super Prime. Show all posts
Showing posts with label Generator - Super Prime. Show all posts

Saturday, July 2, 2022

Generator - Super Prime

 Generator - Super Prime

Problem Statement
For a given integer N, super primes are those integers from 1 to N whose multiples (other than themselves) do no exist in the range [1, N].
Your task is to generate all super primes <= N in sorted order.

Note: Super primes are not related to primes in any way.

Python code:

def SuperPrimes(N):

    for i in range (int(N/2)+1,N+1):

        yield i
    return

ads vert

Basic HTML Tables - Layout, HTML Tables, Attributes, Aside, Footer, Tr tag, Td tag, Th tag, Tbody

  Basic HTML Tables - Layout, HTML Tables, Attributes, Aside, Footer, Tr tag, Td tag, Th tag, Tbody < table >      < thead >    ...