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

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

A255054 Run lengths in A255072.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Comments

Number of integers k which require exactly n steps to reach 0, when starting from k and iterating the map: x -> x - (number of runs in binary representation of x).

Examples

			0 is the only number reached from 0 in zero steps, thus a(0) = 1.
Both 1 and 2, in binary '1' and '10', when the number of runs (A005811) is subtracted from them, result zero: 1-1 = 2-2 = 0, and these are only such numbers where the zero is reached with one step, thus a(1) = 2.
For 3, 4 and 5, in binary '11', '100' and '101', subtracting the number of runs results 2 in all cases, thus two steps are requires to reach zero, and as there are no other such cases, a(2) = 3.
For 6, in binary '110', subtracting A005811 repeatedly gives -> 6-2 = 4, 4-2 = 2, 2-2 = 0, three steps in total, and as 6 is the only such number requiring three steps, a(3) = 1.
		

Crossrefs

Cf. A255059 (positions of odd terms), A255060 (positions of even terms), A255061 (apart from its second term 1, gives positions of ones here).
Analogous sequences: A086876, A219644, A219654.

Formula

a(n) = A255053(n+1) - A255053(n).
a(n) = 1 + A255055(n) - A255053(n).
Other identities. For all n >= 0:
a(n) = 1 + A255123(n) + A255124(n).

A255053 Least inverse of A255072; a(n) = smallest k such that A255072(k) = n.

Original entry on oeis.org

0, 1, 3, 6, 7, 11, 14, 15, 19, 23, 27, 30, 31, 35, 39, 44, 47, 51, 55, 59, 62, 63, 67, 71, 76, 79, 86, 91, 95, 99, 103, 108, 111, 115, 119, 123, 126, 127, 131, 135, 140, 143, 150, 155, 159, 166, 172, 176, 182, 187, 191, 195, 199, 204, 207, 214, 219, 223, 227, 231, 236, 239, 243, 247, 251, 254, 255
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Comments

Also positions of records in A255072.

Crossrefs

Analogous sequences: A213708, A219643, A219653.

Formula

Other identities. For all n >= 0:
a(0) = 0; for n > 0: a(n) = a(n-1) + A255054(n-1).
a(n) = A255056(n) - A255123(n).

A255055 Greatest inverse of A255072; a(n) = largest k such that A255072(k) = n.

Original entry on oeis.org

0, 2, 5, 6, 10, 13, 14, 18, 22, 26, 29, 30, 34, 38, 43, 46, 50, 54, 58, 61, 62, 66, 70, 75, 78, 85, 90, 94, 98, 102, 107, 110, 114, 118, 122, 125, 126, 130, 134, 139, 142, 149, 154, 158, 165, 171, 175, 181, 186, 190, 194, 198, 203, 206, 213, 218, 222, 226, 230, 235, 238, 242, 246, 250, 253, 254, 258
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Crossrefs

Analogous sequences: A173601, A219645, A219655.

Formula

a(0) = 0; for n > 0, a(n) = A255054(n) + a(n-1).
Other identities. For all n >= 0:
a(n) = A255053(n) + A255054(n) - 1.
a(n) = A255056(n) + A255124(n).

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

A255071 Number of steps required to reach (2^n)-2 from 2^(n+1)-2 by iterating the map x -> x - (number of runs in binary representation of x).

Original entry on oeis.org

1, 2, 3, 5, 9, 16, 29, 53, 97, 178, 328, 608, 1134, 2126, 4001, 7552, 14292, 27115, 51565, 98274, 187657, 358982, 687944, 1320793, 2540702, 4896919, 9456143, 18291753, 35435799, 68731296, 133436379, 259238717, 503912508, 979923792, 1906297165, 3709809375, 7222584181
Offset: 1

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Crossrefs

First differences of A255061 and A255062.
A255069 gives the first differences of this sequence.
Analogous sequences: A213709, A219661.
a(n) differs from A192804(n+1) for the first time at n=11, where a(11) = 328, while A192804(12) = 327.

Programs

  • PARI
    A005811(n) = hammingweight(bitxor(n,n\2));
    A255071(n) = { my(k, i); k = (2^(n+1))-2; i = 1; while(1, k = k - A005811(k); if(!bitand(k+1,k+2),return(i),i++)); };
    for(n=1, 48, write("b255071.txt", n, " ", A255071(n)));
    
  • Scheme
    (define (A255071 n) (- (A255072 (- (expt 2 (+ n 1)) 2)) (A255072 (- (expt 2 n) 2))))
    (define (A255071shifted n) (add (COMPOSE A079944off2 A255056) (A255062 n) (A255061 (+ 1 n))))
    (define (A079944off2 n) (A000035 (floor->exact (/ n (A072376 n))))) ;; Cf.
    A079944.
    ;; Shifted variant gives: (map A255071shifted (iota 16)) --> (0 1 2 3 5 9 16 29 53 97 178 328 608 1134 2126 4001)

Formula

a(n) = A255072((2^(n+1))-2) - A255072((2^n)-2).
a(n) = A255061(n+1) - A255061(n).
a(n) = A255125(n) + A255126(n).
a(n) = A255063(n) + A255064(n).
Other identities and observations:
It seems that a(n) <= A213709(n) for all n >= 1. A254119 gives the difference between these two sequences.
From Antti Karttunen, Feb 21 2015: (Start)
For n>1, a(n-1) = Sum_{k=A255062(n) .. A255061(n+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, as in the upper half of any next higher range [A255062(n+1) .. A255061(n+2)] of its infinite trunk (A255056), the beanstalk imitates its behavior in the range [A255062(n) .. A255061(n+1)].
(End)

Extensions

a(37) added by Antti Karttunen, Feb 19 2015

A255070 (1/2)*(n minus number of runs in the binary expansion of n): a(n) = (n - A005811(n)) / 2 = A236840(n)/2.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Crossrefs

Least inverse: A091067 (also the positions of records).
Greatest inverse: A255068.
Run lengths: A106836.

Programs

  • Mathematica
    a[n_] := (n - Length@ Split[IntegerDigits[n, 2]])/2; a[0] = 0; Array[a, 100, 0] (* Amiram Eldar, Jul 16 2023 *)
  • Scheme
    (define (A255070 n) (/ (A236840 n) 2))

Formula

a(n) = A236840(n) / 2 = (n - A005811(n)) / 2.
Other identities:
a(A091067(n)) = n for all n >= 1.
a(A255068(n)) = n for all n >= 0.
a(A269363(n)) = A269367(n). - Antti Karttunen, Aug 12 2019
Showing 1-9 of 9 results.