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-9 of 9 results.

A187360 Coefficient array for minimal polynomials of 2*cos(Pi/n) (rising powers of x).

Original entry on oeis.org

2, 1, 0, 1, -1, 1, -2, 0, 1, -1, -1, 1, -3, 0, 1, 1, -2, -1, 1, 2, 0, -4, 0, 1, -1, -3, 0, 1, 5, 0, -5, 0, 1, -1, 3, 3, -4, -1, 1, 1, 0, -4, 0, 1, -1, -3, 6, 4, -5, -1, 1, -7, 0, 14, 0, -7, 0, 1, 1, -4, -4, 1, 1, 2, 0, -16, 0, 20, 0, -8, 0, 1, 1, 4, -10, -10, 15, 6, -7, -1, 1
Offset: 1

Views

Author

Wolfdieter Lang, Jul 14 2011

Keywords

Comments

The degree delta(n) of the monic integer row polynomial, call it C(n,x), is A055034(n).
This minimal polynomial of the algebraic number 2*cos(Pi/n), n>=1, is given by
C(n,x) = sum(a(n,m)*x^m,m=0..A055034(n)) = (2^delta(n))*Psi(2n,x/2), with Psi(n,x) the minimal polynomial of cos(2Pi/n), with rational coefficient array A181875/A181876. There also references and links are found. See especially Watkins and Zeitlin for Psi(n,x).
The zeros of C(n,x), n>=2, are 2*cos(Pi k/n), with k=1,...,n-1 and gcd(k,2n)=1. For n=1 the zero is -2. Alternatively, these zeros are 2*cos(Pi(2l+1)/n), with l=0,...,floor((n-2)/2) and gcd(2l+1,n)=1. For n=1 take l=0.
The first column looks like the differently signed A020513(n),n>=1.
The polynomial for row n=2^m, m>=1, coincides with the row polynomial R(2^(m-1),x) of A127672. See the factorization of these R-polynomials (also known as Chebyshev C-polynomials) given there. - Wolfdieter Lang, Sep 15 2011
From Wolfdieter Lang, Nov 04 2013: (Start)
The norm N(rho(n)) of rho(n) = 2*cos(Pi/n), n >= 1, in the algebraic number field Q(rho(n)) is given by (-1)^delta(n)* C(n, 0), with C(n, x) of degree delta(n) = A055034(n). If N(rho(n)) equals +1 or -1 then 1/rho(n), which is an element of Q(rho(n)), is in fact an integer in this number field. For the 1/rho(n) formula in terms of the C coefficients see A230079. Thus 1/rho(n) is a Q(rho(n))-integer if and only if C(n, 0) is +1 or -1 , and this happens if and only if n is from the set {A230078(k), k >= 2}.
The negation says that, for n a positive integer, 1/rho(n) is not a Q(rho(n))-integer if and only if n is 1 or of the form 2*p^m, m >= 0 and p a prime, which are the numbers of A138929 including 1.
The proof uses for case (i): n = 2*m+1, m >= 1, the fact that C(2*m+1, 0)^2 = (product( 2*cos(Pi*(2*l+1)/(2*m+1)), l=0 .. m-1 and gcd(2*l+1, 2*m+1) = 1))^2 = (product(2*cos(Pi*k/(2*m+1)), k=1..L and gcd(k, 2*m+1) = 1))^2 = cyclotomic(2*m +1, -1). See the linked Q(rho(n)) paper, eq. (31), for a product formula for cyclotomic(n, -1). With the prime factorization of 2*m+1, and the fact that only the squarefree kernel of 2*m+1 enters (see an Oct 29 2013 comment on A013595), one finds, form the formula for cyclotomic(p1*p2*...*pk, x) involving the Moebius function, cyclotomic(2*m +1, -1) = +1, m >= 1. C(1, 0) = +2. For case (ii): n even, one has C(2^m, 0) = 0, -2, +2, for m = 1 , 2, >=3, respectively (see eq. (39) of the linked Q(rho(n)) paper). For odd prime p: (-1)^((p-1)/2)*C(2*p^m, 0) = cyclotomic(2*p^m, -1) = cyclotomic(2*p, -1) = cyclotomic(p, +1) = p, for m >= 1. For more than one odd prime in the squarefree kernel of n = 2*m, m >= 1, one finds C(2*m, 0) = +1 from cyclotomic(2*p1*...*pk, -1) = +1, for k >= 2. (End)
For the conversion of the C-polynomials into sums of Chebyshev's S-polynomials (A049310) see A255237. - Wolfdieter Lang, Mar 16 2015

Examples

			n=1:  2, 1;
n=2:  0, 1;
n=3: -1, 1;
n=4: -2, 0, 1;
n=5: -1,-1, 1;
n=6: -3, 0, 1;
n=7:  1,-2,-1, 1;
n=8:  2, 0,-4, 0, 1;
n=9: -1,-3, 0, 1;
n=10: 5, 0,-5, 0, 1;
...
C(2,x) = R(1,x), C(4,x) = R(2,x), C(8,x) = R(4,x),... with R(n,x) from A127672. - _Wolfdieter Lang_, Sep 15 2011
		

Crossrefs

Cf. A192003 (row sums). A192004 (alternating row sums).

Programs

  • Maple
    f:= proc(n) local P,z,j;
       P:= factor(evala(Norm(z-convert(2*cos(Pi/n),RootOf))));
       if type(P,`^`) then P:= op(1,P) fi;
       seq(coeff(P,z,j),j=0..degree(P));
    end proc:
    seq(f(n),n=1..20); # Robert Israel, Aug 04 2015
  • Mathematica
    Flatten[ CoefficientList[ Table[ MinimalPolynomial[2*Cos[Pi/n], x], {n, 1, 17}], x]] (* Jean-François Alcover, Sep 26 2011 *)
  • PARI
    halftot(n)=if(n<=2, 1, eulerphi(n)/2); \\ A023022
    default(realprecision, 110);
    row(n) = Vecrev(algdep(2*cos(2*Pi/n), halftot(n))); \\ Michel Marcus, Sep 19 2023

Formula

a(n,m) = [x^m] C(n,x), n>=1, m=0..A055034(n), with the minimal (monic and integer) polynomial C(n,x) of 2*cos(Pi/n). See the comment above.

A013595 Irregular triangle read by rows: coefficients of cyclotomic polynomial Phi_n(x) (exponents in increasing order).

Original entry on oeis.org

0, 1, -1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, -1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 0, 1, -1, 1, 0, -1, 1
Offset: 0

Views

Author

Keywords

Comments

We follow Maple in defining Phi_0 to be x; it could equally well be taken to be 1.
From Wolfdieter Lang, Oct 29 2013: (Start)
The length of row n >= 1 of this table is phi(n) + 1 = A000010(n) + 1. Row n = 0 has here length 2.
Phi_n(x) is the minimal polynomial of omega_n := exp(i*2*Pi/n) over the rationals. Namely, Phi_n(x) = Product_{k=0..n-1, gcd(k,n)=1} (x - (omega_n)^k). See the Graham et al. reference, 4.50 a, pp. 149, 506.
Phi_n(x) = Product_{d|n} (x^d - 1)^(mu(n/d)) with the Moebius function mu(n) = A008683(n), n >= 1. See the Graham et al. reference, 4.50 b, pp. 149, 506.
Phi_n(x) = Phi_{rad(n)}(x^(n/rad(n))), n >= 2, with rad(n) = A007947(n), the squarefree kernel of n. Proof from the preceding formula, where only squarefree n/d (A005117) from the set of divisors of n enter, by mapping each factor (numerator or denominator) of the left hand side to one of the right hand side and vice versa.
(End)
Each row can be considered as the last column of the companion matrix of the cyclotomic polynomial: A000010(n) is the size of such a square matrix, last column has opposite signs and the last term (before last term of each row in A013595) equal to A008683(n). - Eric Desbiaux, Dec 14 2015

Examples

			Phi_0 = x; Phi_1 = x - 1; Phi_2 = x + 1; Phi_3 = x^2 + x + 1; Phi_4 = x^2 + 1; ...
From _Wolfdieter Lang_, Oct 29 2013: (Start)
The irregular triangle a(n,m) begins:
n\m 0  1  2  3  4  5  6  7  8  9 10 11 12 ...
0:  0  1
1: -1  1
2:  1  1
3:  1  1  1
4:  1  0  1
5:  1  1  1  1  1
6:  1 -1  1
7:  1  1  1  1  1  1  1
8:  1  0  0  0  1
9:  1  0  0  1  0  0  1
10: 1 -1  1 -1  1
11: 1  1  1  1  1  1  1  1  1  1  1
12: 1  0 -1  0  1
13: 1  1  1  1  1  1  1  1  1  1  1  1  1
14: 1 -1  1 -1  1 -1  1
15: 1 -1  0  1 -1  1  0 -1  1
...
Phi_15(x) = (x^1 - 1)*((x^3 - 1)^(-1))*((x^5 - 1)^(-1))*(x^15 - 1) because mu(15) = mu(1) = +1 and mu(3) = mu(5) = -1. Hence Phi_15(x) = 1 - x + x^3 - x^4 + x^5 - x^7 + x^8, giving row n = 15.
Example for the reduction via the squarefree kernel: Phi_12(x) = Phi_6(x^(12/6)) = Phi_6(x^2). By the formula with the Mobius function Phi_6(x) = Phi_2(x^3)/Phi_2(x) = 1 - x + x^2 and with x -> x^2 this becomes Phi_12(x) = 1 - x^2 + x^4.
(End)
		

References

  • E. R. Berlekamp, Algebraic Coding Theory, McGraw-Hill, 1968; see p. 90.
  • Z. I. Borevich and I. R. Shafarevich, Number Theory. Academic Press, NY, 1966, p. 325.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics, Addison-Wesley, 1991, p. 137.
  • K. Ireland and M. Rosen, A Classical Introduction to Modern Number Theory, Springer, 1982, p. 194.

Crossrefs

Cf. A013596, A020500 (row sums, n >= 1), A020513 (alternating row sums).
For record coefficients see A160340, A262404, A262405, A278567.
Column m=1 is A157657.

Programs

  • Maple
    N:= 100:  # to get coefficients up to cyclotomic(N,x)
    with(numtheory):
    for n from 0 to N do
      C:= cyclotomic(n,x);
      L[n]:= seq(coeff(C,x,i),i=0..degree(C));
    od:
    A:= [seq](L[n],n=0..N): # note that A013595(n) = A[n+1]
    # Robert Israel, Apr 17 2014
  • Mathematica
    Table[CoefficientList[x^KroneckerDelta[n] Cyclotomic[n, x], x], {n, 0, 15}] // Flatten (* Peter Luschny, Dec 27 2016 *)
  • PARI
    row(n) = if (n==0, p=x, p = polcyclo(n)); Vecrev(p); \\ Michel Marcus, Dec 14 2015

Formula

a(n,m) = [x^m] Phi_n(x), n >= 0, 0 <= m <= phi(n), with phi(n) = A000010(n). - Wolfdieter Lang, Oct 29 2013

Extensions

Maple program corrected by Robert Israel, Apr 17 2014

A138929 Twice the prime powers A000961.

Original entry on oeis.org

2, 4, 6, 8, 10, 14, 16, 18, 22, 26, 32, 34, 38, 46, 50, 54, 58, 62, 64, 74, 82, 86, 94, 98, 106, 118, 122, 128, 134, 142, 146, 158, 162, 166, 178, 194, 202, 206, 214, 218, 226, 242, 250, 254, 256, 262, 274, 278, 298, 302, 314, 326, 334, 338, 346, 358, 362, 382
Offset: 1

Views

Author

M. F. Hasler, Apr 04 2008

Keywords

Comments

Except for the initial term a(1)=2, indices k such that A020513(k)=Phi[k](-1) is prime, where Phi is a cyclotomic polynomial.
This is illustrated by the PARI code, although it is probably more efficient to calculate a(n) as 2*A000961(n).
{ a(n)/2 ; n>1 } are also the indices for which A020500(k)=Phi[k](1) is prime.
A188666(k) = A000961(k+1) for k: a(k) <= k < a(k+1), k > 0;
A188666(a(n)) = A000961(n+1). [Reinhard Zumkeller, Apr 25 2011]

Crossrefs

Cf. A000961, A020513, A138920-A138940, A230078 (complement).

Programs

  • Maple
    a := n -> `if`(1>=nops(numtheory[factorset](n)),2*n,NULL):
    seq(a(i),i=1..192); # Peter Luschny, Aug 12 2009
  • Mathematica
    Join[{2}, Select[ Range[3, 1000], PrimeQ[ Cyclotomic[#, -1]] &]] (* Robert G. Wilson v, Mar 25 2012 - modified by Paolo Xausa, Aug 30 2024 to include a(1) *)
    2*Join[{1}, Select[Range[500], PrimePowerQ]] (* Paolo Xausa, Aug 30 2024 *)
  • PARI
    print1(2);for( i=1,999, isprime( polcyclo(i,-1)) & print1(",",i)) /* use ...subst(polcyclo(i),x,-2)... in PARI < 2.4.2. It should be more efficient to calculate a(n) as 2*A000961(n) ! */
    
  • Python
    from sympy import primepi, integer_nthroot
    def A138929(n):
        def f(x): return int(n-1+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        kmin, kmax = 0,1
        while f(kmax) > kmax:
            kmax <<= 1
        while kmax-kmin > 1:
            kmid = kmax+kmin>>1
            if f(kmid) <= kmid:
                kmax = kmid
            else:
                kmin = kmid
        return kmax<<1 # Chai Wah Wu, Aug 29 2024

Formula

a(n) = 2*A000961(n).
Equals {2} union { k | Phi[k](-1)=A020513(k) is prime } = {2} union { 2k | Phi[k](1)=A020500(k) is prime }.

A020501 Cyclotomic polynomials at x=-2.

Original entry on oeis.org

-2, -3, -1, 3, 5, 11, 7, 43, 17, 57, 31, 683, 13, 2731, 127, 331, 257, 43691, 73, 174763, 205, 5419, 2047, 2796203, 241, 1016801, 8191, 261633, 3277, 178956971, 151, 715827883, 65537, 1397419, 131071, 24214051
Offset: 0

Views

Author

Keywords

Comments

a(0) depends on the definition of the 0th cyclotomic polynomial; Maple defines it as x, but Mathematica defines it as 1. - T. D. Noe, Jul 23 2008 [a(0) = x is correct. - N. J. A. Sloane, Aug 01 2008]
A020501[2n] = A019320[n] for all odd n > 1. (Because if m > 1 is odd, then Phi_2m(x) = Phi_m(-x) as demonstrated by Bloom). - Antti Karttunen, Aug 02 2001

Crossrefs

Programs

  • Maple
    with(numtheory,cyclotomic); f := n->subs(x=-2,cyclotomic(n,x)); seq(f(i),i=0..64);
  • Mathematica
    Join[{-2}, Cyclotomic[Range[50], -2]] (* Paolo Xausa, Feb 26 2024 *)
  • PARI
    a(n) = if (n, polcyclo(n, -2), -2); \\ Michel Marcus, Mar 05 2016

A230078 Complement of A138929: positive integers not of the form 2*p^k, k >= 0, p a prime (also 2).

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 12, 13, 15, 17, 19, 20, 21, 23, 24, 25, 27, 28, 29, 30, 31, 33, 35, 36, 37, 39, 40, 41, 42, 43, 44, 45, 47, 48, 49, 51, 52, 53, 55, 56, 57, 59, 60, 61, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 80, 81, 83, 84, 85, 87, 88, 89, 90, 91, 92, 93, 95, 96, 97, 99, 100
Offset: 1

Views

Author

Wolfdieter Lang, Nov 02 2013

Keywords

Comments

The complement relative to the positive integers of the present sequence is A138929.
The sequence includes all positive integers of the forms (i) odd, (ii) 2^k*p, p an odd prime and k>=2, and (iii) 2^e0*p1^e1*p2^e2 *** pk^ek, k >= 2, with odd primes p1, ..., pk, and each exponent from {e0, ..., ek} is >= 1.
For a(n) > 1 a regular a(n)-gon, with length ratio (smallest diagonal)/side rho(a(n)) = 2*cos(Pi/a(n)), the inverse of rho(a(n)), which is an element of the algebraic number field Q(rho(a(n))), is in fact a Q(rho(a(n)))-integer. For a(1)=1 rho(1) = -2, and the inverse is not a Q-integer.

Examples

			Even members a(n) of the form (ii) 2^k*p, p an odd prime and k>=2 are: 12, 20, 24, 28, 36, 40, 44, 48, 52, 56, 68, 72, 76, 80, 88, 92, 96, 100,...
Even members a(n) of the form (iii), given above, include 30, 42, 60, 66, 70, 78, 84, 90, ...
For the regular 5-gon (pentagon) rho(5) = tau = (1 + sqrt(5))/ 2 (the golden section). The number field is Q(rho(5)), and for the inverse one has 1/rho(5) = -1*1 + 1* rho(5) (in the power basis <1, rho(5)>, in which Q(rho(5))-integers have integer coefficients).
For the regular 7-gon rho(7) = 2*cos(Pi/7), (approximately 1.801937736) is of degree 3, and 1/rho(7) = 2*1 + 1*rho(7) - 1*rho(7)^2, (approximately 0.5549581320), hence a Q(rho(7))- integer.
For Gauss' regular 17-gon rho(17) = 2*cos(Pi/17) (approximately 1.965946199) is of degree 8 and 1/rho(17) = -4*1+ 10*rho(17)^1 + 10*rho(17)^2  - 15*rho(17)^3 -6*rho(17)^4 + 7*rho(17)^5 + 1*rho(17)^6  -1*rho(17)^7, (approximately 0.5086610), hence this is a Q(rho(17))- integer.
		

Crossrefs

Cf. A138929 (complement), 2*A020513, A230079 (1/rho(a(n))).

Programs

  • Mathematica
    With[{upto = 100}, Complement[Range[upto], 2*Join[{1}, Select[Range[upto/2], PrimePowerQ]]]] (* Paolo Xausa, Aug 30 2024 *)
  • Python
    from sympy import primepi, integer_nthroot
    def A230078(n):
        if n == 1: return 1
        def f(x): return int(n+1+sum(primepi(integer_nthroot(x>>1,k)[0]) for k in range(1,(x>>1).bit_length())))
        kmin, kmax = 0,1
        while f(kmax) > kmax:
            kmax <<= 1
        while kmax-kmin > 1:
            kmid = kmax+kmin>>1
            if f(kmid) <= kmid:
                kmax = kmid
            else:
                kmin = kmid
        return kmax # Chai Wah Wu, Aug 29 2024

A105609 Sylvester numbers for 1/(1+x^2).

Original entry on oeis.org

1, 0, -1, -2, 1, -3, -1, 2, -1, 5, -1, 1, 1, -7, 1, 2, 1, -3, -1, 1, 1, -11, -1, 1, 1, 13, -1, 1, 1, 1, -1, 2, 1, 17, 1, 1, 1, -19, 1, 1, 1, 1, -1, 1, 1, -23, -1, 1, -1, 5, 1, 1, 1, -3, 1, 1, 1, 29, -1, 1, 1, -31, 1, 2, 1, 1, -1, 1, 1, 1, -1, 1, 1, 37
Offset: 0

Views

Author

Paul Barry, Apr 15 2005

Keywords

Examples

			(x+I)(x-I)=1+x^2
		

Crossrefs

Programs

  • Maple
    A105609 := proc(n)local k: round(Re(mul(evalf(`if`(gcd(n+1, k)=1, I+I*exp(2*Pi*I*k/(n+1)), 1)),k=1..n))): end:
    seq(A105609(n),n=0..20); # Nathaniel Johnston, Apr 20 2011
    A105609 := proc(n) local k; mul(`if`(igcd(n+1,k)=1, 2*cos(Pi*k/(n+1)), 1), k=1..n) end; seq(round(A105609(n)), n = 0..73); # Peter Luschny, Jun 09 2011
  • Mathematica
    f[n_] := FullSimplify[ Expand[Times @@ (I + I*Exp[2Pi*I*Select[Range[n], GCD[ #, n] == 1 &]/n])]]; Table[ f[n], {n, 0, 32}] (* Robert G. Wilson v, Aug 02 2005 *)

Formula

a(n) = Product_{k=1..n} if(gcd(n+1, k)=1, (I+I*exp(2*Pi*I*k/(n+1))), 1), I=sqrt(-1).
alpha(n) = Product_{0A014963 with cos replaced by sin. - Peter Luschny, Jun 09 2011

Extensions

a(40)-a(73) from Nathaniel Johnston, Apr 20 2011

A289386 Number of rounds of 'deal one, skip one' shuffling required to return a deck of n cards to its original order.

Original entry on oeis.org

1, 2, 3, 2, 5, 6, 5, 4, 6, 6, 15, 12, 12, 30, 15, 4, 17, 18, 10, 20, 21, 14, 24, 90, 63, 26, 27, 18, 66, 12, 210, 12, 33, 90, 35, 30, 110, 120, 120, 26, 41, 42, 105, 30, 45, 30, 60, 48, 120, 50, 42, 510, 53, 1680, 120, 1584, 57, 336, 276, 60, 2665, 720, 8415
Offset: 1

Views

Author

Andrew Warren, Jul 04 2017

Keywords

Comments

Origin unknown. First encountered by this author as part of an employment-interview question at Apple Inc, in early 2016.
While holding a deck of n cards:
1. Deal the top card from the deck onto the table ('deal one').
2. Move the next card from the top of the deck to the bottom of the deck ('skip one').
3. Repeat steps 1 and 2 until all cards are on the table. This is a round.
4. Pick up the deck from the table and repeat steps 1 through 3 until the deck is in its original order.
From Robert Israel, Jul 06 2017: (Start)
a(n) <= A000793(n).
a(n) divides n!.
Conjecture: a(n) < n for infinitely many n.
Conjecture: the set of n for which the permutation is a single n-cycle, and thus a(n) = n, has nonzero density. (End)
It appears that for n = 2^k and all m > n, a(n) <= a(m). - Andrew Warren, Jul 15 2017
a(2^(k+1)) / a(2^k) = A020513(k+2) at least for 1 <= k <= 30, according to the values computed by Andrew Warren. - Andrey Zabolotskiy, Apr 02 2018

Examples

			Cards are labeled 'A', 'B', 'C', etc. 'ABCD' is a deck with 'A' on top, 'D' on the bottom.
For n = 4:
Round 1:
Hand: ABCD    Table: [empty] - initial state of Round 1
Hand: BCD     Table: A       - Deal one
Hand: CDB     Table: A       - Skip one
Hand: DB      Table: CA      - Deal one
Hand: BD      Table: CA      - Skip one
Hand: D       Table: BCA     - Deal one
Hand: D       Table: BCA     - Skip one
Hand: [empty] Table: DBCA    - Deal one, end of Round 1
Round 2:
Hand: DBCA    Table: [empty] - Initial state of Round 2
Hand: BCA     Table: D       - Deal one
Hand: CAB     Table: D       - Skip one
Hand: AB      Table: CD      - Deal one
Hand: BA      Table: CD      - Skip one
Hand: A       Table: BCD     - Deal one
Hand: A       Table: BCD     - Skip one
Hand [empty]  Table: ABCD    - Deal one, end of Round 2
The deck of 4 cards is in its original order ('ABCD') after 2 rounds, so a(4) = 2.
		

Crossrefs

Cf. A000793, A051732 (variation with cards dealt face up), A020513, A051168.

Programs

  • C
    // see link
    
  • Maple
    F:= proc(n)
    local deck, table, i;
    deck:= [$1..n];
    table:= NULL;
    for i from 1 to n-1 do
      table:= deck[1],table;
      deck:= deck[[$3..nops(deck),2]];
    od:
    ilcm(op(map(nops,convert([deck[1],table],'disjcyc'))));
    end proc:
    map(F, [$1..100]); # Robert Israel, Jul 06 2017
  • Mathematica
    P[n_, i_] := Module[{d = 2i - 1}, While[d < n, d *= 2]; 2n - d];
    Follow[s_, f_] := Module[{t = f[s], k = 1}, While[t > s, k++; t = f[t]]; If[s == t, k, 0]];
    CyclePoly[n_, x_] := Module[{q = 0}, For[i = 1, i <= n, i++, l = Follow[i, P[n, #]&]; If[l != 0, q += x^l]]; q];
    a[n_] := Module[{q = CyclePoly[n, x], m = 1}, For[i = 1, i <= Exponent[q, x], i++, If[Coefficient[q, x, i] != 0, m = LCM[m, i]]]; m];
    Array[a, 60] (* Jean-François Alcover, Apr 09 2020, after Andrew Howroyd *)
  • PARI
    deal(v)=my(deck=List(v),new=List(),cutoff=4000+#v,i=1); while(#deck>=i, listput(new,deck[i]); if(i++>#deck, break); listput(deck, deck[i]); if(#deck>cutoff, deck=List(deck[i+1..#deck]); i=0); i++); Vecrev(new)
    ordered(v)=for(i=1,#v, if(v[i]!=i, return(0))); 1
    a(n)=my(v=[1..n],t=1); while(!ordered(v=deal(v)), t++); t \\ Charles R Greathouse IV, Jul 06 2017
    
  • PARI
    \\ alternative for larger n such as 2^n.
    P(n,i)=my(d=2*i-1); while(ds, k++; t=f(t)); if(s==t, k, 0)}
    CyclePoly(n, x)={my(q=0); for(i=1, n, my(l=Follow(i, j->P(n, j))); if(l, q+=x^l)); q}
    a(n)={my(q=CyclePoly(n, x), m=1); for(i=1, poldegree(q), if(polcoeff(q, i), m=lcm(m, i))); m} \\ Andrew Howroyd, Nov 11 2017

A241039 Cyclotomic(n,2048).

Original entry on oeis.org

1, 2047, 2049, 4196353, 4194305, 17600780175361, 4192257, 73823022692637345793, 17592186044417, 73786976303428141057, 17583600302081, 1298708349570020393652962442872833, 17592181850113
Offset: 0

Views

Author

T. D. Noe, Apr 15 2014

Keywords

Comments

Are all terms composite? At least the first 10000 terms are.

Crossrefs

Cf. A019320-A019331 (cyclotomic polynomials evaluated at 2..13).
Cf. A020500-A020513 (cyclotomic polynomials evaluated at 1, -2..-13, -1).
Cf. A117544 (least k such that cyclotomic(n,k) is prime).
Cf. A117545 (least k such that cyclotomic(k,n) is prime).

Programs

  • Mathematica
    Table[Cyclotomic[k, 2048], {k, 0, 20}]

A384765 a(n) is the rad(n)-th cyclotomic polynomial evaluated at x = -1.

Original entry on oeis.org

-2, 0, 1, 0, 1, 3, 1, 0, 1, 5, 1, 3, 1, 7, 1, 0, 1, 3, 1, 5, 1, 11, 1, 3, 1, 13, 1, 7, 1, 1, 1, 0, 1, 17, 1, 3, 1, 19, 1, 5, 1, 1, 1, 11, 1, 23, 1, 3, 1, 5, 1, 13, 1, 3, 1, 7, 1, 29, 1, 1, 1, 31, 1, 0, 1, 1, 1, 17, 1, 1, 1, 3, 1, 37, 1, 19, 1, 1, 1, 5, 1
Offset: 1

Views

Author

Mats Granvik, Jun 09 2025

Keywords

Comments

The polynomials from A374385 (for n > 1), evaluated at x = -1.

Crossrefs

Programs

  • Mathematica
    nn = 81; A023900[n_] := Total[Divisors[n]*MoebiusMu[Divisors[n]]]; tt = Table[Simplify@Factor[Sum[A023900[GCD[n, k]]*x^k, {k, 1, n}]/(1 - x^n)], {n, 1, nn}];
    Denominator[tt] /. {x -> -1}

Formula

a(n) = A020513(A007947(n)). - Andrei Zabolotskii, Jul 21 2025
Showing 1-9 of 9 results.