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

A118822 Numerators of the convergents of the 2-adic continued fraction of zero given by A118821.

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
Offset: 1

Views

Author

Paul D. Hanna, May 01 2006

Keywords

Examples

			For n>=1, convergents A118822(k)/A118823(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/(-1)^n.
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. A118821 (partial quotients), A118823 (denominators).

Programs

  • Maple
    A118822:=n->sqrt((n+1)^2 mod 8)*(-1)^floor((n+2)/4); seq(A118822(n), n=1..100); # Wesley Ivan Hurt, Jan 01 2014
  • Mathematica
    Table[Sqrt[Mod[(n+1)^2, 8]](-1)^Floor[(n+2)/4], {n, 100}] (* Wesley Ivan Hurt, Jan 01 2014 *)
  • 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)[1,1]}
    for(n=0,80,print1(a(n),", "))
    
  • PARI
    {a(n) = [2,-1,0,-1,-2,1,0,1][(n-1)%8+1];} \\ Joerg Arndt, Jan 02 2014

Formula

Period 8 sequence: [2,-1,0,-1,-2,1,0,1].
G.f.: -x*(x-1)*(x^2+x+2) / ( 1+x^4 ).
a(n) = sqrt((n+1)^2 mod 8)(-1)^floor((n+2)/4). - Wesley Ivan Hurt, Jan 01 2014

A118823 Denominators of the convergents of the 2-adic continued fraction of zero given by A118821.

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 A118822(k)/A118823(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/(-1)^n.
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. A080277; A118821 (partial quotients), A118822 (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.

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

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

Original entry on oeis.org

1, -2, 1, -4, 1, -2, 1, -8, 1, -2, 1, -4, 1, -2, 1, -16, 1, -2, 1, -4, 1, -2, 1, -8, 1, -2, 1, -4, 1, -2, 1, -32, 1, -2, 1, -4, 1, -2, 1, -8, 1, -2, 1, -4, 1, -2, 1, -16, 1, -2, 1, -4, 1, -2, 1, -8, 1, -2, 1, -4, 1, -2, 1, -64, 1, -2, 1, -4, 1, -2, 1, -8, 1, -2, 1, -4, 1, -2, 1, -16, 1, -2, 1, -4, 1, -2, 1, -8, 1, -2, 1, -4, 1, -2, 1, -32, 1, -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, A118824, A118830. A006519(n) is the highest power of 2 dividing n; A080277 = partial sums of A038712, where A038712(n) = 2*A006519(n) - 1.
Multiplicative because both A006519 and A165326 are. - Andrew Howroyd, Aug 01 2018

Examples

			For n >= 1, convergents A118828(k)/A118829(k):
  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.
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

Programs

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

Formula

a(n) = A165326(n) * A006519(n). - Andrew Howroyd, Aug 01 2018
From Amiram Eldar, Oct 28 2023: (Start)
Multiplicative with a(2^e) = -2^e, and a(p^e) = 1 for an odd prime p.
Dirichlet g.f.: zeta(s) * (1 - 2^(1-s) + 1/(2-2^s)).
Sum_{k=1..n} a(k) ~ (-1/(2*log(2))) * n *(log(n) + gamma - log(2)/2 - 1), where gamma is Euler's constant (A001620). (End)

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

Original entry on oeis.org

-1, 2, -1, 4, -1, 2, -1, 8, -1, 2, -1, 4, -1, 2, -1, 16, -1, 2, -1, 4, -1, 2, -1, 8, -1, 2, -1, 4, -1, 2, -1, 32, -1, 2, -1, 4, -1, 2, -1, 8, -1, 2, -1, 4, -1, 2, -1, 16, -1, 2, -1, 4, -1, 2, -1, 8, -1, 2, -1, 4, -1, 2, -1, 64, -1, 2, -1, 4, -1, 2, -1, 8, -1, 2, -1, 4, -1, 2, -1, 16, -1, 2, -1, 4, -1, 2, -1, 8, -1, 2, -1, 4, -1, 2, -1, 32, -1, 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, A118824, A118827. 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 A118831(k)/A118832(k):
  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.
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. A006519, A080277; convergents: A118831/A118832; variants: A118821, A118824, A118827; A100338.

Programs

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