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.

Showing 1-4 of 4 results.

A023022 Number of partitions of n into two relatively prime parts. After initial term, this is the "half-totient" function phi(n)/2 (A000010(n)/2).

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 3, 2, 5, 2, 6, 3, 4, 4, 8, 3, 9, 4, 6, 5, 11, 4, 10, 6, 9, 6, 14, 4, 15, 8, 10, 8, 12, 6, 18, 9, 12, 8, 20, 6, 21, 10, 12, 11, 23, 8, 21, 10, 16, 12, 26, 9, 20, 12, 18, 14, 29, 8, 30, 15, 18, 16, 24, 10, 33, 16, 22, 12, 35, 12, 36, 18, 20, 18, 30, 12, 39, 16, 27, 20, 41, 12
Offset: 2

Views

Author

Keywords

Comments

The number of distinct linear fractional transformations of order n. Also the half-totient function can be used to construct a tree containing all the integers. On the zeroth rank we have just the integers 1 and 2: immediate "ancestors" of 1 and 2 are (1: 3,4,6 2: 5,8,10,12) etc. - Benoit Cloitre, Jun 03 2002
Moebius transform of floor(n/2). - Paul Barry, Mar 20 2005
Also number of different kinds of regular n-gons, one convex, the others self-intersecting. - Reinhard Zumkeller, Aug 20 2005
From Artur Jasinski, Oct 28 2008: (Start)
Degrees of minimal polynomials of cos(2*Pi/n). The first few are
1: x - 1
2: x + 1
3: 2*x + 1
4: x
5: 4*x^2 + 2*x - 1
6: 2*x - 1
7: 8*x^3 + 4*x^2 - 4*x - 1
8: 2*x^2 - 1
9: 8*x^3 - 6*x + 1
10: 4*x^2 - 2*x - 1
11: 32*x^5 + 16*x^4 - 32*x^3 - 12*x^2 + 6*x + 1
These polynomials have solvable Galois groups, so their roots can be expressed by radicals. (End)
a(n) is the number of rationals p/q in the interval [0,1] such that p + q = n. - Geoffrey Critzer, Oct 10 2011
It appears that, for n > 2, a(n) = A023896(n)/n. Also, it appears that a record occurs at n > 2 in this sequence if and only if n is a prime. For example, records occur at n=5, 7, 11, 13, 17, ..., all of which are prime. - John W. Layman, Mar 26 2012
From Wolfdieter Lang, Dec 19 2013: (Start)
a(n) is the degree of the algebraic number of s(n)^2 = (2*sin(Pi/n))^2, starting at a(1)=1. s(n) = 2*sin(Pi/n) is the length ratio side/R for a regular n-gon inscribed in a circle of radius R (in some length units). For the coefficient table of the minimal polynomials of s(n)^2 see A232633.
Because for even n, s(n)^2 lives in the algebraic number field Q(rho(n/2)), with rho(k) = 2*cos(Pi/k), the degree is a(2*l) = A055034(l). For odd n, s(n)^2 is an integer in Q(rho(n)), and the degree is a(2*l+1) = A055034(2*l+1) = phi(2*l+1)/2, l >= 1, with Euler's totient phi=A000010 and a(1)=1. See also A232631-A232633.
(End)
Also for n > 2: number of fractions A182972(k)/A182973(k) such that A182972(k) + A182973(k) = n, A182972(n) and A182973(n) provide an enumeration of positive rationals < 1 arranged by increasing sum of numerator and denominator then by increasing numerator. - Reinhard Zumkeller, Jul 30 2014
Number of distinct rectangles with relatively prime length and width such that L + W = n, W <= L. For a(17)=8; the rectangles are 1 X 16, 2 X 15, 3 X 14, 4 X 13, 5 X 12, 6 X 11, 7 X 10, 8 X 9. - Wesley Ivan Hurt, Nov 12 2017
After including a(1) = 1, the number of elements of any reduced residue system mod* n used by Brändli and Beyne is a(n). See the examples below. - Wolfdieter Lang, Apr 22 2020
a(n) is the number of ABC triples with n = c. - Felix Huber, Oct 12 2023

Examples

			a(15)=4 because there are 4 partitions of 15 into two parts that are relatively prime: 14 + 1, 13 + 2, 11 + 4, 8 + 7. - _Geoffrey Critzer_, Jan 25 2015
The smallest nonnegative reduced residue system mod*(n) for n = 1 is {0}, hence a(1) = 1; for n = 9 it is {1, 2, 4}, because 5 == 4 (mod* 9) since -5 == 4 (mod 9), 7 == 2 (mod* 9) and 8 == 1 (mod* 9). Hence a(9) = phi(9)/2 = 3. See the comment on Brändli and Beyne above. - _Wolfdieter Lang_, Apr 22 2020
		

References

  • G. Pólya and G. Szegő, Problems and Theorems in Analysis I (Springer 1924, reprinted 1972), Part Eight, Chap. 1, Sect. 6, Problems 60&61.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a023022 n = length [(u, v) | u <- [1 .. div n 2],
                                 let v = n - u, gcd u v == 1]
    -- Reinhard Zumkeller, Jul 30 2014
    
  • Magma
    [1] cat [EulerPhi(n)/ 2: n in [3..100]]; // Vincenzo Librandi, Aug 19 2018
  • Maple
    A023022 := proc(n)
        if n =2 then
            1;
        else
            numtheory[phi](n)/2 ;
        end if;
    end proc:
    seq(A023022(n),n=2..60) ; # R. J. Mathar, Sep 19 2017
  • Mathematica
    Join[{1}, Table[EulerPhi[n]/2, {n, 3, 100}]] (* adapted by Vincenzo Librandi, Aug 19 2018 *)
  • PARI
    a(n)=if(n<=2,1,eulerphi(n)/2);
    /* for printing minimal polynomials of cos(2*Pi/n) */
    default(realprecision,110);
    for(n=1,33,print(n,": ",algdep(cos(2*Pi/n),a(n))));
    
  • Python
    from sympy.ntheory import totient
    def a(n): return 1 if n<3 else totient(n)/2 # Indranil Ghosh, Mar 30 2017
    

Formula

a(n) = phi(n)/2 for n >= 3.
a(n) = (1/n)*Sum_{k=1..n-1, gcd(n, k)=1} k = A023896(n)/n for n>2. - Reinhard Zumkeller, Aug 20 2005
G.f.: x*(x - 1)/2 + (1/2)*Sum_{k>=1} mu(k)*x^k/(1 - x^k)^2. - Ilya Gutkovskiy, Apr 13 2017
a(n) = Sum_{d|n} moebius(n/d)*floor(d/2). - Michel Marcus, May 25 2021

Extensions

This was in the 1973 "Handbook", but then was dropped from the database. Resubmitted by David W. Wilson
Entry revised by N. J. A. Sloane, Jun 10 2012
Polynomials edited with the consent of Artur Jasinski by Wolfdieter Lang, Jan 08 2011
Name clarified by Geoffrey Critzer, Jan 25 2015

A232631 Coefficient table for minimal polynomials of s(2*l)^2 = (2*sin(Pi/(2*l)))^2.

Original entry on oeis.org

-4, 1, -2, 1, -1, 1, 2, -4, 1, 1, -3, 1, 1, -4, 1, -1, 6, -5, 1, 2, -16, 20, -8, 1, -1, 9, -6, 1, 1, -12, 19, -8, 1, -1, 15, -35, 28, -9, 1, 1, -16, 20, -8, 1, 1, -21, 70, -84, 45, -11, 1, 1, -24, 86, -104, 53, -12, 1, 1, -24, 26, -9, 1, 2, -64, 336, -672, 660, -352, 104, -16, 1, 1, -36, 210, -462, 495, -286, 91, -15, 1
Offset: 1

Views

Author

Wolfdieter Lang, Dec 18 2013

Keywords

Comments

The length of row l of this table is delta(l) + 1 = A055034(l) + 1, l >= 1, that is: 2, 2, 2, 3, 3, 3, 4, 5, 4, 5, 6, 5, 7, 7, 5, ...
s(n):= 2*sin(Pi/n) is the length ratio side/R of a regular n-gon inscribed in a circle of radius R (in some length units). In general s(n)^2 = 4 - rho(n)^2 with rho(n):= 2*cos(Pi/n), the length ratio (smallest diagonal)/s(n) in the regular n-gon (n>=2). If n is even, say 2*l, l>=1, then s(2*l)^2 = 2 - rho(l) (because rho(2*l)^2 = rho(l) + 2). Therefore s(2*l) is an integer in the algebraic number field Q(rho(l)).
Its (monic) minimal polynomial is obtained from the conjugates of rho(l), called rho(l;j), j = 1, 2, ..., delta(l), which are the zeros of the minimal polynomial of rho(l) = rho(l;1) of degree delta(l) = A055034(l), called C(l, x) in A187360. These conjugates are therefore rho(l;j) = 2*cos(Pi*rpnodd(l,j)/l) where rpnodd(l,j) is the j-th entry of the list rpnodd(l) of the odd numbers < l which are relatively prime to l (for example, rpnodd(9) = [1,5,7], and rpnodd(9,2) = 5). From this the conjugates of s(2*l)^2 become 2 - rho(l;j), and the minimal polynomial of s(2*l)^2 is MPs2(l, x) = product( x - (2- rho(l;j)), j=1..delta(l)) for l >=1. Because the zeros of C(l, x) are integers in the algebraic number field Q(rho(l)) written in its power basis (see table 4 of the link under A187360 to the Q(2 cos(Pi/n)) paper) one finds, after expansion and reducing powers of rho(l) modulo C(l, rho(l)), directly the integer coefficients appropriate for this (monic) minimal polynomial. Only the equation C(l, rho(l)) = 0 is needed, not the trigonometric version of rho(l) and its powers.
This computation was motivated by a preprint of S. Mustonen, P. Haukkanen and J. K. Merikoski, called 'Polynomials associated with squared diagonals of regular polygons', Nov 16 2013.

Examples

			The table a(l,m) begins (n = 2*l):
  n,   l\m    0    1    2     3   4    5  6 ...
  2,   1:    -4    1
  4,   2:    -2    1
  6,   3:    -1    1
  8,   4:     2   -4    1
  10,  5:     1   -3    1
  12,  6:     1   -4    1
  14,  7:    -1    6   -5     1
  16,  8:     2  -16   20    -8   1
  18,  9:    -1    9   -6     1
  20, 10:     1  -12   19    -8   1
  22, 11:    -1   15  -35    28  -9    1
  24, 12:     1  -16   20    -8   1
  26, 13:     1  -21   70   -84  45  -11  1
  28, 14:     1  -24   86  -104  53  -12  1
  30, 15:     1  -24   26    -9   1
  ...
The minimal polynomial of s(10)^2 = (2*sin(Pi/10))^2 = 2 - rho(5) is MPs2(5, x) =  product(x - (2- rho(5;j)), j=1..2) = (x - (2 - phi))*(x - (2 - (1-phi))) with rho(5) = phi the golden section satisfying C(5, phi) = phi^2 - phi -1  = 0, hence MPs2(5, x) = 2 + phi - phi^2 - 3*x + x^2 = 1 - 3*x + x^2.
The row n=26 checks with WolframAlpha's MinimalPolynomial[(2*sin(Pi/26))^2 ,x] = 1-21 x+70 x^2-84 x^3+45 x^4-11 x^5+x^6.
		

Crossrefs

Cf. A232632 (odd n), A232633 (all n), A055034 (degree).

Programs

Formula

a(l,m) = [x^m] MPs2(l, x), l >= 1, m = 0, 1, ...., delta(l), with the minimal polynomial MPs2(l, x) of (2*sin(Pi/(2*l)))^2, given above in a comment. The degree delta(l) = A055034(l).

A232632 Coefficient table for the minimal polynomials of s(2*l+1)^2 = (2*sin(Pi/(2*l+1)))^2.

Original entry on oeis.org

0, 1, -3, 1, 5, -5, 1, -7, 14, -7, 1, -3, 9, -6, 1, -11, 55, -77, 44, -11, 1, 13, -91, 182, -156, 65, -13, 1, 1, -8, 14, -7, 1, 17, -204, 714, -1122, 935, -442, 119, -17, 1, -19, 285, -1254, 2508, -2717, 1729, -665, 152, -19, 1, 1, -16, 60, -78, 44, -11, 1, -23, 506, -3289, 9867, -16445, 16744, -10948, 4692, -1311, 230, -23, 1
Offset: 0

Views

Author

Wolfdieter Lang, Dec 18 2013

Keywords

Comments

The length of row l is delta(2*l+1) + 1 = A055034(2*l+1) + 1, l >= 0.
See the comments on A232631 (even n case) for s(n) = 2*sin(Pi/n) and the minimal polynomial of s(n)^2. Here n = 2*l+1 and s(2*l+1)^2 = 4 - rho(2*l+1)^2 is an integer in the algebraic number field Q(rho(2*l+1)). The minimal polynomial of s(2*l+1)^2 is then MPs2(2*l+1, x) = product(x - 2*(1 + cos(Pi*rpnodd(2*l+1,j)/(2*l+1))), j=1..delta(2*l+1)), l >= 0, where rpnodd(2*l+1) is the list of positive odd numbers < 2*l+1 and relatively prime to 2*l+1. rpnodd(2*l+1,j) is the j-th member of this increasingly ordered list. Here the identity 4 - (2*cos(Pi*(2*k+1)/(2*l+1)))^2 = 2*(1 - cos(Pi*2*(2*k+1)/(2*l+1))) = 2*(1 - (- cos(Pi*(2*l+1 - 2*(2*k+1))/ (2*l+1)))) has been used, and for 2*k+1 < 2*l+1 and gcd(2*k+1, 2*l+1) = 1 this becomes the product given above because 1 = gcd(-(2*k+1), 2*l+1) = gcd(-2*(2*k+1), 2*l+1) = gcd(2*l+1, -2*(2*k+1) + (2*l+1)).
This computation was motivated by a preprint of S. Mustonen, P. Haukkanen and J. K. Merikoski, called ``Polynomials associated with squared diagonals of regular polygons'', Nov 16 2013.

Examples

			The table a(l,m) begins (n = 2*l+1):
------------------------------------------------------------------------------------------------------
n,   l\m     0      1      2       3        4       5        6       7     8      9    10  11 ...
1,   0:      0      1
3,   1:     -3      1
5,   2:      5     -5      1
7,   3:     -7     14     -7       1
9,   4:     -3      9     -6       1
11,  5:    -11     55    -77      44      -11       1
13,  6:     13    -91    182    -156       65     -13        1
15,  7:      1     -8     14      -7        1
17,  8:     17   -204    714   -1122      935    -442      119     -17      1
19,  9:    -19    285  -1254    2508    -2717    1729     -665     152    -19     1
21, 10:      1    -16     60     -78       44     -11        1
23, 11:    -23    506  -3289    9867   -16445   16744   -10948    4692  -1311   230   -23   1
25, 12:      5   -125    875   -2675     4300   -4005     2275    -800    170   -20     1
27, 13:     -3     81   -540    1386    -1782    1287     -546     135    -18     1
....
n=29, l=14:  29,-1015,10556,-51272,140998,-243542,281010,-224808,127281,-51359,14674, -2900,377,-29,1.
n=31, l=15: -31, 1240, -14756, 82212, -260338, 520676, -700910, 660858, -447051, 219604, -78430, 20150, -3627, 434, -31, 1.
...
The minimal polynomial of s(5)^2 = (2*sin(Pi/5))^2 = 4 - rho(5)^2
= 2*(1 - cos(Pi*2/5)) = 2*(1 + cos(Pi*3/5)),  approx. 1.381966, is MPs2(5, x) =  product(x - 2*(1 + cos(Pi*rpnodd(5,j)/5)), j=1..2) = (x - 2*(1 + cos(Pi/5))*(x - 2*(1 + cos(Pi*3/5)) = (x - (2 + phi)*(x - (2 + 1 - phi)) = x^2 - 5*x + (6 + phi - phi^2) = x^2 - 5*x +5, where phi = rho(5) is the golden section.
The row n=17 checks with WolframAlpha's MinimalPolynomial[(2*sin(Pi/17))^2 ,x] = 17-204 x+714 x^2-1122 x^3+935 x^4-442 x^5+119 x^6-17 x^7+x^8.
		

Crossrefs

Cf. A232631 (even n), A232633 (all n), A055034.

Programs

Formula

a(l,m) = [x^m] MPs2(2*l+1, x), l >= 1, m = 0, 1, ...., delta(l), with the minimal polynomial MPs2(l, x) of (2*sin(Pi/(2*l+1)))^2, explained above in a comment.

A334429 Irregular triangle read by rows: T(n, k) gives the coefficients of x^k of the minimal polynomials of the algebraic number over the rationals rho(n)^2, with rho(n) = 2*cos(Pi/n), for n >= 1.

Original entry on oeis.org

-4, 1, 0, 1, -1, 1, -2, 1, 1, -3, 1, -3, 1, -1, 6, -5, 1, 2, -4, 1, -1, 9, -6, 1, 5, -5, 1, -1, 15, -35, 28, -9, 1, 1, -4, 1, 1, -21, 70, -84, 45, -11, 1, -7, 14, -7, 1, 1, -24, 26, -9, 1, 2, -16, 20, -8, 1, 1, -36, 210, -462, 495, -286, 91, -15, 1, -3, 9, -6, 1, -1, 45, -330, 924, -1287, 1001, -455, 120, -17, 1, 1, -12, 19, -8, 1
Offset: 1

Views

Author

Wolfdieter Lang, Jun 15 2020

Keywords

Comments

The length of row n is A023022(n) + 1, with A023022(1) = 1.
For the minimal polynomials of 2*sin(Pi/n) see A232633 (n >= 1), A232632 (even n) and A232631 (odd n).
The degree of the algebraic number over the rationals rho(n) = 2*cos(Pi/n) is delta(n) = A055034(n). The degree of rho(n)^2, for n = 2*m, is delta(m), for m >= 1. This is due to the trigonometric identity (half-angle formula) rho(2*m)^2 = 2 + rho(m). For m >= 0 rho(2*m+1)^2 has degree delta(2*l+1).
For the field extension Q(rho(n)) see the W. Lang link where the minimal polynomial of rho(n), named C(n, x), is shown in Table 2. See also A187360.
In both cases the conjugates (over Q) of rho(n), that is the roots of the minimal polynomial C(n, x) enter. This is the set with elements 2*cos(Pi*(2*m+1)/n) = R(2*m+1, rho(n)), for m from {0..floor((n-1)/2)} with gcd(2*m + 1, n) = 1. The polynomial R(n, x) = 2*T(n, x/2) is a monic version of the Chebyshev T polynomials; see A127672 for its coefficients. This list of numbers 2*m+1 is named rpnodd(n) (e.g., n = 12, rpnodd(n) = [1, 5, 7, 11]). #rpnodd(n) = delta(n). The conjugates of rho(n) are then rho(n; j) = 2*cos(Pi*rpnodd(n)_j/n), for j = 1, 2, ..., delta(n), and rho(n; 1) = rho(n), for n >= 2. Because rpnodd(1) is the empty set, a separate case is needed, namely rho(1; 1) = -2.
The minimal polynomials for rho(2*m)^2 are then MPc2(m, x) = Product_{j=1..delta(m)} (x - (2 + rho(m; j)) = Product_{j=1..delta(m)} (x - (2 + R(rpnodd(m)_j, rho(m)))) for m >= 2, and MPc2(1, x) = x. But because C(m, rho(m)) = 0, this has to be evaluated modulo this minimal polynomial of rho(m), that is all powers rho(m)^k with k >= delta(m) are replaced, leaving elements of Q(rho(m)) written in its power basis. Note that the trigonometric form of rho(m) is not used in this computation.
In the odd n case one uses for the conjugates of rho(2*m+1)^2 the formula R(2*m+1, x)^2 = R(2*(2*m+1), x) + 2, obtained from the product formula for R(n, x)*R(k, x) = R(n+m, x) + 2. Then for the reduced 2*m+1 values defined above R(2*(2*m+1), x) + 2 can be replaced by -R(rpnodd(2*m+1)j, x) + 2, for j = 1, ..., delta(2*m+1). Thus MPc2(2*m+1, x) = Product{j=1..delta(2*m+1)} (x - (2 - R(rpnodd(2*m+1)_j, x)), for m >= 1. But for m = 0 (n = 1) the degree of rho(1)^2 = (-2)^2 is 1, hence MPc2(1, x) = x - 4.
These polynomials appear, e.g., in the Salas and Sokal paper, see Table 1, p. 64, or p. 620, for n = 2..16, where rho(n)^2 are called Beraha numbers B_n. I was informed about this paper by Gary W. Adamson.

Examples

			The irregular triangle T(n, k) begins:
n\k   0    1    2    3     4     5     6    7    8  9 ...
1:   -4    1
2:    0    1
3:   -1    1
4;   -2    1
5:    1   -3    1
6:   -3    1
7:   -1    6   -5    1
8:    2   -4    1
9:   -1    9   -6    1
10:   5   -5    1
11:  -1   15  -35   28    -9     1
12:   1   -4    1
13:   1  -21   70  -84    45   -11     1
14:  -7   14   -7    1
15:   1  -24   26   -9     1
16:   2  -16   20   -8     1
17:   1  -36  210 -462   495  -286    91  -15    1
18:  -3    9   -6    1
19:  -1   45 -330  924 -1287  1001  -455  120  -17  1
20:   1  -12   19   -8
...
		

Crossrefs

Cf. A023022, A187360, A232631, A232632, A232633, A334431 (even n), A334432 (odd n).

Formula

T(n, k) = [x^k] MPc2(n, x), for n >= 1, and k = 0, 1, 2, ..., A023022(n), with A023022(1) = 1. For the Mpc2(n, x) formulas for even and odd n see the comments above.
Showing 1-4 of 4 results.