A176942
Champernowne primes.
Original entry on oeis.org
1234567891, 12345678910111, 123456789101112131415161
Offset: 1
- R. W. Stephan, Factors and primes in two Smarandache sequences.
Cf.
A007376 (infinite Barbier word = almost-natural numbers: write n in base 10 and juxtapose digits).
Cf.
A033307 (decimal expansion of Champernowne constant).
Cf.
A071620 (number of digits in the n-th Champernowne prime).
See
A265043 for where to end the string of numbers that are being concatenated in order to get the n-th prime.
-
With[{no=500},FromDigits/@Select[Table[Take[Flatten[IntegerDigits/@Range[no]],n],{n,no}],PrimeQ[FromDigits[#]]&]] (* Harvey P. Dale, Feb 06 2011 *)
Select[Table[Floor[N[ChampernowneNumber[10], n]*10^n], {n, 24}], PrimeQ] (* Arkadiusz Wesolowski, May 10 2012 *)
A135605
Consider the infinite string S = 12345678910111213141516171819202122232425262728293031... Sequence gives the first prime that starts at the k-th digit, skipping zero digits.
Original entry on oeis.org
1234567891, 2, 3, 4567, 5, 67, 7, 89, 9101112131, 101, 11, 11, 1213, 2, 13, 3, 14151617, 41, 151, 5, 16171819202122232425262728293031323334353637383940414243, 61, 17, 7, 181, 81920212223242526272829303, 19, 920212223242526272829303132333435363738394041424344454647484950515253
Offset: 1
Marcelo Iglesias (markelo(AT)gmail.com), Feb 26 2008
Examples from _N. J. A. Sloane_, Feb 24 2021: (Start)
S = 1234567891011121314151617181920212...
The 10th digit is a 1, and the first prime in S that starts with that digit is 101.
The 11th digit is 0, so we skip it.
The 12th digit is 1, and the first prime in S that starts with that digit is 11.
The 13th digit is another 1, and the first prime in S that starts with that digit is another 11.
The 14th digit is another 1, and the first prime in S that starts with that digit is 1213.
And so on. (End)
-
a[n_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = 9 i*10^(i - 1) + l; i++ ]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + 10^(i - 1); If[p != 0, IntegerDigits[q][[p]], Mod[q - 1, 10]]]; pp[j_, k_] := FromDigits[ Table[ a@i, {i, j, k}]]; f[n_] := Block[{m = n, p}, If[a@n != 0, (While[p = pp[n, m]; ! PrimeQ@ p, m++ ]; p),]]; Array[f, 29] (* Robert G. Wilson v, Mar 01 2008 *)
A073176
First n-digit prime in the concatenation of odd integers allowing leading zeros.
Original entry on oeis.org
3, 13, 911, 5791, 79111, 31051, 1232527, 23252729, 113151719, 2527293133, 57911131517, 991011031051, 6769717375777, 13579111315171, 135791113151719, 4547495153555759, 31517192123252729, 719212325272931333, 1131517192123252729, 71921232527293133353
Offset: 1
a(4) = 5791 because first 4-digit prime in 135791113151719212325272931333537394143454749... is 5791. Notice that a(6) = 31051 because actually it is 031051, If we remove initial zeros, then a(6) = 105107.
-
S:= "":
for i from 1 to 300 by 2 do
S:= cat(S,sprintf("%d",i))
od:
nS:= length(S):
for n from 1 do
found:= false;
for i from 1 to nS-n+1 do
x:= parse(S[i..n+i-1]);
if isprime(x) then R[n]:= x; found:= true; break fi
od;
if not found then break fi;
od:
seq(R[i],i=1..n-1); # Robert Israel, Nov 27 2024
A376221
The smallest Champernowne prime in base n.
Original entry on oeis.org
3, 5, 109, 7, 18796638871, 131870666077, 83, 11, 1234567891, 13, 24677
Offset: 2
a(2) = 3 as 11_2 is prime.
a(3) = 5 as 12_3 is prime.
a(4) = 109 as 1231_4 is prime.
a(5) = 7 as 12_5 is prime.
a(6) = 18796638871 as 12345101112131_6 is prime.
a(7) = 131870666077 as 12345610111213_7 is prime.
a(8) = 83 as 123_8 is prime.
a(9) = 11 as 12_9 is prime.
a(10) = 1234567891 as 1234567891_10 is prime. See A176942.
a(11) = 13 as 12_11 is prime.
a(12) = 24677 as 12345_12 is prime.
- Scott R. Shannon, a(n) for n = 2..36. A value of -1 indicates the term is currently unknown.
A162324
Write the natural numbers as an infinite sequence of digits; starting at the left, cut into the smallest pieces so that each piece is a prime. Leading zeros are thrown away.
Original entry on oeis.org
1234567891, 11, 1213, 14151617, 181, 920212223242526272829303132333435363738394041424344454647484950515253, 5
Offset: 1
After 1234567891 the next digit is 0 that has to be rejected. Next digits are 11 (prime); then 12, 13 (1213 prime); etc.
A383790
Prime numbers in order of occurrence as substrings in the concatenation of natural numbers 123456789101112....
Original entry on oeis.org
2, 23, 3, 5, 4567, 67, 7, 23456789, 89, 1234567891, 4567891, 67891, 56789101, 789101, 89101, 101, 11, 12345678910111, 45678910111, 10111, 45678910111213, 678910111213, 78910111213, 11213, 1213, 13, 9101112131, 1112131, 2131, 131, 31, 11213141, 1213141, 41, 91011121314151, 151, 123456789101112131415161
Offset: 1
Concatenation 123 has primes 23 and 3 ending at the 3, and 23 is in the sequence first since its substring starts first.
-
import sympy
def concat_up_to_k(k):
return ''.join(str(i) for i in range(1, k + 1))
def primes_in_substrings(s):
A383790 = []
prime_set = set()
for i in range(1, len(s) + 1):
for j in range(i):
substring = s[j:i]
if substring[0] != '0':
num = int(substring)
if sympy.isprime(num) and num not in prime_set:
A383790.append(num)
prime_set.add(num)
return A383790
k = 17
number_string = concat_up_to_k(k)
A383790 = primes_in_substrings(number_string)
print(A383790)
Showing 1-6 of 6 results.
Comments