← RoseCode

ROSECODE 389

Beatty sequences

Philippe_57721 · Programming ·

There is a beautiful theorem by Samuel Beatty which states:

If α and β are positive irrational numbers such as 1α+1β=1
then A={n∈N,⌊n×α⌋} and B={n∈N,⌊n×β⌋} are a partition of N:
N=A∪B and A∩B=∅

Let's A the vector contained in this file data389.txt

If A is a Beatty sequence, can you find the corresponding value α

Answer format: α // truncated at 6 positions after the decimal point.

[My timing: instant]