A057680
Self-locating strings within Pi: numbers n such that the string n is at position n in the decimal digits of Pi, where the initial digit 3 is at position 0.
Original entry on oeis.org
1, 16470, 44899, 79873884, 711939213, 36541622473, 45677255610, 62644957128, 656430109694
Offset: 1
1 is a term because the string of digits '1' occurs as the 1st digit after the decimal point.
Similarly, 16470 is a term because the string of digits '16470' occurs starting at position 16470 (after the decimal point) in the digits of Pi (although it already occurs earlier at position 1602). - _M. F. Hasler_, Jul 29 2024
- Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 60.
Cf.
A000796 (decimal digits of Pi),
A057679 (variant where position 1 refers to the initial digit 3),
A064810 (variant where position 0 refers to the first digit after the decimal point),
A109513 (variant using chunks of m digits).
-
StringsinPiAfterPoint[m_] := Module[{cc = 10^m + m, sol, aa}, sol = Partition[RealDigits[Pi,10,cc] // First // Rest, m, 1]; Do[aa = FromDigits[sol[[i]]]; If[aa==i, Print[{i, aa}]], {i,Length[sol]}];] (* For example, StringsinPiAfterPoint[5] returns all 5-digit members of the sequence. - Colin Rose, Mar 15 2006 *)
Do[If[RealDigits[Pi,10,a=i+IntegerLength@i-1,-1][[1,i;;a]]==IntegerDigits@i,Print@i],{i,50000}] (* Giorgos Kalogeropoulos, Feb 21 2020 *)
-
A057680_row(r=5)={my(M=10^r, R=[]); for(n=M\10, M-1, localprec(n+r); Pi\10^(1-r-n)%M==n && !print1(n",") && R=concat(R,n));R} \\ prints & returns the r-digit terms. - M. F. Hasler, Jul 29 2024
A057679
Self-locating strings within Pi: numbers n such that the string n is at position n in the decimal digits of Pi, where 3 is the first digit.
Original entry on oeis.org
5, 242424, 271070, 9292071, 29133316, 70421305, 215817165252, 649661007154
Offset: 1
5 is a term because 5 is the 5th digit of Pi (3.1415...).
-
StringsinPi[m_] := Module[{cc = 10^m + m, sol, aa}, sol = Partition[RealDigits[Pi,10,cc] // First, m, 1]; Do[aa = FromDigits[sol[[i]]]; If[aa==i, Print[{i, aa}]], {i,Length[sol]}];] (* For example, StringsinPi[6] returns all 6-digit members of the sequence. - Colin Rose, Mar 15 2006 *)
dpi = RealDigits[Pi, 10, 10000010][[1]]; Select[Range[10000000], FromDigits[Take[dpi, {#, # - 1 + IntegerLength[#]}]] == # &] (* Vaclav Kotesovec, Feb 18 2020 *)
A331015
Self-locating strings within Euler-Mascheroni Constant (gamma), strings k at position k (taking gamma offset 1).
Original entry on oeis.org
57, 16939, 767158, 5505709, 6674196, 7418985, 18873720
Offset: 1
57 is a term because the 57th digit is 5 and the 58th digit is 7.
Euler-Mascheroni constant digits:
A001620.
-
dgamma = RealDigits[EulerGamma, 10, 1000010][[1]]; Select[Range[1000000], FromDigits[Take[dgamma, {#, # - 1 + IntegerLength[#]}]] == # &] (* Vaclav Kotesovec, Feb 18 2020 *)
A334259
Self-locating numbers within the Copeland-Erdős constant: numbers k such that the string k is at the 0-indexed position k in the decimal digits of the concatenation of the prime numbers as a decimal sequence.
Original entry on oeis.org
37, 3790, 4991, 38073, 908979, 8378611, 62110713, 87126031, 8490820681, 9514920697, 24717215429, 784191725098, 836390891918
Offset: 1
37 is a term because the 3 digit of 37 appears in the 37th 0-indexed position of the Copeland-Erdős constant.
-
q=23; p=3; dq=2; dn=dp=1; L={}; n=-1; pP=nP=10; While[++n < 10^6, If[n == nP, nP *= 10; dn++]; While[ q pP, pP *= 10; dp++]; q = q pP + p; dq += dp]; If[n == Floor[ q/10^(dq - dn)], Print@ AppendTo[L, n]]; q = Mod[q, 10^(--dq)]]; L (* Giovanni Resta, Apr 21 2020 *)
-
import sympy
from sympy import sieve
def digits_at(ss, n):
''' Extracts len(str(n)) digits at position n.'''
t = len(str(n))
s = ss[n:n+t]
if s == '':
return -1
return int(s)
def self_locating(ss, n):
return digits_at(ss,n) == n
SS = ""
for p in sieve.primerange(2, 100000):
SS += str(p)
for i in range(100000):
if self_locating(SS, i):
print(i,end=",")
A358211
Self-locating strings within e: numbers k such that the string k is at position k (after the decimal point) in the decimal digits of e, where 7 is the 0th digit.
Original entry on oeis.org
1, 8, 215, 374, 614, 849, 4142, 7945, 5964055, 8008913, 7131377227, 8829981707
Offset: 0
The first two terms 1 and 8 are depicted here:
Position: 0123456789...
Digits of e: 2.7182818284...
.^......^....
1 is the first term because 1 is in position 1 after the decimal point (when starting to count with 0).
8 is the second term because 8 is in position 8 etc.
-
# after Michael S. Branicky in A064810
# First get a file with e digits, e.g. https://www4.baumann.at/downloads/e.txt
with open('e.txt', 'r') as f: digits_of_e = f.readline()[2:]
def afind():
global digits_of_e
for k in range(len(digits_of_e)):
s = str(k)
if digits_of_e[k:k+len(s)] == s: print(k, end=", ")
afind()
Showing 1-5 of 5 results.
Comments