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.

A166006 Distance from the origin using the binary expansion of Pi to walk the number line: Start at the origin; subtract one for each '0' digit, and add one for each '1' digit.

Original entry on oeis.org

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

Views

Author

Steven Lubars (lubars(AT)gmail.com), Oct 03 2009

Keywords

Comments

Of the first 10^10 terms, 5738590822 are positive and 4261262135 are negative. - Hans Havermann, Nov 27 2016

Examples

			The first five digits of the expansion are 1, 1, 0, 0, 1.
Starting at 0, we get 0 + 1 + 1 - 1 - 1 + 1 = 1, so a(5) = 1.
		

Crossrefs

Cf. A004601, A039624 (indices of zero), A278737 (record maxima), A278738 (record minima), A369900.

Formula

a(n) = Sum_{k=1..n} (2*b(k) - 1), where b(n) is the n-th binary digit of Pi.

A278920 In the binary race of Pi, where the race leader changes.

Original entry on oeis.org

1, 7, 17, 33, 6359, 6363, 6371, 6385, 6443, 6445, 6451, 6465, 6525, 6527, 6563, 6565, 6569, 6571, 6573, 6693, 6917, 6923, 6925, 6965, 6967, 7003, 7011, 7337, 7365, 7367, 7369, 7383, 7403, 7705, 7711, 7763, 7769, 7773, 7775, 7789, 7799, 7801, 7809, 7811, 7821, 7823, 7827, 7829, 7855, 7895, 7899
Offset: 1

Views

Author

Keywords

Comments

In the binary expansion of Pi (A004601), where the number of zeros and the number of ones exchange the lead.
Obviously a(n) must be odd.
Not necessarily a(n)+1 = A039624(n); although every term here will be one greater than a term in A039624 except the initial one. As a result, this sequence is sparser than A039624.

Examples

			Obviously a(1) = 1 is a term since in the binary expansion of Pi the first binary digit must be a one and therefore the "ones" take the lead.
a(2) = 7 since this is the first time the "zeros" take the lead.
a(3) = 17 since in the first 17 binary digits of Pi, the "ones" regain the count or lead.
		

Crossrefs

Programs

  • Mathematica
    pib = RealDigits[Pi, 2, 10000][[1]]; flag = 1; z = o = 0; k = 1; lst = {}; While[k < 10001, If[pib[[k]] == 0, z++, o++]; If[(z > o && flag != 1) || (z < o && flag != -1), AppendTo[lst, k]; flag = -flag]; k++]; lst

A278977 Number of initial digits of ternary Pi wherein the digit counts of zeros and ones are exactly equal.

Original entry on oeis.org

0, 2, 4, 7, 9, 15, 17, 18, 22, 23, 1480, 1483, 1485, 1487, 1488, 1492, 1494, 1498, 1499, 1503, 1504, 1507, 1508, 1511, 1512, 1516, 1518, 1529, 1537, 1539, 1540, 1550, 1557, 1559, 1566, 1591, 1592, 1593, 1594, 1595, 1651, 1728, 1729, 1731, 1733, 1735, 1737, 1738, 1740, 1756, 1757, 1762, 1767, 1768, 1771, 1777, 1779, 1781, 1782, 1784, 1789, 66404
Offset: 1

Views

Author

Hans Havermann, Dec 03 2016

Keywords

Comments

The subsequence of number of initial digits of ternary Pi wherein the digit counts of zeros, ones, and twos are all exactly equal begins 0, 15, 18. The next term, if it exists, is > 3^21 > 10^10.

Examples

			Ternary Pi is 10.01021101222201021100211...
0 is in the sequence because the first 0 digits contain 0 zeros and 0 ones.
22 is in the sequence because the first 22 digits contain 8 zeros and 8 ones.
23 is in the sequence because the first 23 digits contain 8 zeros and 8 ones.
		

Crossrefs

A278978 Number of initial digits of ternary Pi wherein the digit counts of zeros and twos are exactly equal.

Original entry on oeis.org

0, 1, 13, 15, 16, 18, 19, 20, 31, 32, 127, 146, 147, 151, 152, 154, 155, 183, 184, 188, 4852, 4854, 4855, 5375, 5490, 5493, 5539, 5540, 5542, 5547, 5624, 5625, 5628, 5629, 5649, 5652, 5657, 5659, 5661, 5662, 5664, 5667, 5669, 5670, 5671, 5672, 5674, 5681, 5685, 5687, 5688, 5696, 5701, 5703, 5718, 5731, 5733, 5735, 5738, 5827, 5829, 5830
Offset: 1

Views

Author

Hans Havermann, Dec 03 2016

Keywords

Examples

			Ternary Pi is 10.01021101222201021100211...
0 is in the sequence because the first 0 digits contain 0 zeros and 0 twos.
15 is in the sequence because the first 15 digits contain 5 zeros and 5 twos.
16 is in the sequence because the first 16 digits contain 5 zeros and 5 twos.
		

Crossrefs

A278979 Number of initial digits of ternary Pi wherein the digit counts of ones and twos are exactly equal.

Original entry on oeis.org

0, 14, 15, 18, 37, 38, 215, 218, 267, 280, 282, 290, 326, 328, 329, 331, 332, 333, 346, 347, 348, 350, 403, 404, 405, 425, 430, 431, 433, 435, 440, 454, 455, 456, 457, 458, 575, 577, 578, 579, 581, 590, 630, 631, 633, 634, 635, 637, 643, 644, 645, 646, 647, 648, 651, 652, 653, 654, 655, 658, 659, 663, 664, 666, 763, 770, 935, 937, 938, 950, 952, 1124
Offset: 1

Views

Author

Hans Havermann, Dec 03 2016

Keywords

Examples

			Ternary Pi is 10.01021101222201021100211...
0 is in the sequence because the first 0 digits contain 0 ones and 0 twos.
14 is in the sequence because the first 14 digits contain 5 ones and 5 twos.
15 is in the sequence because the first 15 digits contain 5 ones and 5 twos.
		

Crossrefs

A278737 a(n) is the index of the first occurrence of n in A166006.

Original entry on oeis.org

1, 2, 21, 6594, 6595, 6602, 6603, 6604, 6605, 6606, 6609, 6612, 6613, 6622, 6623, 6626, 6627, 6628, 6629, 6630, 7499, 7500, 7507, 7512, 7513, 7514, 7535, 7536, 7537, 27056
Offset: 1

Views

Author

Hans Havermann, Nov 27 2016

Keywords

Comments

These are necessarily the indices of record maxima in A166006.

Examples

			3 first occurs in A166006 at position 21, so a(3) = 21.
		

Crossrefs

A278738 a(n) is the index of the first occurrence of -n in A166006.

Original entry on oeis.org

7, 10, 11, 12, 39, 48, 53, 54, 57, 58, 69, 72, 77, 86, 91, 92, 101, 102, 103, 104, 115, 130, 135, 138, 139, 140, 141, 142, 145, 148, 155, 156, 159, 160, 163, 164, 169, 196, 197, 198, 201, 202, 203, 204, 273, 274, 275, 276, 279, 280, 281, 306, 307, 308, 309, 312, 1955
Offset: 1

Views

Author

Hans Havermann, Nov 27 2016

Keywords

Comments

These are necessarily the indices of record minima in A166006.

Examples

			-3 first occurs in A166006 at position 11, so a(3) = 11.
		

Crossrefs

A339449 Numbers k such that there are equal numbers of 0's and 2's and equal numbers of 1's and 3's among the first k digits of the quaternary representation of Pi.

Original entry on oeis.org

0, 4, 386, 398, 2919434, 2919644, 2919648
Offset: 1

Views

Author

Pontus von Brömssen, Dec 05 2020

Keywords

Comments

The terms can also be interpreted as numbers k such that a walk on the square lattice governed by the quaternary digits of Pi is at the origin after k steps, where digit 0 corresponds to a step to the right, 1 to up, 2 to left, and 3 to down.
There are no more terms below 2*10^9.
There are two variations of this sequence, according to the directions each digit corresponds to. In A339450, 0=right, 1=left, 2=up, 3=down. For the case 0=right, 1=up, 2=down, 3=left, the only terms below 2*10^9 are 0, 2, 4, 8.

Examples

			4 is a term because the first four quaternary digits of Pi are 3, 0, 2, 1, one of each digit.
386 is a term because among the first 386 digits there are 99 0's and 99 2's, and 94 1's and 94 3's.
		

Crossrefs

A339450 Numbers k such that there are equal numbers of 0's and 1's and equal numbers of 2's and 3's among the first k digits of the quaternary representation of Pi.

Original entry on oeis.org

0, 4, 87640, 206648324, 206657530, 206657532, 206657560, 206657576
Offset: 1

Views

Author

Pontus von Brömssen, Dec 05 2020

Keywords

Comments

There are no more terms below 2*10^9.

Examples

			4 is a term because the first four quaternary digits of Pi are 3, 0, 2, 1, one of each digit.
87640 is a term because among the first 87640 digits there are 21880 0's, 21880 1's, 21940 2's and 21940 3's.
		

Crossrefs

Showing 1-9 of 9 results.