OFFSET
1,1
COMMENTS
Positions are numbered starting from 1 for the first bit after the binary point in Pi.
FORMULA
EXAMPLE
For n=19, the bits of Pi and their numbering, after the binary point, begin
1 2 3 4 5 6 7 8 9 ...
1 1 . 0 0 1 0 0 1 0 0 0 0 1 1 1 1 ...
\-----------/
prime(19) = 67
prime(19) = 1000011_2 begins at position a(19) = 6.
prime(58) = 271 = 100001111_2 also starts at 6 => a(58) = 6.
MATHEMATICA
p=Drop[RealDigits[Pi, 2, 1010][[1]], 2](* increase for n>73 *); a[n_]:=First[SequencePosition[p, IntegerDigits[Prime[n], 2]][[1]]] (* James C. McMahon, Apr 26 2025 *)
PROG
(Python)
import gmpy2
from sympy import isprime
gmpy2.get_context().precision = 12000000
gmpy2.get_context().round = gmpy2.RoundDown
pi = gmpy2.const_pi()
binary_pi = gmpy2.digits(pi, 2)[0][2:] # Get binary digits and remove "11"
print([binary_pi.find(bin(cand)[2:])+1 for cand in range(2, 700) if isprime(cand)])
CROSSREFS
KEYWORD
nonn,base
AUTHOR
James S. DeArmon, Apr 02 2025
STATUS
approved
