login
A378472
Position of start of first run of exactly n zeros in the base-2 representation of Pi, or -1 if no such run exists.
3
17, 1, 26, 7, 109, 135, 96, 189, 2610, 902, 4267, 36139, 17317, 8375, 479166, 11791, 112954, 436893, 1286743, 726844, 5572140, 27456324, 2005750, 42248747, 200643872, 547151636, 171498580, 469458286, 1222711767, 2151391703, 1407238214
OFFSET
1,1
COMMENTS
In base-2, Pi is: 11.00100100001111110110101010001... For this sequence, the integer part of Pi is ignored, and the first fractional bit is numbered one.
No further terms <= 4*10^9. - Michael S. Branicky, Dec 04 2024
See A178708 for the start of the first string of n zeros, not necessarily followed by a digit 1. - M. F. Hasler, Feb 04 2026
FORMULA
a(n) >= A178708(n). - Michael S. Branicky, Dec 13 2024
EXAMPLE
The first run of a single "0" bit is at position 17, so a(1) = 17.
The first run of exactly 2 zeros is at position 1, so a(2) = 1.
PROG
(Python)
import gmpy2
gmpy2.get_context().precision = 2000000
pi = gmpy2.const_pi()
# Convert Pi to binary representation
binary_pi = gmpy2.digits(pi, 2)[0] # zero-th element is the string of bits
outVec = []
for lenRun in range(1, 20):
l1 = binary_pi.find("1" + "0"*lenRun + "1")
outVec.append(l1) # edited by M. F. Hasler, Feb 04 2026
print(outVec)
CROSSREFS
Cf. A004601, A175945, A178708 (start of run of exactly n '0's), A233836.
Sequence in context: A040304 A347142 A347143 * A124517 A241121 A040305
KEYWORD
nonn,base,more
AUTHOR
James S. DeArmon, Nov 27 2024
EXTENSIONS
a(21)-a(31) from Michael S. Branicky, Dec 04 2024
Clarified definition, added escape clause - N. J. A. Sloane, Dec 23 2024
STATUS
approved