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

A118824 2-adic continued fraction of zero, where a(n) = -2 if n is odd, A006519(n/2) otherwise.

Original entry on oeis.org

-2, 1, -2, 2, -2, 1, -2, 4, -2, 1, -2, 2, -2, 1, -2, 8, -2, 1, -2, 2, -2, 1, -2, 4, -2, 1, -2, 2, -2, 1, -2, 16, -2, 1, -2, 2, -2, 1, -2, 4, -2, 1, -2, 2, -2, 1, -2, 8, -2, 1, -2, 2, -2, 1, -2, 4, -2, 1, -2, 2, -2, 1, -2, 32, -2, 1, -2, 2, -2, 1, -2, 4, -2, 1, -2, 2, -2, 1, -2, 8, -2, 1, -2, 2, -2, 1, -2, 4, -2, 1, -2, 2, -2, 1, -2, 16, -2, 1, -2, 2, -2, 1
Offset: 1

Views

Author

Paul D. Hanna, May 01 2006

Keywords

Comments

Limit of convergents equals zero; only the 6th convergent is indeterminate. Other 2-adic continued fractions of zero are: A118821, A118827, A118830. A006519(n) is the highest power of 2 dividing n; A080277 = partial sums of A038712, where A038712(n) = 2*A006519(n) - 1.

Examples

			For n >= 1, convergents A118825(k)/A118826(k):
  at k = 4*n: 1/A080277(n);
  at k = 4*n+1: 2/(2*A080277(n)-1);
  at k = 4*n+2: 1/(A080277(n)-1);
  at k = 4*n-1: 0.
Convergents begin:
  -2/1, -1/1, 0/-1, -1/-1, 2/1, 1/0, 0/1, 1/4,
  -2/-7, -1/-3, 0/-1, -1/-5, 2/9, 1/4, 0/1, 1/12,
  -2/-23, -1/-11, 0/-1, -1/-13, 2/25, 1/12, 0/1, 1/16,
  -2/-31, -1/-15, 0/-1, -1/-17, 2/33, 1/16, 0/1, 1/32, ...
		

Crossrefs

Cf. A006519, A080277; convergents: A118825/A118826; variants: A118821, A118827, A118830; A100338.

Programs

  • Mathematica
    Array[If[OddQ@ #, -2, 2^(IntegerExponent[#, 2] - 1)] &, 102] (* Michael De Vlieger, Nov 06 2018 *)
  • PARI
    a(n)=local(p=-2,q=+1);if(n%2==1,p,q*2^valuation(n/2,2))

A230075 Period 8: repeat [2, 1, 0, 1, -2, -1, 0, -1].

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Oct 23 2013

Keywords

Comments

This is A118825(n+5), n >= 0. (The g.f. given there is not quite correct, because then a(0) = 0 but it should be 1.)
This sequence a(n), n >= 2, is product(2*cos((2*l+1)*Pi/2), l=0..floor((n-2)/2)). This is the unrestricted product which appears in the formula for C(n, 0) with the minimal polynomial C of rho(n):=2*cos(Pi/n) (see A187360), the length ratio (smallest diagonal)/side in the regular n-gon. The restriction gcd(2*l+1, n) = 1 is ineffective for n = 2^k, k>=1, and for n = odd prime p. Therefore norm(rho(n)) = (-1)^delta(n)*C(n, 0) with delta(n) (see A055034) the degree of C, can be computed from the present sequence for these two cases.

Crossrefs

Programs

Formula

O.g.f.: (2 + x + x^3) / (1 + x^4).
a(n) = 2*(-1)^(n/4) if n == 0 (mod 4); a(n) == 0 if n == 2 (mod 4); a(n) = (-1)^((n-1)/4) if n == 1 (mod 4); a(n) == (-1)^((n-3)/4) if n == 3 (mod 4).
a(n) = Product_{l=0..floor((n-2)/2)} 2*cos((2*l+1)*Pi/2). Proof via the product formulas for the four (mod 4) cases; see the comments for subsequences like A033999, and the product of the zeros of Chebyshev S-polynomials (A049310) from S(n-1, 0) which is known.
a(n) = sqrt((n+2)^2 mod 8)*(-1)^floor(n/4). - Wesley Ivan Hurt, Jan 01 2014
a(n) = (cos(Pi*(2*n+q-r-s)/8)-cos(Pi*(-2*n+q+r-s)/8)+sin(Pi*(-2*n+q-r+s)/8)+3*sin(Pi*(2*n+q+r+s)/8))/2 where q = 1+(-1)^n, r = 2*sin(n*Pi/2) and s = 2*cos(n*Pi/2). - Wesley Ivan Hurt, Oct 06 2018

A118826 Denominators of the convergents of the 2-adic continued fraction of zero given by A118824.

Original entry on oeis.org

1, 1, -1, -1, 1, 0, 1, 4, -7, -3, -1, -5, 9, 4, 1, 12, -23, -11, -1, -13, 25, 12, 1, 16, -31, -15, -1, -17, 33, 16, 1, 32, -63, -31, -1, -33, 65, 32, 1, 36, -71, -35, -1, -37, 73, 36, 1, 44, -87, -43, -1, -45, 89, 44, 1, 48, -95, -47, -1, -49, 97, 48, 1, 80, -159, -79, -1, -81, 161, 80, 1, 84, -167, -83, -1, -85, 169, 84, 1, 92
Offset: 1

Views

Author

Paul D. Hanna, May 01 2006

Keywords

Examples

			For n>=1, convergents A118825(k)/A118826(k) are:
at k = 4*n: 1/A080277(n);
at k = 4*n+1: 2/(2*A080277(n)-1);
at k = 4*n+2: 1/(A080277(n)-1);
at k = 4*n-1: 0.
Convergents begin:
-2/1, -1/1, 0/-1, -1/-1, 2/1, 1/0, 0/1, 1/4,
-2/-7, -1/-3, 0/-1, -1/-5, 2/9, 1/4, 0/1, 1/12,
-2/-23, -1/-11, 0/-1, -1/-13, 2/25, 1/12, 0/1, 1/16,
-2/-31, -1/-15, 0/-1, -1/-17, 2/33, 1/16, 0/1, 1/32, ...
		

Crossrefs

Cf. A006519, A080277; A118824 (partial quotients), A118825 (numerators).

Programs

  • PARI
    {a(n)=local(p=-2,q=+1,v=vector(n,i,if(i%2==1,p,q*2^valuation(i/2,2)))); contfracpnqn(v)[2,1]}

Formula

a(4*n) = (-1)^n*A080277(n); a(4*n+1) = -(-1)^n*(2*A080277(n)-1); a(4*n+2) = -(-1)^n*(A080277(n)-1); a(4*n-1) = (-1)^n.
Showing 1-3 of 3 results.