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.

Previous Showing 11-20 of 334 results. Next

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

A187816 Triangle read by rows in which row n lists the first 2^(n-1) terms of A006519 in nonincreasing order, n >= 1.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Sep 10 2013

Keywords

Comments

T(n,k) is also the number of parts in the k-th largest region of the diagram of regions of the set of compositions of n, n >= 1, k >= 1, see example.
Row lengths is A000079.
Row sums give A001792(n-1).

Examples

			For n = 5 the diagram of regions of the set of compositions of 5 has 2^(5-1) regions, see below:
------------------------------------------------------
.          A006519
.         as a tree
.         of number        Diagram
Region    of parts       of regions     Composition
------------------------------------------------------
.                         _ _ _ _ _
1      | 1          |    |_| | | | |    1, 1, 1, 1, 1
2      |   2        |    |_ _| | | |    2, 1, 1, 1
3      | 1          |    |_|   | | |    1, 2, 1, 1
4      |      4     |    |_ _ _| | |    3, 1, 1
5      | 1          |    |_| |   | |    1, 1, 2, 1
6      |   2        |    |_ _|   | |    2, 2, 1
7      | 1          |    |_|     | |    1, 3, 1
8      |        8   |    |_ _ _ _| |    4, 1
9      | 1          |    |_| | |   |    1, 1, 1, 2
10     |   2        |    |_ _| |   |    2, 1, 2
11     | 1          |    |_|   |   |    1, 2, 2
12     |      4     |    |_ _ _|   |    3, 2
13     | 1          |    |_| |     |    1, 1, 3
14     |   2        |    |_ _|     |    2, 3
15     | 1          |    |_|       |    1, 4
16     |         16 |    |_ _ _ _ _|    5
.
The first largest region in the diagram is the 16th region which contains 16 parts, so T(5,1) = 16. The second largest region is the 8th region which contains 8 parts, so T(5,2) = 8. The third and the fourth largest regions are both the 4th region and the 12th region, each contains 4 parts, so T(5,3) = 4 and T(5,4) = 4. And so on. The sequence of the number of parts of the k-th largest region of the diagram is [16, 8, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1], the same as the 5th row of triangle, as shown below.
Triangle begins:
1;
2,1;
4,2,1,1;
8,4,2,2,1,1,1,1;
16,8,4,4,2,2,2,2,1,1,1,1,1,1,1,1;
32,16,8,8,4,4,4,4,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;
...
		

Crossrefs

A349344 Dirichlet inverse of A109168, where A109168(n) = (n+A006519(n))/2, and A006519 is the highest power of 2 dividing n.

Original entry on oeis.org

1, -2, -2, 0, -3, 4, -4, 0, -1, 6, -6, 0, -7, 8, 4, 0, -9, 2, -10, 0, 5, 12, -12, 0, -4, 14, -2, 0, -15, -8, -16, 0, 7, 18, 6, 0, -19, 20, 8, 0, -21, -10, -22, 0, 3, 24, -24, 0, -9, 8, 10, 0, -27, 4, 8, 0, 11, 30, -30, 0, -31, 32, 4, 0, 9, -14, -34, 0, 13, -12, -36, 0, -37, 38, 8, 0, 9, -16, -40, 0, -4, 42, -42, 0
Offset: 1

Views

Author

Antti Karttunen, Nov 15 2021

Keywords

Crossrefs

Programs

  • PARI
    up_to = 20000;
    DirInverseCorrect(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = (-u[1]*sumdiv(n, d, if(dA109168(n) = ((n+bitand(n, -n))\2); \\ From A109168 by M. F. Hasler, Oct 19 2019 (Cf. A140472).
    v349344 = DirInverseCorrect(vector(up_to,n,A109168(n)));
    A349344(n) = v349344[n];

Formula

a(1) = 1; a(n) = -Sum_{d|n, d < n} A109168(n/d) * a(d).
a(n) = A349345(n) - A109168(n).

A285326 a(0) = 0, for n > 0, a(n) = n + A006519(n).

Original entry on oeis.org

0, 2, 4, 4, 8, 6, 8, 8, 16, 10, 12, 12, 16, 14, 16, 16, 32, 18, 20, 20, 24, 22, 24, 24, 32, 26, 28, 28, 32, 30, 32, 32, 64, 34, 36, 36, 40, 38, 40, 40, 48, 42, 44, 44, 48, 46, 48, 48, 64, 50, 52, 52, 56, 54, 56, 56, 64, 58, 60, 60, 64, 62, 64, 64, 128, 66, 68, 68, 72, 70, 72, 72, 80, 74, 76, 76, 80, 78, 80, 80, 96, 82, 84, 84, 88, 86, 88, 88, 96, 90, 92, 92
Offset: 0

Views

Author

Antti Karttunen, Apr 19 2017

Keywords

Comments

From M. F. Hasler, Oct 19 2019: (Start)
This sequence is equal to itself multiplied by 2 and interleaved with the positive even numbers: We have a(2n-1) = 2n (n >= 1) from the very definition, since A006519(m) = 1 for odd m. And a(2n) = 2n + A006519(2n) = 2*a(n), using A006519(2n) = 2*A006519(n).
The sequence repeats the pattern [A, B, C, C] where in the n-th occurrence C = 4n, B = C - 2, A = C if n is even, A = C + 4 if n = 3 (mod 4), and A = 16*a((n-1)/4) otherwise. (End)

Crossrefs

Row 2 of A285325 (after the initial zero).
Cf. A109168 (same terms divided by 2), also A140472.

Programs

Formula

a(0) = 0; for n > 0, a(n) = n + A006519(n).
For n >= 1, a(n) = 2*A109168(n).
a(n) = 2*A140472(n) and a(2n) = 2*a(n) and a(2^n) = 2^(n+1) for all n >= 0, a(2n-1) = 2n for all n >= 1. - M. F. Hasler, Oct 19 2019

A100340 Numerators of the convergents in the continued fraction expansion for the constant given by A100338, where the partial quotients equal A006519 (greatest power of 2 dividing n).

Original entry on oeis.org

1, 3, 4, 19, 23, 65, 88, 769, 857, 2483, 3340, 15843, 19183, 54209, 73392, 1228481, 1301873, 3832227, 5134100, 24368627, 29502727, 83374081, 112876808, 986388545, 1099265353, 3184919251, 4284184604, 20321657667, 24605842271, 69533342209
Offset: 1

Views

Author

Paul D. Hanna, Nov 18 2004

Keywords

Comments

The convergents for the continued fraction of x are given by A100340(n)/A100341(n) and the convergents for the continued fraction of 2*x are given by A100342(n)/A100343(n), where A100342(n)/A100343(n) = 2*A100340(n)/A100341(n) for all n.

Examples

			The constant is x=1.353871128429882374388894084016608124227333416812...
contfrac(x) = [1;2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,...A006519(n),... ].
		

Crossrefs

Programs

  • Mathematica
    Convergents[ Array[ 2^IntegerExponent[#, 2]&, 30] ] // Numerator (* Jean-François Alcover, May 15 2014 *)
  • PARI
    a(n)=if(n==1,1,if(n==2,3,a(n-1)*2^valuation(n,2)+a(n-2)))

Formula

a(1) = 1, a(2) = 3, a(n) = a(n-1)*A006519(n) + a(n-2).

A100341 Denominators of the convergents in the continued fraction expansion for the constant given by A100338, where the partial quotients equal A006519 (greatest power of 2 dividing n).

Original entry on oeis.org

1, 2, 3, 14, 17, 48, 65, 568, 633, 1834, 2467, 11702, 14169, 40040, 54209, 907384, 961593, 2830570, 3792163, 17999222, 21791385, 61581992, 83373377, 728569008, 811942385, 2352453778, 3164396163, 15010038430, 18174434593, 51358907616
Offset: 1

Views

Author

Paul D. Hanna, Nov 18 2004

Keywords

Comments

The convergents for the continued fraction of x are given by A100340(n)/A100341(n) and the convergents for the continued fraction of 2*x are given by A100342(n)/A100343(n), where A100342(n)/A100343(n) = 2*A100340(n)/A100341(n) for all n.

Examples

			The constant is x=1.353871128429882374388894084016608124227333416812...
contfrac(x) = [1;2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,...A006519(n),... ].
		

Crossrefs

Programs

  • PARI
    a(n)=if(n==1,1,if(n==2,2,a(n-1)*2^valuation(n,2)+a(n-2)))

Formula

a(1) = 1, a(2) = 2, a(n) = a(n-1)*A006519(n) + a(n-2).

A100342 Numerators of the convergents in the continued fraction expansion for twice the constant given by A100338, where the partial quotients equal A006519 (greatest power of 2 dividing n) interleaved with 2's.

Original entry on oeis.org

2, 3, 8, 19, 46, 65, 176, 769, 1714, 2483, 6680, 15843, 38366, 54209, 146784, 1228481, 2603746, 3832227, 10268200, 24368627, 59005454, 83374081, 225753616, 986388545, 2198530706, 3184919251, 8568369208, 20321657667, 49211684542
Offset: 1

Views

Author

Paul D. Hanna, Nov 18 2004

Keywords

Comments

The convergents for the continued fraction of x are given by A100340(n)/A100341(n) and the convergents for the continued fraction of 2*x are given by A100342(n)/A100343(n), where A100342(n)/A100343(n) = 2*A100340(n)/A100341(n) for all n.

Examples

			The constant is 2*x=2.707742256859764748777788168033216248454666833624237..
contfrac(2*x) = [2;1, 2,2, 2,1, 2,4, 2,1, 2,2, 2,1, 2,8,... 2, A006519(n),... ].
		

Crossrefs

Programs

  • PARI
    {a(n)=if(n==1,2,if(n==2,3,if(n%2==1,2*a(n-1)+a(n-2), a(n-1)*2^valuation(n/2,2)+a(n-2))))}

Formula

a(1) = 2, a(2) = 3; a(2*n) = a(2*n-1)*A006519(n) + a(2*n-2) for n>1, a(2*n-1) = 2*a(2*n-2) + a(2*n-3) for n>1.

A100343 Denominators of the convergents in the continued fraction expansion for twice the constant given by A100338, where the partial quotients equal A006519 (greatest power of 2 dividing n) interleaved with 2's.

Original entry on oeis.org

1, 1, 3, 7, 17, 24, 65, 284, 633, 917, 2467, 5851, 14169, 20020, 54209, 453692, 961593, 1415285, 3792163, 8999611, 21791385, 30790996, 83373377, 364284504, 811942385, 1176226889, 3164396163, 7505019215, 18174434593, 25679453808, 69533342209
Offset: 1

Views

Author

Paul D. Hanna, Nov 18 2004

Keywords

Comments

The convergents for the continued fraction of x are given by A100340(n)/A100341(n) and the convergents for the continued fraction of 2*x are given by A100342(n)/A100343(n), where A100342(n)/A100343(n) = 2*A100340(n)/A100341(n) for all n.

Examples

			The constant is 2*x=2.707742256859764748777788168033216248454666833624237..
contfrac(2*x) = [2;1, 2,2, 2,1, 2,4, 2,1, 2,2, 2,1, 2,8,... 2, A006519(n),... ].
		

Crossrefs

Programs

  • PARI
    {a(n)=if(n==1,1,if(n==2,1,if(n%2==1,2*a(n-1)+a(n-2), a(n-1)*2^valuation(n/2,2)+a(n-2))))}

Formula

a(1) = 1, a(2) = 1; a(2*n) = a(2*n-1)*A006519(n) + a(2*n-2) for n>1, a(2*n-1) = 2*a(2*n-2) + a(2*n-3) for n>1.
Previous Showing 11-20 of 334 results. Next