// to display ‘n’ number of posts, we need to execute the loop ‘n’ number of times
// so we define a numerical variable called ‘$count’ and set its value to zero
// with each iteration of the loop, the value of ‘$count’ will increase by one
// after the value of ‘$count’ reaches the specified number, the loop will stop
// *USER: change the ‘n’ to the number of posts that you would like to display

<?php static $count = 0;
if ($count == “n”) { break; }
else { ?>

// to exclude all posts from categories ‘x’, ‘y’, ‘z’ unless in single-post view
// create an ‘if’ statement for each of the three specified categories as follows:
// if the post is in category ‘x’ and this is not a single-post view, exit the loop
// if the post is in category ‘y’ and this is not a single-post view, exit the loop
// if the post is in category ‘z’ and this is not a single-post view, exit the loop
// if no conditions are met, continue the loop; otherwise restart loop with next post
// if none of these conditions are met, run the loop; otherwise restart at the next post
// *USER: change the ‘x’, ‘y’, ‘z’ to the numbers of the categories you want to exclude

// now, if all conditions have been satisfied, the post is displayed
// for CSS styling and layout purposes, we wrap the post content in a div
// we then display the entire post content via the ‘the_content()’ function
// *USER: change to ‘<?php the_excerpt(); ?>’ to display post excerpts instead

<div>
<?php the_content(); ?>
</div>

// here, we continue with the limiting of the number of displayed posts
// each iteration of the loop increases the value of ‘$count’ by one
// the final two lines complete the loop and close the if statement

<?php $count++; } ?>
<?php endwhile; ?>
<?php endif; ?>

from http://perishablepress.com/press/2007/08/06/super-loop-exclude-specific-categories-and-display-any-number-of-posts/