square_sum_problem: Square Sum Problem

Description Usage Arguments Details References Examples

View source: R/square_sum_problem.R

Description

Using the integers from 1 to n construct a chain such that each pair of neighboring numbers adds up to a square number.

Usage

1

Arguments

n

The length of the chain.

Details

The function returns the first valid chain that is found. Maybe some day I will write a version that returns all possible chains.

References

The Numberphile video featuring Matt Parker and Brady Haran: The Square-Sum Problem.

Examples

1

BastiHz/numberphile documentation built on Oct. 12, 2020, 6:03 p.m.