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.

A118828 Numerators of the convergents of the 2-adic continued fraction of zero given by A118827.

Original entry on oeis.org

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

Views

Author

Paul D. Hanna, May 01 2006

Keywords

Examples

			For n>=1, convergents A118828(k)/A118829(k) are:
at k = 4*n: -1/(2*A080277(n));
at k = 4*n+1: -1/(2*A080277(n)-1);
at k = 4*n+2: -1/(2*A080277(n)-2);
at k = 4*n-1: 0/(-1)^n.
Convergents begin:
1/1, -1/-2, 0/-1, -1/2, -1/1, 1/0, 0/1, 1/-8,
1/-7, -1/6, 0/-1, -1/10, -1/9, 1/-8, 0/1, 1/-24,
1/-23, -1/22, 0/-1, -1/26, -1/25, 1/-24, 0/1, 1/-32,
1/-31, -1/30, 0/-1, -1/34, -1/33, 1/-32, 0/1, 1/-64, ...
		

Crossrefs

Cf. A118827 (partial quotients), A118829 (denominators).

Programs

  • Maple
    seq(signum(mods(n+1, 4)*mods(n+1, 8)), n=1..100); # Peter Luschny, Oct 13 2020
  • PARI
    {a(n)=local(p=+1,q=-2,v=vector(n,i,if(i%2==1,p,q*2^valuation(i/2,2)))); contfracpnqn(v)[1,1]}

Formula

Period 8 sequence: [1, -1, 0, -1, -1, 1, 0, 1].
G.f.: (1 - x - x^3)/(1 + x^4).
Assuming offset 0 with a(0) = 1, then a has the g.f. (1 + x - x^2)/(1 + x^4) and a(n) = signum(mods(n+1, 4)*mods(n+1, 8)), where mods(a, b) is the symmetric modulo function. - Peter Luschny, Oct 13 2020