Function that returns prime numbers contained between n and 2n - Chebyshev's inequality

Write a function f[n] that returns prime numbers contained between n and 2n. It's a variation of Chebyshev's inequality. Please, help.

• Do you know about Prime[] and PrimePi[]? Oct 14, 2018 at 8:54
• Is this a homework problem? If so, it should tagged as such. Oct 14, 2018 at 12:16

n = 100;
Select[Prime[Range@@PrimePi[{n,2n}]],#>=n&]


returns

{101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199}

n = 100;
Prime[Range @@ ({1 - Boole[PrimeQ[n]], 0} + PrimePi[{n, 2 n}])]


{101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199}