Lucas-Lehmer Test: for p an odd prime, the Mersenne number 2p − 1 is prime if and only if 2p − 1 divides S(p − 1) where S(n + 1) = (S(n))2 − 2
Continue ReadingC++ vs Python: 1 Hour Pong Challenge
https://www.youtube.com/watch?v=v0lAdyhgqio
Continue ReadingC++: Hickerson Series of Almost Integers
The following function, due to D Hickerson, is said to generate "Almost integers" by the "Almost Integer" page of Wolfram Mathworld. (December 31 2013
Continue ReadingC++: For Loop with a Specified Step
Demonstrate a for-loop where the step-value is greater than one. This prints all odd digits: for (int i = 1; i < 10; i += 2) std::cout &
Continue ReadingC++: Pythagorean Means
Compute all three of the Pythagorean means of the set of integers 1 through 10. Show that for this set of positive integers. The most common
Continue ReadingC++: AVL Tree
In computer science, an AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by a
Continue ReadingC++: Calendar
Create a routine that will generate a text calendar for any year. Test the calendar by generating a calendar for the year 1969, on a device of the tim
Continue ReadingC++: Closures/Value Capture
Task: Create a list of 10 functions, in the simplest manner possible (anonymous functions are encouraged), such that the function at index i (you may
Continue ReadingC++: Determine if a String Is Numeric
Create a boolean function which takes in a string and tells whether it is a numeric string (floating point and negative numbers included) in the synta
Continue ReadingC++: Generic Swap
The task is to write a generic swap function or operator which exchanges the values of two variables (or, more generally, any two storage places that
Continue Reading




