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.

User: Pierre Abbat

Pierre Abbat's wiki page.

Pierre Abbat has authored 4 sequences.

A361388 Number of orders of distances to vertices of n-dimensional cube.

Original entry on oeis.org

1, 2, 8, 96, 5376, 1981440, 5722536960, 138430238607360
Offset: 0

Author

Pierre Abbat, Mar 10 2023

Keywords

Comments

Let C be an n-dimensional cube and p be a point in R^n such that the distances from p to the 2^n vertices of C are all different. List the vertices in order of their distance from p. The number of different orders of vertices is given by a(n).
Equality of any two distances defines a hyperplane in R^n, although different pairs of distances may define the same hyperplane. All these hyperplanes partition the space into cells, and the interior of each (n-dimensional) cell corresponds to a particular strong order of the differences. Hence, a(n) equals the number of cells in the partition of R^n by the hyperplanes. The given SageMath code implements this approach. - Max Alekseyev, Mar 10 2023
Computing the sequence is slow. The Sage program took 20 minutes to compute a(5) on Lucas Brown's box; the C++ program took 3.5 seconds to compute a(5) on Pierre Abbat's box, a 12-thread Ryzen. The C++ program took 6 hours to compute a(6). Neither of us has computed a(7) with the program; that's from A009997.
For n >= 4 the frequencies of the orders appear to vary widely.

Examples

			For n=3, a 3-dimensional cube has 8 corners, numbered 0 to 7. A point can be closest to any of the 8 corners. A point closest to 0 can have distances to corners 1, 2, and 4 in any of 6 orders. A point whose distances to corners 0, 1, 2, and 4 are in increasing order can be closer to 3 than to 4, or closer to 4 than to 3. So the total number of orders is 8*6*2=96.
		

Crossrefs

Cf. A009997.

Programs

  • PARI
    A361388(n) = A009997(n)*n!<M. F. Hasler, Mar 10 2023
  • Sage
    def a(n):
        x = polygens(QQ,n,'x')
        dist2 = [sum((xi - ti)^2 for xi,ti in zip(x,t)) for t in Tuples(range(2),n)]    # squared distances
        diffs = {p[0]-p[1] for p in Combinations(dist2,2)}     # set of pairwise differences of squared distances
        H = HyperplaneArrangements(QQ, tuple(map(str,x)))
        A = H([[[d.coefficient({xi:1}) for xi in x], d.constant_coefficient()] for d in diffs])
        return A.n_regions()
    print( [a(n) for n in (1..4)] ) # Max Alekseyev, Mar 10 2023
    (C++) // See Cubeorders link.
    

Formula

a(n) = 2^n*n!*A009997(n).

A336433 Number of sequences of n numbers from 1 to n that do not have a subsequence that adds up to n.

Original entry on oeis.org

0, 0, 0, 1, 5, 68, 403, 7257, 61686, 1174434, 13810620, 335547727, 3783688286, 124486381056, 1935430229612, 55798127869680, 1058567311736669, 39819079382937334, 717447490866241055, 32064848897165970340, 666062878027691348450, 28916070816360797805534
Offset: 0

Author

Pierre Abbat, Jul 21 2020

Keywords

Comments

The sequence is bounded above for odd n by (((n-1)/2)^n)*(2^((n-1)/2)).
Growth appears to be slightly faster than exponential, but irregular, with odd-numbered terms larger than the trend.

Examples

			For n=3, the only solution is 2,2,2.
For n=4, the 5 solutions are 3,3,3,3 and the four permutations of 3,3,3,2.
		

Crossrefs

Cf. A000312.

Programs

  • Python
    # See sequence.py link.

Extensions

a(19)-a(21) from Christopher L. Reedy, Aug 06 2020

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

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).

A081880 Triangle read by rows: n-th row gives trajectory of 2n under the map x->(x^2-4)/6, stopping when the next term would be negative or nonintegral.

Original entry on oeis.org

0, 2, 0, 4, 2, 0, 6, 8, 10, 16, 42, 10, 16, 42, 12, 14, 32, 170, 4816, 3865642, 2490531345360, 16, 42, 18, 20, 66, 22, 80, 1066, 189392, 5978221610, 5956522269711832016, 5913359591595499145281505571167104042, 5827970276585748074286667660065476529979312208145367609757859954142122960, 24, 26
Offset: 0

Author

Pierre Abbat, Apr 12 2003

Keywords

Examples

			8 -> (64-4)/6 = 10 -> (100-4)/6 = 16 -> (256-4)/6 = 42 -> (42^2-4)/6 nonintegral, so stop; thus row 4 is (8, 10, 16, 42).
Triangle begins:
0,
2, 0,
4, 2, 0,
6,
8,
10, 16, 42, 10, 16, 42,
12,
14, 32, 170, 4816, 3865642, 2490531345360,
16, 42,
18,
20, 66,
22, 80, 1066, 189392, 5978221610, 5956522269711832016, 5913359591595499145281505571167104042, 5827970276585748074286667660065476529979312208145367609757859954142122960,
24,
...