Sha256: 917c20aae5bb16f8adf19d7e79bd4ea0b467c6b8a33b6ab3fc753d3972fd8cb8

Contents?: true

Size: 1.94 KB

Versions: 103

Compression:

Stored size: 1.94 KB

Contents

# Difference Of Squares

Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.

The square of the sum of the first ten natural numbers is
(1 + 2 + ... + 10)² = 55² = 3025.

The sum of the squares of the first ten natural numbers is
1² + 2² + ... + 10² = 385.

Hence the difference between the square of the sum of the first
ten natural numbers and the sum of the squares of the first ten
natural numbers is 3025 - 385 = 2640.


## Getting Started
For installation and learning resources, refer to the
[exercism help page](http://exercism.io/languages/ocaml).

## Installation
To work on the exercises, you will need `Opam` and `Core`. Consult [opam](https://opam.ocaml.org) website for instructions on how to install `opam` for your OS. Once `opam` is installed open a terminal window and run the following command to install core:

```bash
opam install core
```

To run the tests you will need `OUnit`. Install it using `opam`:

```bash
opam install ounit
```

## Running Tests
A Makefile is provided with a default target to compile your solution and run the tests. At the command line, type:

```bash
make
```

## Interactive Shell
`utop` is a command line program which allows you to run Ocaml code interactively. The easiest way to install it is via opam:
```bash
opam install utop
```
Consult [utop](https://github.com/diml/utop/blob/master/README.md) for more detail.

## Feedback, Issues, Pull Requests
The [exercism/ocaml](https://github.com/exercism/ocaml) repository on
GitHub is the home for all of the Ocaml exercises.

If you have feedback about an exercise, or want to help implementing a new
one, head over there and create an issue.  We'll do our best to help you!

## Source

Problem 6 at Project Euler [http://projecteuler.net/problem=6](http://projecteuler.net/problem=6)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

Version data entries

103 entries across 103 versions & 1 rubygems

Version Path
trackler-2.2.1.99 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.98 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.97 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.96 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.95 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.94 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.93 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.92 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.91 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.90 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.89 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.88 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.87 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.86 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.85 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.84 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.83 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.82 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.81 tracks/ocaml/exercises/difference-of-squares/README.md
trackler-2.2.1.80 tracks/ocaml/exercises/difference-of-squares/README.md