I can not answer your question regarding the availability of HashHelpers, but here are the ways to implement it themselves.
Here's a post with some imperative implementations when generating prime numbers: The most elegant way to generate prime numbers
Alternatively, you can do this in LINQ:
var odds = from n in Enumerable.Range(0, int.MaxValue) select 3 + (long) n * 2; var primes = (new[] { 2L }).Concat( from p in odds where ! odds.TakeWhile(odd => odd * odd <= p).Any(odd => p % odd == 0) select p);
Source: http://jacobcarpenter.wordpress.com/2008/03/26/linq-to-prime-numbers/
Edit: do not use int.MaxValue in your initial range. Limit this to something suitable.
source share