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-10 of 15 results. Next

A255122 Simple self-inverse permutation of natural numbers: after zero, list each block of A255071(n) numbers in reverse order, from A255061(n+1) to A255062(n).

Original entry on oeis.org

0, 1, 3, 2, 6, 5, 4, 11, 10, 9, 8, 7, 20, 19, 18, 17, 16, 15, 14, 13, 12, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 118
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Comments

Maps between A255056 and A255066. (Equally, between A255057 and A255067.)

Crossrefs

Programs

Formula

a(n) = A255061(1+A255121(n)) - A255120(n).

A255121 After zero, each n occurs A255071(n) times.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Comments

An auxiliary sequence for computing A255122 and A255056.

Crossrefs

Similar sequence: A213711.

A255120 After the first zero, numbers from 0 to A255071(n)-1 followed by numbers from 0 to A255071(n+1)-1, etc.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Comments

An auxiliary sequence for computing A255122 and A255056.

Crossrefs

Similar sequence: A218601.

Programs

Formula

a(0) = 0; and for n >= 1, a(n) = n - A255062(A255121(n)).

A254119 a(n) = A213709(n) - A255071(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 6, 16, 36, 71, 126, 204, 303, 414, 526, 652, 907, 1705, 4213, 11329, 29670, 73408, 171345, 379494, 802875, 1632745, 3210086, 6134908, 11457641, 21020580, 38076142
Offset: 1

Views

Author

Antti Karttunen, Feb 15 2015

Keywords

Crossrefs

Programs

Formula

a(n) = A213709(n) - A255071(n).

A255069 First differences of A255071.

Original entry on oeis.org

1, 1, 2, 4, 7, 13, 24, 44, 81, 150, 280, 526, 992, 1875, 3551, 6740, 12823, 24450, 46709, 89383, 171325, 328962, 632849, 1219909, 2356217, 4559224, 8835610, 17144046, 33295497, 64705083, 125802338, 244673791, 476011284, 926373373, 1803512210, 3512774806
Offset: 1

Views

Author

Antti Karttunen, Feb 21 2015

Keywords

Comments

Also, a(n) = the number of times a number whose binary expansion begins with 10... (cf. A004754) is encountered when iterating from 2^(n+2)-2 to (2^(n+1))-2 with the map x -> x - (number of runs in binary representation of x), i.e., with m(n) = A236840(n). For example, when starting from the initial value (2^(4+2))-2 = 62, we get m(62) = 60, m(60) = 58, m(58) = 54, m(54) = 50, m(50) = 46, m(46) = 42, m(42) = 36 and finally m(36) = 32, which is (2^(4+1)). Of the nine numbers encountered, only 46, 42, 36 and 32 (in binary: 101110, 101010, 100100 and 100000) are in A004754, thus a(4) = 5.

Crossrefs

First differences of A255071.
Analogous sequence: A226060.

Programs

Formula

a(n) = A255071(n+1) - A255071(n).
For n > 1, a(n-1) = Sum_{k = A255062(n) .. A255061(n+1)}(1-secondmsb(A255056(k))).
Here secondmsb is implemented by the starting offset 2 version of A079944, and effectively gives the second most significant bit in the binary expansion of n. The formula follows from the semi-regular nature of number-of-runs beanstalk, see comments above and at A255071.

A255056 Trunk of number-of-runs beanstalk: The unique infinite sequence such that a(n-1) = a(n) - number of runs in binary representation of a(n).

Original entry on oeis.org

0, 2, 4, 6, 10, 12, 14, 18, 22, 26, 28, 30, 32, 36, 42, 46, 50, 54, 58, 60, 62, 64, 68, 74, 78, 84, 90, 94, 96, 100, 106, 110, 114, 118, 122, 124, 126, 128, 132, 138, 142, 148, 152, 156, 162, 168, 174, 180, 186, 190, 192, 196, 202, 206, 212, 218, 222, 224, 228, 234, 238, 242, 246, 250, 252, 254
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Comments

All numbers of the form (2^n)-2 are present, which guarantees the uniqueness and also provides a well-defined method to compute the sequence, for example, via a partially reversed version A255066.
The sequence was inspired by a similar "binary weight beanstalk", A179016, sharing some general properties with it (like its partly self-copying behavior, see A255071), but also differing in some aspects. For example, here the branching degree is not the constant 2, but can vary from 1 to 4. (Cf. A255058.)

Crossrefs

First differences: A255336.
Terms halved: A255057.
Cf. A255053 & A255055 (the lower & upper bound for a(n)) and also A255123, A255124 (distances to those limits).
Cf. A255327, A255058 (branching degree for node n), A255330 (number of nodes in the finite subtrees branching from the node n), A255331, A255332
Subsequence: A000918 (except for -1).
Similar "beanstalk's trunk" sequences using some other subtracting map than A236840: A179016, A219648, A219666.

Programs

Formula

a(n) = A255066(A255122(n)).
Other identities and observations. For all n >= 0:
a(n) = 2*A255057(n).
A255072(a(n)) = n.
A255053(n) <= a(n) <= A255055(n).

A236840 n minus number of runs in the binary expansion of n: a(n) = n - A005811(n).

Original entry on oeis.org

0, 0, 0, 2, 2, 2, 4, 6, 6, 6, 6, 8, 10, 10, 12, 14, 14, 14, 14, 16, 16, 16, 18, 20, 22, 22, 22, 24, 26, 26, 28, 30, 30, 30, 30, 32, 32, 32, 34, 36, 36, 36, 36, 38, 40, 40, 42, 44, 46, 46, 46, 48, 48, 48, 50, 52, 54, 54, 54, 56, 58, 58, 60, 62, 62, 62, 62, 64, 64, 64
Offset: 0

Views

Author

Antti Karttunen, Apr 18 2014

Keywords

Comments

All terms are even. Used by the "number-of-runs beanstalk" sequence A255056 and many of its associated sequences.

Crossrefs

Cf. A091067 (the positions of records), A106836 (run lengths).
Cf. A255070 (terms divided by 2).

Programs

  • Maple
    A236840 := proc(n) local i, b; if n=0 then 0 else b := convert(n, base, 2); select(i -> (b[i-1]<>b[i]), [$2..nops(b)]); n-1-nops(%) fi end: seq(A236840(i), i=0..69); # Peter Luschny, Apr 19 2014
  • Mathematica
    a[n_] := n - Length@ Split[IntegerDigits[n, 2]]; a[0] = 0; Array[a, 100, 0] (* Amiram Eldar, Jul 16 2023 *)
  • Scheme
    (define (A236840 n)  (- n (A005811 n)))

Formula

a(n) = n - A005811(n) = n - A000120(A003188(n)).
a(n) = 2*A255070(n).

A255061 Number of steps to reach 0 when starting from (2^n)-2 and iterating the map x -> x - (number of runs in binary representation of x): a(n) = A255072(A000918(n)).

Original entry on oeis.org

0, 1, 3, 6, 11, 20, 36, 65, 118, 215, 393, 721, 1329, 2463, 4589, 8590, 16142, 30434, 57549, 109114, 207388, 395045, 754027, 1441971, 2762764, 5303466, 10200385, 19656528, 37948281, 73384080, 142115376, 275551755, 534790472, 1038702980, 2018626772, 3924923937, 7634733312
Offset: 1

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Comments

Apart from a(1)=1, also gives the positions of ones in A255054.

Crossrefs

One less than A255062.
First differences: A255071.
Apart from a(1)=1, a subsequence of A255059.
Analogous sequences: A218600, A226061.

Programs

Formula

a(n) = A255072(A000918(n)).
a(1) = 0; for n > 1, a(n) = a(n-1) + A255071(n-1).
Other identities. For all n >= 1:
a(n) = A255062(n) - 1.

A255062 Number of steps to reach 0 when starting from (2^n)-1 and iterating the map x -> x - (number of runs in binary representation of x): a(n) = A255072(A000225(n)).

Original entry on oeis.org

0, 1, 2, 4, 7, 12, 21, 37, 66, 119, 216, 394, 722, 1330, 2464, 4590, 8591, 16143, 30435, 57550, 109115, 207389, 395046, 754028, 1441972, 2762765, 5303467, 10200386, 19656529, 37948282, 73384081, 142115377, 275551756, 534790473, 1038702981, 2018626773, 3924923938, 7634733313
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Comments

Also, for n >= 1, the number of steps to reach 0 when starting from 2^n and iterating the map x -> x minus A005811(x), the number of runs in binary representation of x.

Crossrefs

One more than A255061.
First differences: A255071 (after the zero term).
Analogous sequences: A213710 (A218600), A219665.

Programs

Formula

a(n) = A255072(A000225(n)).
a(0) = 0, a(1) = 1; for n > 1, a(n) = a(n-1) + A255071(n-1).
Other identities. For all n >= 1:
a(n) = A255072(A000079(n)). [See the Comments section.]
a(n) = 1 + A255061(n).

A255072 Number of steps to reach 0 starting with n and using the iterated process: x -> x - (number of runs in binary representation of x).

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 5, 5, 5, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 25
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Crossrefs

Cf. A255053 (least inverse), A255055 (greatest inverse), A255054 (run lengths).
Cf. A255061 & A255062 (values at points (2^n)-2 and (2^n)-1).
Analogous sequences: A071542, A219642, A219652

Formula

a(0) = 0; for n >= 1, a(n) = 1 + a(A236840(n)) = 1 + a(n - A005811(n)).
Other identities. For all n >= 0:
a(A255053(n)) = a(A255055(n)) = n.
a(A255056(n)) = n. [This sequence works also as an inverse function for number-of-runs beanstalk A255056.]
Showing 1-10 of 15 results. Next