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 20 results.

A255066 The trunk of number-of-runs beanstalk (A255056) with reversed subsections.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Comments

This can be viewed as an irregular table: after the initial zero on row 0, start each row n with term x = (2^(n+1))-2 and subtract repeatedly the number of runs in binary representation of x to get successive x's, until the number that has already been listed (which is always (2^n)-2) is encountered, which is not listed second time, but instead, the current row is finished [and thus containing only terms of equal binary length, A000523(n) on row n]. The next row then starts with (2^(n+2))-2, with the same process repeated.

Examples

			Rows 0 - 5 of the array:
0;
2;
6, 4;
14, 12, 10;
30, 28, 26, 22, 18;
62, 60, 58, 54, 50, 46, 42, 36, 32;
After row 0, the length of row n is given by A255071(n).
		

Crossrefs

Cf. A255067 (same seq, terms divided by 2).
Cf. A255071 (gives row lengths).
Analogous sequences: A218616, A230416.

Formula

a(0) = 0, a(1) = 2, a(2) = 6; and for n > 2, a(n) = A004755(A004755(A236840(a(n-1)))) if A236840(a(n-1))+2 is power of 2, otherwise just A236840(a(n-1)) [where A004755(x) adds one 1-bit to the left of the most significant bit of x].
In other words, for n > 2, let k = A236840(a(n-1)). Then, if k+2 is not a power of 2, a(n) = k, otherwise a(n) = k + (6 * (2^A000523(k))).
Other identities. For all n >= 0:
a(n) = A255056(A255122(n)).

A255126 Number of times a number of the form 4n+2 is encountered when iterating from 2^(n+1)-2 to (2^n)-2 with the map x -> x - (number of runs in binary representation of x).

Original entry on oeis.org

0, 1, 1, 2, 4, 6, 10, 16, 27, 50, 97, 188, 355, 652, 1177, 2126, 3886, 7204, 13501, 25465, 48192, 91411, 173851, 331821, 636035, 1224505, 2366662, 4588124, 8913418, 17338878, 33756650, 65766474, 128239805, 250346859, 489422205, 958304970, 1879145187, 3689012737
Offset: 0

Views

Author

Antti Karttunen, Feb 18 2015

Keywords

Comments

Also the number of odd numbers in range [A255062(n) .. A255061(n+1)] of A255057 (equally, in A255067). See the sum-formulas.

Examples

			For n=5 we start iterating with map m(n) = A236840(n) from the initial value (2^(5+1))-2 = 62. Thus we get m(62) = 60, m(60) = 58, m(58) = 54, m(54) = 50, m(50) = 46, m(46) = 42, m(42) = 36, m(36) = 32 and finally m(32) = 30, which is (2^5)-2. Of the nine numbers encountered, only 58, 54, 50, 46, 42 and 30 are of the form 4n+2, thus a(5) = 6. Note that the initial value 2^(n+1)-2 is not included in the cases, but the final (2^n) - 2 is.
		

Crossrefs

Programs

  • PARI
    \\ Use the PARI-code given in A255125.
    
  • Scheme
    (define (A255126 n) (if (zero? n) n (let loop ((i (- (expt 2 (+ 1 n)) 4)) (s 1)) (cond ((pow2? (+ 2 i)) s) (else (loop (- i (A005811 i)) (+ s (A021913 i))))))))
    ;; Alternatively:
    (define (A255126 n) (add (COMPOSE A000035 A255057) (A255062 n) (A255061 (+ 1 n))))
    (define (A255126 n) (add (COMPOSE A000035 A255067) (A255062 n) (A255061 (+ 1 n))))
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))

Formula

a(n) = Sum_{k = A255062(n) .. A255061(n+1)} A000035(A255057(k)).
a(n) = Sum_{k = A255062(n) .. A255061(n+1)} A000035(A255067(k)).
a(n) = A255071(n) - A255125(n).

A255331 a(n) = A255329(n) - A255328(n).

Original entry on oeis.org

-1, 0, 0, -4, 1, 0, -7, 0, -3, 1, 0, 3, 0, -6, 0, -6, 0, -3, 1, 0, 3, 0, -12, 0, 0, -5, 0, 4, 0, -6, 0, -6, 0, -3, 1, 0, 3, 0, -12, 0, 0, 7, 1, -12, 2, 0, 0, -5, 0, 4, 0, -12, 0, 0, -5, 0, 4, 0, -6, 0, -6, 0, -3, 1, 0, 3, 0, -12, 0, 0, 7, 1, -12, 2, 0, 0, 7, 1, -10, 15, 0, 0, 1, -11, 2, 0, 0, -5, 0, 4, 0, -12, 0, 0, 7, 1, -12, 2, 0, 0
Offset: 0

Views

Author

Antti Karttunen, Feb 21 2015

Keywords

Comments

a(n) = How many more nodes there are in the finite subtrees branching "right" (to the "larger side") than in the finite subtrees branching "left" (to the "smaller side") from the node n in the infinite trunk of number-of-runs beanstalk (A255056).
The edge-relation between nodes is given by A236840(child) = parent. Odd numbers are leaves, as there are no such k that A236840(k) were odd.
If A255058(n) = 1, then a(n) = 0, but also in some other cases.

Examples

			The only finite subtree starting from the node number 0 (which is 0) is the leaf 1, and it branches to the "left" (meaning that it is less than 2, which is the next node in the infinite trunk), thus the difference between the nodes in finite branches to the right vs. the nodes in finite branches to the left is -1 and a(0) = -1.
The only finite subtrees starting from the node number 1 in the infinite trunk (which is 2), are the leaves 3 and 5, of which the other one is on the "left" side and the other one on the "right" side (i.e. less than 4 and more than 4, which is the next node in the infinite trunk), thus a(1) = 1-1 = 0.
The node 11 in the infinite trunk is A255056(11) = 30. Apart from 32, which is the next node (node 12) in the infinite trunk, it has one leaf-child 31 at the "left side" (less than 32), and one leaf-child 33 (more than 32) at the "right side", and also at that side a subtree of three nodes 34 <- 38 <- 43, thus a(11) = (3+1) - 1 = 3.
		

Crossrefs

Partial sums: A255332.

Programs

Formula

a(n) = A255329(n) - A255328(n).

A106836 First differences of A060833 and (from a(2) onward) also of A091067 and A255068.

Original entry on oeis.org

3, 3, 1, 4, 1, 2, 1, 4, 3, 1, 1, 3, 1, 2, 1, 4, 3, 1, 4, 1, 2, 1, 1, 3, 3, 1, 1, 3, 1, 2, 1, 4, 3, 1, 4, 1, 2, 1, 4, 3, 1, 1, 3, 1, 2, 1, 1, 3, 3, 1, 4, 1, 2, 1, 1, 3, 3, 1, 1, 3, 1, 2, 1, 4, 3, 1, 4, 1, 2, 1, 4, 3, 1, 1, 3, 1, 2, 1, 4, 3, 1, 4, 1, 2, 1, 1, 3, 3, 1, 1, 3, 1, 2, 1, 1, 3, 3, 1, 4, 1, 2, 1
Offset: 1

Views

Author

Ralf Stephan, May 03 2005

Keywords

Comments

From Antti Karttunen, Feb 20 2015: (Start)
Among the terms a(1) .. a(8192), 1 occurs 4095 times, 2 occurs 1024 times, 3 occurs 2048 times and 4 occurs 1025 times. No larger numbers can ever occur.
That these are the first differences of not just A091067 and A255068, but also of A060833 follows from N. Sato's Feb 12 2013 comment in the latter that "For n > 1, n is in the sequence (A060833) if and only if A038189(n-1) = 1."
Also length of runs in A236840 and A255070.
(End)

Crossrefs

Programs

Formula

a(1) = 3, and for n > 1: a(n) = A091067(n) - A091067(n-1). - Antti Karttunen, Feb 20 2015

Extensions

Name edited by Antti Karttunen, Feb 20 2015

A255058 Branching degree of node n in the trunk of number-of-runs beanstalk: a(n) = A106836(1+A255057(n)).

Original entry on oeis.org

3, 3, 1, 4, 2, 1, 4, 1, 3, 2, 1, 4, 3, 4, 1, 3, 1, 3, 2, 1, 4, 3, 4, 1, 3, 3, 1, 3, 3, 4, 1, 3, 1, 3, 2, 1, 4, 3, 4, 1, 3, 3, 2, 4, 4, 1, 3, 3, 1, 3, 3, 4, 1, 3, 3, 1, 3, 3, 4, 1, 3, 1, 3, 2, 1, 4, 3, 4, 1, 3, 3, 2, 4, 4, 1, 3, 3, 2, 4, 4, 1, 1, 2, 3, 4, 1, 3, 3, 1, 3, 3, 4, 1, 3, 3, 2, 4, 4, 1, 3, 3, 1, 3, 3, 4, 1, 3, 3, 1, 3, 3, 4, 1, 3, 1, 3, 2, 1, 4
Offset: 0

Views

Author

Antti Karttunen, Feb 20 2015

Keywords

Comments

Iff a(n) = 1, then A255330(n) = 0.
If a(n) = 1, then A255331(n) = 0.

Examples

			The node 11 in the infinite trunk is A255056(11) = 30. Apart from 32, which is the next node (node 12) in the infinite trunk, it has one leaf-child 31 at the "left side" (less than 32), and one leaf-child 33 (more than 32) at the "right side", and also at that side a subtree of three nodes (34 <- 38 <- 43), starting from 34, so in total there are four branches emanating from 30, [i.e., four different k such that A236840(k) = 30], thus a(11) = 4.
Note that a(0) = 3, as for node zero, we count among its children the following cases A236840(2) = 0, A236840(1) = 0, and also A236840(0) = 0, with 0 being exceptionally its own child.
		

Crossrefs

Programs

Formula

a(n) = A106836(1+A255057(n)).

A255063 Number of times an evil number is encountered when iterating from 2^(n+1)-2 to (2^n)-2 with the map x -> x - (number of runs in binary representation of x).

Original entry on oeis.org

1, 0, 1, 2, 2, 5, 7, 14, 24, 52, 84, 173, 290, 586, 1038, 2025, 3740, 7177, 13498, 25832, 49027, 93918, 179291, 344128, 660058, 1270590, 2447944, 4728357, 9145214, 17718039, 34365068, 66717630, 129619518, 251953756, 489964171, 953141850, 1854911347
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Examples

			For n=0 we count the evil numbers (A001969) found in range A255056(0..0), and A255056(0) = 0 is an evil number, thus a(0) = 1.
For n=1 we count the evil numbers in range A255056(1..1), and A255056(1) = 2 is not an evil number, thus a(1) = 0.
For n=2 we look at the numbers in range A255056(2..3), i.e. 4 and 6 and while 4 is not an evil number, 6 is, thus a(2) = 1.
For n=5 we look at the numbers in range A255056(12..20) which are (32, 36, 42, 46, 50, 54, 58, 60, 62). Or we take them in the order they come when iterating A236840 (as in A255066(12..20): 62, 60, 58, 54, 50, 46, 42, 36, 32), that is, we start iterating with map m(n) = A236840(n) from the initial value (2^(5+1))-2 = 62. Thus 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^5). Of the nine numbers encountered, only 60, 58, 54, 46 and 36 are evil numbers, thus a(5) = 5.
		

Crossrefs

Programs

  • PARI
    \\ Compute sequences A255063, A255064 and A255071 at the same time, starting from n=1:
    A005811(n) = hammingweight(bitxor(n, n\2));
    write_A255063_and_A255064_and_A255071(n) = { my(k, i, s63, s64); k = (2^(n+1))-2; i = 1; s63 = 0; s64 = 0; while(1, if((hammingweight(k)%2),s64++,s63++); k = k - A005811(k); if(!bitand(k+1, k+2), break, i++)); write("b255063.txt", n, " ", s63); write("b255064.txt", n, " ", s64); write("b255071.txt", n, " ", i); };
    for(n=1,36,write_A255063_and_A255064_and_A255071(n));
    
  • Scheme
    (define (A255063 n) (if (zero? n) 1 (let loop ((i (- (expt 2 (+ 1 n)) 4)) (s (modulo (+ 1 n) 2))) (cond ((pow2? (+ 2 i)) s) (else (loop (- i (A005811 i)) (+ s (A010059 i))))))))
    (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1)))))
    
  • Scheme
    (define (A255063 n) (add A254113 (A255062 n) (A255061 (+ 1 n))))
    
  • Scheme
    (define (A255063 n) (add (COMPOSE A010059 A255066) (A255062 n) (A255061 (+ 1 n))))

Formula

a(n) = Sum_{k = A255062(n) .. A255061(n+1)} A254113(k).
a(n) = Sum_{k = A255062(n) .. A255061(n+1)} A010059(A255066(k)).
Other identities. For all n >= 1:
a(n) = A255071(n) - A255064(n).

A255064 Number of times an odious number is encountered when iterating from 2^(n+1)-2 to (2^n)-2 with the map x -> x - (number of runs in binary representation of x).

Original entry on oeis.org

0, 1, 1, 1, 3, 4, 9, 15, 29, 45, 94, 155, 318, 548, 1088, 1976, 3812, 7115, 13617, 25733, 49247, 93739, 179691, 343816, 660735, 1270112, 2448975, 4727786, 9146539, 17717760, 34366228, 66718749, 129619199, 251958752, 489959621, 953155315, 1854898028
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Examples

			For n=0 we count the odious numbers (A000069) found in range A255056(0..0), and A255056(0) = 0 is not an odious number, thus a(0) = 0.
For n=1 we count the odious numbers in range A255056(1..1), and A255056(1) = 2 is an odious number, thus a(1) = 1.
For n=2 we look at the numbers in range A255056(2..3), i.e. 4 and 6 and while 4 is an odious number, 6 is not, thus a(2) = 1.
For n=5 we look at the numbers in range A255056(12..20) which are (32, 36, 42, 46, 50, 54, 58, 60, 62), or if we take them in the order the come when iterating A236840 (as in A255066(12..20): 62, 60, 58, 54, 50, 46, 42, 36, 32), that is, we start iterating with map m(n) = A236840(n) from the initial value (2^(5+1))-2 = 62. Thus 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^5). Of the nine numbers encountered, only 62, 50, 42 and 32 are odious numbers, thus a(5) = 4.
		

Crossrefs

Programs

Formula

a(n) = Sum_{k = A255062(n) .. A255061(n+1)} A254114(k).
a(n) = Sum_{k = A255062(n) .. A255061(n+1)} A010060(A255066(k)).
Other identities. For all n >= 1:
a(n) = A255071(n) - A255063(n).

A237449 a(n) = n - A236855(n).

Original entry on oeis.org

0, 0, 1, 1, 1, 4, 4, 5, 5, 5, 7, 7, 7, 7, 13, 13, 14, 14, 14, 17, 17, 18, 18, 18, 20, 20, 20, 20, 25, 25, 26, 26, 26, 28, 28, 28, 28, 31, 31, 31, 31, 31, 41, 41, 42, 42, 42, 45, 45, 46, 46, 46, 48, 48, 48, 48, 54, 54, 55, 55, 55, 58, 58, 59, 59, 59, 61, 61, 61, 61
Offset: 0

Views

Author

Antti Karttunen, Apr 18 2014

Keywords

Crossrefs

Programs

  • Mathematica
    A236855list[m_] := With[{r = 2*Range[2, m]-1}, Reverse[Map[Total[r-#] &, Select[Subsets[Range[2, 2*m-1], {m-1}], Min[r-#] >= 0 &]]]];
    With[{m = 6}, Range[0, CatalanNumber[m]-1] - A236855list[m]] (* Generates C(m) terms *) (* Paolo Xausa, Feb 20 2024 *)
  • Scheme
    (define (A237449 n) (- n (A236855 n)))

Formula

a(n) = n - A236855(n).

A363674 T(n,k) is the decimal equivalent of the n-bit inverted Gray code for k; triangle T(n,k), n>=0, 0<=k<=2^n-1, read by rows.

Original entry on oeis.org

0, 1, 0, 3, 2, 0, 1, 7, 6, 4, 5, 1, 0, 2, 3, 15, 14, 12, 13, 9, 8, 10, 11, 3, 2, 0, 1, 5, 4, 6, 7, 31, 30, 28, 29, 25, 24, 26, 27, 19, 18, 16, 17, 21, 20, 22, 23, 7, 6, 4, 5, 1, 0, 2, 3, 11, 10, 8, 9, 13, 12, 14, 15, 63, 62, 60, 61, 57, 56, 58, 59, 51, 50, 48
Offset: 0

Views

Author

Alois P. Heinz, Jun 14 2023

Keywords

Comments

Row n is a permutation of {0, 1, ..., A000225(n)}.

Examples

			Triangle T(n,k) begins:
   0;
   1,  0;
   3,  2,  0,  1;
   7,  6,  4,  5, 1, 0,  2,  3;
  15, 14, 12, 13, 9, 8, 10, 11, 3, 2, 0, 1, 5, 4, 6, 7;
  ...
T(n,k) written in n-bit binary begins:
    ();
     1,    0;
    11,   10,   00,   01;
   111,  110,  100,  101,  001,  000,  010,  011;
  1111, 1110, 1100, 1101, 1001, 1000, 1010, 1011, 0011, 0010, 0000, ...;
  ...
		

Crossrefs

Columns k=0-2 give: A000225, A000918 (for n>=1), A028399 (for n>=2).
Row sums give A006516.

Programs

  • Maple
    T:= (n, k)-> Bits[Xor](2^n-1-k, iquo(k, 2)):
    seq(seq(T(n, k), k=0..2^n-1), n=0..6);

Formula

T(n,k) = 2^n - 1 - A003188(k) = A000225(n) - A003188(k).
Sum_{k=0..2^n-1} (-1)^k * T(n,k) = A063524(n).
T(n,0) = T(n+1,2^(n+1)-1) = A000225(n).
T(n,A000975(n)) = 0.
T(n,A097072(n)) = 1 for n >= 1.
T(n,k) = T(n-1,k) + 2^(n-1) for n >= 1 and 0 <= k < 2^(n-1).
T(n,k) = T(n-1,2^n-1-k) for n >= 1 and 2^(n-1) <= k < 2^n.
A000120(T(n,n)) = A236840(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.
Previous Showing 11-20 of 20 results.