Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

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
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


This post first appeared on Newtoncoder, please read the originial post: here

Share the post

Generator - Super Prime

×

Subscribe to Newtoncoder

Get updates delivered right to your inbox!

Thank you for your subscription

×