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 13 results. Next

A218602 Simple self-inverse permutation of natural numbers: after zero, list each block of A213709(n) numbers in reverse order, from A218600(n) to A213710(n-1).

Original entry on oeis.org

0, 1, 2, 4, 3, 7, 6, 5, 12, 11, 10, 9, 8, 21, 20, 19, 18, 17, 16, 15, 14, 13, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 68, 67, 66, 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
Offset: 0

Views

Author

Antti Karttunen, Nov 10 2012

Keywords

Comments

This permutation can be used to map between the sequences A179016 and A218616. E.g. A179016(n) = A218616(a(n)) and vice versa: A218616(n) = A179016(a(n)).

Crossrefs

Programs

Formula

a(n) = A218600(A213711(n))-A218601(n).

A179016 The infinite trunk of binary beanstalk: The only infinite sequence such that a(n-1) = a(n) - number of 1's in binary representation of a(n).

Original entry on oeis.org

0, 1, 3, 4, 7, 8, 11, 15, 16, 19, 23, 26, 31, 32, 35, 39, 42, 46, 49, 53, 57, 63, 64, 67, 71, 74, 78, 81, 85, 89, 94, 97, 101, 104, 109, 112, 116, 120, 127, 128, 131, 135, 138, 142, 145, 149, 153, 158, 161, 165, 168, 173, 176, 180, 184, 190, 193, 197, 200, 205, 209
Offset: 0

Views

Author

Carl R. White, Jun 24 2010

Keywords

Comments

a(n) tells in what number we end in n steps, when we start climbing up the infinite trunk of the "binary beanstalk" from its root (zero). The name "beanstalk" is due to Antti Karttunen.
There are many finite sequences such as 0,1,2; 0,1,3,4,7,9; etc. obeying the same condition (see A218254) and as the length increases, so (necessarily) does the similarity to this infinite sequence.

Crossrefs

A subsequence of A005187, i.e., a(n) = A005187(A213715(n)). For all n,
A071542(a(n)) = n, and furthermore A213708(n) <= a(n) <= A173601(n). (Cf. A218603, A218604).
Rows of A218254, when reversed, converge towards this sequence.
Cf. A276623, A219648, A219666, A255056, A276573, A276583, A276613 for analogous constructions, and also A259934.

Programs

  • Mathematica
    TakeWhile[Reverse@ NestWhileList[# - DigitCount[#, 2, 1] &, 10^3, # > 0 &], # <= 209 &] (* Michael De Vlieger, Sep 12 2016 *)

Formula

a(0)=0, a(1)=1, and for n > 1, if n = A218600(A213711(n)) then a(n) = (2^A213711(n)) - 1, and in other cases, a(n) = a(n+1) - A213712(n+1). (This formula is based on Carl White's observation that this iterated/converging path must pass through each (2^n)-1. However, it would be very interesting to know whether the sequence admits more traditional recurrence(s), referring to previous, not to further terms in the sequence in their definition!) - Antti Karttunen, Oct 26 2012
a(n) = A218616(A218602(n)). - Antti Karttunen, Mar 04 2013
a(n) = A054429(A233271(A218602(n))). - Antti Karttunen, Dec 12 2013

Extensions

Starting offset changed from 1 to 0 by Antti Karttunen, Nov 05 2012

A233271 a(0)=0; thereafter a(n+1) = a(n) + 1 + number of 0's in binary representation of a(n), counted with A080791.

Original entry on oeis.org

0, 1, 2, 4, 7, 8, 12, 15, 16, 21, 24, 28, 31, 32, 38, 42, 46, 49, 53, 56, 60, 63, 64, 71, 75, 79, 82, 87, 90, 94, 97, 102, 106, 110, 113, 117, 120, 124, 127, 128, 136, 143, 147, 152, 158, 162, 168, 174, 178, 183, 186, 190, 193, 199, 203, 207, 210, 215, 218, 222
Offset: 0

Views

Author

Antti Karttunen, Dec 12 2013

Keywords

Comments

These are iterates of A233272: a(0)=0, and for n>0, a(n) = A233272(a(n-1)). The difference from A216431 stems from the fact that it uses A023416 to count the 0-bits in the binary expansion of n, while this sequence uses A080791, which results a slightly different start for the iteration, and a much better alignment with sequences related to "infinite trunk of binary beanstalk", A179016.
Apart from term a(2)=2, it seems that each term a(n) >= A179016(n). Please see their ratio plotted with Plot2, and also their differences: A233270.

Crossrefs

Differs from A216431 only in that here 1 has been inserted into position a(1), between 0 and 2.

Programs

  • Mathematica
    a[0] = 0; a[n_] := a[n] = If[n == 1, 1, # + 1 + Last@ DigitCount[#, 2] &@ a[n - 1]]; Table[a@ n, {n, 0, 59}] (* or *)
    Insert[NestList[# + 1 + DigitCount[#, 2, 0] &, 0, nn], 1, 2] (* Michael De Vlieger, Mar 07 2016, the latter after Harvey P. Dale at A216431 *)

Formula

a(0)=0, and for n>0, a(n) = A233272(a(n-1)).
a(0)=0, and for n>0, a(n) = a(n-1) + 1 + A080791(a(n-1)).
a(n) = A054429(A218616(n)) = A054429(A179016(A218602(n))) [This sequence can be mapped to the infinite trunk of "binary beanstalk" with involutions A054429 & A218602].
For all n, a(A213710(n)) = 2^n = A000079(n).
For n>=3, a(A218600(n)) = A000225(n).

A213709 Number of steps to go from 2^(n+1)-1 to (2^n)-1 using the iterative process described in A071542.

Original entry on oeis.org

1, 1, 2, 3, 5, 9, 17, 30, 54, 98, 179, 330, 614, 1150, 2162, 4072, 7678, 14496, 27418, 51979, 98800, 188309, 359889, 689649, 1325006, 2552031, 4926589, 9529551, 18463098, 35815293, 69534171, 135069124, 262448803, 510047416, 991381433, 1927317745, 3747885517
Offset: 0

Views

Author

Antti Karttunen, Oct 26 2012

Keywords

Comments

Also, apart from the first term a(0)=1, the number of terms in A179016 whose binary width is n+2 bits and whose second most significant bit is zero. For example, there is one term 4 (100) in three-bit range; two terms 8 (1000) and 11 (1011) in four bit range; three such terms: 16 (10000), 19 (10011) and 23 (10111) in five-bit range; five terms: 32, 35, 39, 42, 46 in six-bit range. This stems from the half-recursive nature of A179016, especially, that for all n >= 4, a(n) also gives the number of steps to go from (2^(n+1) + 2^n + 1) to 2^n using the iterative process described in A071542. Cf. also A226060. - Antti Karttunen, Jun 12 2013
Ratio a(n+1)/a(n) develops as: 1, 2, 1.5, 1.667..., 1.8, 1.889..., 1.765..., 1.8, 1.815..., 1.827..., 1.844..., 1.861..., 1.873..., 1.880..., 1.883..., 1.886..., 1.888..., 1.891..., 1.896..., 1.901..., 1.906..., 1.911..., 1.916..., 1.921..., 1.926..., 1.930..., 1.934..., 1.937..., 1.940..., 1.941..., 1.942..., 1.943..., 1.943..., 1.944..., 1.944..., 1.945..., 1.945..., 1.946..., 1.947..., 1.949..., 1.950..., 1.951..., 1.953..., 1.954..., 1.955..., 1.957..., 1.958... (which seem to converge slowly towards 2; see also comments at A218543).

Examples

			(2^0)-1 (0) is reached from (2^1)-1 (1) with one step by subtracting A000120(1) from 1.
(2^1)-1 (1) is reached from (2^2)-1 (3) with one step by subtracting A000120(3) from 3.
(2^2)-1 (3) is reached from (2^3)-1 (7) with two steps by first subtracting A000120(7) from 7 -> 4, and then subtracting A000120(4) from 4 -> 3.
Thus a(0)=a(1)=1 and a(2)=2.
		

Crossrefs

First differences of A218600 and A213710. First differences of this sequence: A226060.
Analogous sequence for factorial number system: A219661.

Formula

a(n) = A071542((2^(n+1))-1) - A071542((2^n)-1).
a(n) = A218542(n) + A218543(n) = A011782(n) - A213722(n).

Extensions

More terms from Antti Karttunen, Jun 05 2013

A218600 Partial sums of A213709.

Original entry on oeis.org

0, 1, 2, 4, 7, 12, 21, 38, 68, 122, 220, 399, 729, 1343, 2493, 4655, 8727, 16405, 30901, 58319, 110298, 209098, 397407, 757296, 1446945, 2771951, 5323982, 10250571, 19780122, 38243220, 74058513, 143592684, 278661808, 541110611, 1051158027, 2042539460, 3969857205
Offset: 0

Views

Author

Antti Karttunen, Nov 05 2012

Keywords

Comments

a(n) tells the position of (2^n)-1 in A179016.

Crossrefs

a(n) = A213710(n)-1. A179016(a(n))=(2^n)-1. Cf. A213711.

Extensions

a(29)-a(36) from Alois P. Heinz, Jul 03 2022

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

A233270 a(n) = A233271(n) - A179016(n).

Original entry on oeis.org

0, 0, -1, 0, 0, 0, 1, 0, 0, 2, 1, 2, 0, 0, 3, 3, 4, 3, 4, 3, 3, 0, 0, 4, 4, 5, 4, 6, 5, 5, 3, 5, 5, 6, 4, 5, 4, 4, 0, 0, 5, 8, 9, 10, 13, 13, 15, 16, 17, 18, 18, 17, 17, 19, 19, 17, 17, 18, 18, 17, 16, 15, 13, 13, 10, 9, 8, 5, 0, 0, 6, 9, 14, 17, 18, 20, 22, 21
Offset: 0

Views

Author

Antti Karttunen, Dec 14 2013

Keywords

Comments

For all n>=2, a(1+A213710(n)) = n-2.
Except for a(2)=-1 (which seems to be the only negative term in the sequence), the sequences A218600 and A213710 give the positions of zeros.
Furthermore, each subrange [A213710(n)..A218600(n+1)] is palindromic. A233268 gives the middle points of those ranges, the sequence A234018 gives the values at those points, while A234019 gives the maximum term in that range in this sequence.

Examples

			This irregular table begins as:
0;
0;
-1;
0, 0;
0, 1, 0;
0, 2, 1, 2, 0;
0, 3, 3, 4, 3, 4, 3, 3, 0;
0, 4, 4, 5, 4, 6, 5, 5, 3, 5, 5, 6, 4, 5, 4, 4, 0;
...
After zero, each row n is A213709(n-1) elements long.
		

Crossrefs

Except for a(2)=-1 (which seems to be the only negative term in the sequence), the sequences A218600 and A213710 give the positions of zeros.

Programs

Formula

a(n) = A233271(n) - A179016(n).
a(A218602(n)) = a(n). [This is just a claim that each row is palindrome]

A218616 The infinite trunk of beanstalk (A179016) with reversed subsections.

Original entry on oeis.org

0, 1, 3, 7, 4, 15, 11, 8, 31, 26, 23, 19, 16, 63, 57, 53, 49, 46, 42, 39, 35, 32, 127, 120, 116, 112, 109, 104, 101, 97, 94, 89, 85, 81, 78, 74, 71, 67, 64, 255, 247, 240, 236, 231, 225, 221, 215, 209, 205, 200, 197, 193, 190, 184, 180, 176, 173, 168, 165, 161
Offset: 0

Views

Author

Antti Karttunen, Nov 10 2012

Keywords

Comments

This can be viewed as an irregular table: after the initial zero on row 0, start each row n with (2^n)-1 and subtract repeatedly the number of 1-bits to get successive terms, until the number that has already been listed (which is always (2^(n-1))-1) is encountered, which is not listed second time, but instead, the current row is finished and the next row starts with (2^(n+1))-1, with the same process repeated.
This contains the terms in the infinite trunk of beanstalk (A179016) listed in partially reversed manner: after the initial zero each subsequence lists A213709(n) successive terms from A179016, descending from (2^n)-1 downwards, usually down to 2^(n-1) (conjectured to indeed be a power of 2 in each case, apart from 2 itself missing from the beginning of the sequence).
Currently A179016 and many of the derived sequences are much easier and somewhat faster to compute with the help of this sequence, especially if the program computes any other required values incrementally in the same loop.

Examples

			After zero, we start with (2^1)-1 = 1, subtract A000120(1)=1 from it, resulting 1-1=0 (which is of the form (2^0)-1, thus not listed second time), instead, start the next row with (2^2)-1 = 3, subtract A000120(3)=2 from it, resulting 3-2=1, which has been already encountered, thus start the next row with (2^3)-1 = 7, subtract A000120(7)=3 from it, resulting 7-3=4, which is listed after 7, then 4-A000120(4)=4-1=3, which is of the form (2^k)-1 and already encountered, thus start the next row with (2^4)-1 = 15, etc. This results an irregular table which begins as:
0; 1; 3; 7, 4; 15, 11, 8; 31, 26, 23, 19, 16; 63, 57, ...
After zero, each row n is A213709(n-1) elements long.
		

Crossrefs

a(n) = A179016(A218602(n)). The rows are the initial portions of every (2^n)-1:th row in A218254.

Formula

a(0)=0, a(1)=1, and for n > 1, if n = A213710(A213711(n)-1) then a(n) = (2^A213711(n)) - 1, and in other cases, a(n) = A011371(a(n-1)).
Alternatively: For n < 4, a(n) = (2^n)-1, and for n >= 4, a(n) = A004755(A004755(A011371(a(n-1)))) if A011371(a(n-1))+1 is power of 2, otherwise just A011371(a(n-1)).

A219665 One more than the partial sums of A219661.

Original entry on oeis.org

1, 2, 4, 9, 28, 111, 539, 3150, 21623, 172349, 1549897, 15401145, 168011253, 2003304294, 25928878273, 361788001016, 5411160126368, 86353882249912, 1464841397585336, 26323224850512720, 499551889319197566
Offset: 1

Views

Author

Antti Karttunen, May 28 2013

Keywords

Comments

Are there any cases after n>2, for which A219666(a(n)) = n! instead of n!+1 ? (At least for all terms a(3) - a(14) that number is n!+1.)
Compare to the conjecture given at A213710.

Crossrefs

One more than A226061.
Cf. also A213710 (analogous sequence for base-2).

Programs

  • Mathematica
    Accumulate@ Table[Length@ NestWhileList[# - Total@ IntegerDigits[#, MixedRadix[Reverse@ Range[2, 120]]] &, (n + 1)! - 1, # > n! - 1 &] - 1, {n, 0, 8}] + 1 (* Michael De Vlieger, Jun 27 2016, Version 10.2 *)
  • Scheme
    (define (A219665 n) (+ 1 (A226061 n)))

Formula

a(n) = A226061(n)+1 = A219652(n!).

Extensions

Terms a(16) - a(21) computed from the new terms of A219661 by Antti Karttunen, Jun 27 2016

A233268 The middle point of row n in binary beanstalk related sequences A179016, A218602, A218616, A233270, A233271.

Original entry on oeis.org

1, 2, 3, 6, 10, 17, 30, 53, 95, 171, 310, 564, 1036, 1918, 3574, 6691, 12566, 23653, 44610, 84309, 159698, 303253, 577352, 1102121, 2109448, 4047967, 7787277, 15015347, 29011671, 56150867, 108825599, 211127246, 409886210, 796134319, 1546848744, 3006198333, 5843799964
Offset: 1

Views

Author

Antti Karttunen, Dec 29 2013

Keywords

Comments

a(n) points to the center of each palindromic row/subrange of A233270, and to the lower position nearest to the center, if the length of range is even.
For all n, A218602(a(n)) = a(n) + (1-A000035(A213709(n-1))).

Crossrefs

Formula

a(n) = floor((A213710(n-1) + A218600(n)) / 2).
a(n) = A218600(n-1) + ceiling((A213709(n-1)/2)).
Showing 1-10 of 13 results. Next