From Wikipedia, the free encyclopedia: A happy number is defined by the following process. Starting with any positive integer, replace the number

Continue Reading## C++: Multiplicative Digital Root

The multiplicative digital root (MDR) and multiplicative persistence (MP) of a number, n, is calculated rather like the Digital root except digits are

Continue Reading## Why Is Subtracting These Two Times (In 1927) Giving a Strange Result?

If I run the following program, which parses two date strings referencing times one second apart and compares them: public static void main(String[]

Continue Reading## C++: Sample Covariance

double sample_covariance(double A[], double B[], int length) // Function calculates the sample covariance the array A and array B, whose lengths

Continue Reading## C++: Calculate Geometric Mean

void Geometric_Mean_Array(double & mean_normal, const double * a, const int n) //Function that calculates the geometric mean (geometric avera

Continue Reading## C++: Black Scholes Put Option Theta

// Calculate the Black Scholes European put option Theta double BS_Put_Option_Theta(double S, double K, double r, double v, double T) // Parame

Continue Reading## C++: Create a File

In this task, the job is to create a new empty file called "output.txt" of size 0 bytes and an empty directory called "docs". This should be done twic

Continue Reading## C++: Apply a Callback to an Array

In this task, the goal is to take a combined set of elements and apply a function to each element. C-style Array: #include <iostream> //

Continue Reading## C++: Higher-Order Functions

Pass a function as an argument to another function. Function Pointer Works with: g++ version 3.4.2 (mingw-special) C++ can pass function pointers i

Continue Reading## C++: Look-and-Say Sequence

The Look and say sequence is a recursively defined sequence of numbers studied most notably by John Conway. Sequence Definition Take a decimal

Continue Reading