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.

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.

This page as a plain text file.
%I A334259 #38 Jul 17 2021 04:29:23
%S A334259 37,3790,4991,38073,908979,8378611,62110713,87126031,8490820681,
%T A334259 9514920697,24717215429,784191725098,836390891918
%N 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.
%C A334259 This is inspired by the self-locating digits in Pi (A057680). Similar to A064810, these digits are 0-indexed, whereas in A057680 the sequence is 1-indexed.
%C A334259 The first two terms of the 1-indexed sequence are 8031711 and 648967141. - _Giovanni Resta_, Apr 22 2020
%e A334259 37 is a term because the 3 digit of 37 appears in the 37th 0-indexed position of the Copeland-Erdős constant.
%t A334259 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<n, p = NextPrime[p]; If[p > 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 *)
%o A334259 (Python)
%o A334259 import sympy
%o A334259 from sympy import sieve
%o A334259 def digits_at(ss, n):
%o A334259     ''' Extracts len(str(n)) digits at position n.'''
%o A334259     t = len(str(n))
%o A334259     s = ss[n:n+t]
%o A334259     if s == '':
%o A334259         return -1
%o A334259     return int(s)
%o A334259 def self_locating(ss, n):
%o A334259     return digits_at(ss,n) == n
%o A334259 SS = ""
%o A334259 for p in sieve.primerange(2, 100000):
%o A334259     SS += str(p)
%o A334259 for i in range(100000):
%o A334259     if self_locating(SS, i):
%o A334259         print(i,end=",")
%Y A334259 Cf. A006880, A033308, A057680, A064810.
%K A334259 nonn,base,more
%O A334259 1,1
%A A334259 _Soren Telfer_, Apr 20 2020
%E A334259 a(3)-a(13) from _Giovanni Resta_, Apr 22 2020