cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A322289 Primes sorted by quadratic irrational continued fraction terms.

Original entry on oeis.org

5, 3, 2, 17, 13, 7, 37, 41, 29, 11, 73, 61, 53, 19, 23, 109, 89, 101, 97, 113, 31, 149, 157, 137, 43, 47, 193, 197, 181, 173, 59, 277, 241, 281, 269, 257, 233, 229, 67, 71, 79, 313, 337, 349, 353, 317, 293, 83, 409, 421, 433, 389, 401, 373, 397, 103, 107
Offset: 1

Views

Author

Pierre Abbat, Sep 09 2019

Keywords

Comments

For each prime p, if p is congruent to 1 mod 4, compute (1+sqrt(p))/2, otherwise compute sqrt(p). Express it as a periodic continued fraction. Sort them by the largest term in the periodic part; within those that have the same largest term, sort them by the geometric mean of terms.
These quadratic irrationals are used in a Richtmyer low-discrepancy sequence generator. Sorting them this way puts the golden ratio first in the list of quadratic irrationals, because (frac(n*phi)) has the lowest discrepancy among sequences of the form (frac(n*a)).

Examples

			17 == 1 (mod 4), so compute (sqrt(17)+1)/2 = 2.561552812808830.... Its continued fraction expansion is [2;(1,1,3)]. The largest term is 3.
13 == 1 (mod 4), so compute (sqrt(13)+1)/2 = 2.30277563773199.... Its continued fraction expansion is [2;(3)]. The largest term is again 3, but the average term is larger than the average term in (sqrt(17)+1)/2, so 13 goes after 17.
7 == 3 (mod 4), so compute sqrt(7) = 2.645751311064590.... Its continued fraction expansion is [2;(1,1,1,4)]. The largest term is 4, so 7 goes after 13.
		

Crossrefs

Permutation of A000040. Cf. A001622 (phi).