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.

Showing 1-10 of 42 results. Next

A035244 Smallest number with exactly n prime substrings.

Original entry on oeis.org

1, 2, 13, 23, 113, 137, 373, 1137, 1733, 1373, 11317, 11373, 13733, 31373, 113173, 131373, 137337, 337397, 1113173, 1137337, 1373373, 2337397, 3733797, 11373137, 11373379, 13733797, 37337397, 111373379, 123733739
Offset: 0

Views

Author

Keywords

Comments

No leading 0's allowed in substrings.
The sequence is well-defined in that for each n the set of numbers with n prime substrings is not empty. Proof by induction: '1' has 0 prime substrings and '2' has 1 prime substring. Let m be a number with n prime substrings. Then 10m+2 is a number with n+1 prime substrings (since m and 10m have identical prime substrings, and '2' is one additional prime substring, but 10m+2 cannot be prime). - Hieronymus Fischer, Aug 26 2012

Examples

			a(4)=113 since 3, 11, 13 and 113 are prime and no smaller number works.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{s = IntegerDigits[n], c = 0, d = {}}, l = Length[s]; t = Flatten[ Table[ Take[s, {i, j}], {i, 1, l}, {j, i, l}], 1]; k = l(l + 1)/2; While[k > 0, If[ t[[k]][[1]] != 0, d = Append[d, FromDigits[ t[[k]] ]]]; k-- ]; Count[ PrimeQ[d], True]]; a = Table[0, {25}]; Do[ b = f[n]; If[ a[[b + 1]] == 0, a[[b + 1]] = n], {n, 1, 15000000}]; a

Formula

a(n) > 10^floor((sqrt(8*n-7)-1)/2) for n > 0. - Hieronymus Fischer, Jun 25 2012
Min_{k>=n} a(k) <= A079397(n-1), n > 0. - Hieronymus Fischer, Aug 26 2012
a(n+1) <= 10*a(n) + 2. - Hieronymus Fischer, Aug 26 2012

Extensions

Edited by Robert G. Wilson v, Feb 25 2003
a(25)-a(40) from Hieronymus Fischer, Jun 25 2012 and Aug 25 2012

A213321 Minimal prime with n prime substrings (substrings with leading zeros are considered to be nonprime).

Original entry on oeis.org

2, 13, 23, 113, 137, 373, 1973, 1733, 1373, 11317, 17333, 31379, 37337, 113173, 211373, 313739, 337397, 1113173, 1137337, 2313797, 2337397, 11131733, 12337397, 11373379, 33133733, 111733373, 113137337, 123733739, 291733373, 113733797, 1173313373, 1137333137, 1237337393, 1137337973
Offset: 1

Views

Author

Hieronymus Fischer, Aug 26 2012

Keywords

Examples

			a(1)=2, since 2 is a prime has 1 prime substring (2).
a(2)=13, since 13 is prime and has 2 prime substrings (3 and 13)
		

Crossrefs

Formula

a(n) > 10^floor((sqrt(8*n+1)-1)/2).
min(a(k), k>=n-1) <= A079397(n-1), n>0.
a(n) >= A035244(n), n>0.

A046992 a(n) = Sum_{k=1..n} pi(k) (cf. A000720).

Original entry on oeis.org

0, 1, 3, 5, 8, 11, 15, 19, 23, 27, 32, 37, 43, 49, 55, 61, 68, 75, 83, 91, 99, 107, 116, 125, 134, 143, 152, 161, 171, 181, 192, 203, 214, 225, 236, 247, 259, 271, 283, 295, 308, 321, 335, 349, 363, 377, 392, 407, 422, 437, 452, 467, 483, 499, 515, 531, 547, 563, 580, 597, 615, 633, 651, 669
Offset: 1

Views

Author

Keywords

Comments

a(n) = A002815(n) - n. - Reinhard Zumkeller, Feb 25 2012
From Hieronymus Fischer, Sep 26 2012: (Start)
Let S(n) be a string of length n, then a(n) is the number of substrings of S(n) with a prime number of characters. Example 1: "abcd" is a string of length 4; there are a(4)=5 substrings with a prime number of characters (ab, bc, cd, abc and bcd). Example 2: "abcde" is a string of length 5; there are a(5)=8 substrings with a prime number of characters (ab, bc, cd, de, abc, bcd, cde and abcde).
Also: If n is represented in base 1 (this means 1=1_1, 2=11_1, 3=111_1, 4=1111_1, etc.), then a(n) is the number of substrings of n with a prime number of digits. Example: 7=1111111_1; the number of prime substrings of 7 (in base 1) is a(7)=15, since there are 15 substrings of prime length: 6 2-digit substrings, 5 3-digit substrings, 3 5-digit substrings and 1 7-digit substring.
(End)

Crossrefs

Programs

  • Haskell
    a046992 n = a046992_list !! (n-1)
    a046992_list = scanl1 (+) a000720_list
    -- Reinhard Zumkeller, Feb 25 2012
    
  • Mathematica
    f[n_] := (f[n - 1] + PrimePi[n]); f[1] = 0; Table[ f[n], {n, 1, 60}]
    Accumulate[PrimePi[Range[70]]] (* Harvey P. Dale, Feb 27 2013 *)
  • PARI
    a(n)=my(N=n+1,s); forprime(p=2,n, s+=N-p); s \\ Charles R Greathouse IV, Mar 03 2017
    
  • Python
    from sympy import primerange
    def A046992(n): return (n+1)*len(p:=list(primerange(n+1)))-sum(p) # Chai Wah Wu, Jan 01 2024

Formula

O.g.f.: A(x)/(1-x)^2 where A(x) = Sum_{p=prime} x^p is the o.g.f. of A010051 and A(x)/(1-x) is the o.g.f. of A000720. - Geoffrey Critzer, Dec 04 2011
From Hieronymus Fischer, Sep 26 2012: (Start)
a(n) = Sum_{p<=n, p is prime} (n - p +1).
a(n) = (n+1)*pi(n) - Sum_pi(n), where pi(n) = number of primes <= n and Sum_pi(n) = sum of primes <= n.
a(n) = (n+1)*A000720(n) - A034387(n).
(End)
a(n) ~ n^2 / (2 log n). - Charles R Greathouse IV, Mar 03 2017

Extensions

Corrected by Henry Bottomley

A033274 Primes that do not contain any other prime as a proper substring.

Original entry on oeis.org

2, 3, 5, 7, 11, 19, 41, 61, 89, 101, 109, 149, 181, 401, 409, 449, 491, 499, 601, 691, 809, 881, 991, 1009, 1049, 1069, 1481, 1609, 1669, 1699, 1801, 4001, 4049, 4481, 4649, 4801, 4909, 4969, 6091, 6469, 6481, 6869, 6949, 8009, 8069, 8081, 8609, 8669, 8681
Offset: 1

Views

Author

Keywords

Comments

If there is more than one digit, all digits must be nonprime numbers.
A179335(n) = prime(n) iff prime(n) is in this sequence. For n > 4, prime(n) is in this sequence iff A109066(n) = 0. - Reinhard Zumkeller, Jul 11 2010, corrected by M. F. Hasler, Aug 27 2012
A079066(n) = 0 iff prime(n) is in this sequence. [Corrected by M. F. Hasler, Aug 27 2012]
What are the asymptotics of this sequence? - Charles R Greathouse IV, Aug 27 2012

Examples

			149 is a term as 1, 4, 9, 14, 49 are all nonprimes.
199 is not a term as 19 is a prime.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a033274 n = a033274_list !! (n-1)
    a033274_list = map (a000040 . (+ 1)) $ elemIndices 0 a079066_list
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Mathematica
    f[n_] := Block[ {id = IntegerDigits@n}, len = Length@ id - 1; Count[ PrimeQ@ Union[ FromDigits@# & /@ Flatten[ Table[ Partition[ id, k, 1], {k, len}], 1]], True] + 1]; Select[ Prime@ Range@ 1100, f@# == 1 &] (* Robert G. Wilson v, Aug 01 2010 *)
    Select[Prime[Range[1100]],NoneTrue[Flatten[Table[FromDigits/@Partition[IntegerDigits[#],d,1],{d,IntegerLength[#]-1}]],PrimeQ]&] (* Harvey P. Dale, Apr 19 2025 *)
  • Python
    from sympy import isprime
    def ok(n):
        if n in {2, 3, 5, 7}: return True
        s = str(n)
        if set(s) & {"2", "3", "5", "7"} or not isprime(n): return False
        ss2 = set(s[i:i+l] for i in range(len(s)-1) for l in range(2, len(s)))
        return not any(isprime(int(ss)) for ss in ss2)
    print([k for k in range(9000) if ok(k)]) # Michael S. Branicky, Jun 29 2022

Extensions

Edited by N. J. A. Sloane at the suggestion of Luca Colucci, Apr 03 2008

A217302 Minimal natural number (in decimal representation) with n prime substrings in binary representation (substrings with leading zeros are considered to be nonprime).

Original entry on oeis.org

1, 2, 5, 7, 11, 15, 27, 23, 31, 55, 47, 63, 111, 95, 187, 127, 223, 191, 381, 255, 447, 503, 383, 511, 1015, 895, 767, 1023, 1533, 1791, 1535, 1919, 3039, 3069, 3067, 3839, 3967, 6079, 6139, 6135, 7679, 8063, 8159, 12159, 12271, 15359, 16127
Offset: 0

Views

Author

Hieronymus Fischer, Nov 22 2012

Keywords

Comments

The sequence is well-defined in that for each n the set of numbers with n prime substrings in binary representation is not empty. Proof: A000975(n+1) has exactly n prime substrings in binary representation (see A000975).
All terms with n > 1 are odd.

Examples

			a(1) = 2 = 10_2, since 2 is the least number with 1 prime substring (=10_2) in binary representation.
a(2) = 5 = 101_2, since 5 is the least number with 2 prime substrings in binary representation (10_2 and 101_2).
a(4) = 11 = 1011_2, since 11 is the least number with 4 prime substrings in binary representation (10_2, 11_2, 101_2 and 1011_2).
a(8) = 31 = 11111_2, since 31 is the least number with 8 prime substrings in binary representation (4 times 11_2, 3 times 111_2, and 11111_2).
a(9) = 47 = 101111_2, since 47 is the least number with 9 prime substrings in binary representation (10_2, 3 times 11_2, 101_2, 2 times 111_2, 1011_2, and 10111_2).
		

Crossrefs

Formula

a(n) >= 2^ceiling(sqrt(8*n+1)-1)/2).
a(n) <= A000975(n+1).
a(n+1) <= 2*a(n)+1.

A217309 Minimal natural number (in decimal representation) with n prime substrings in base-9 representation (substrings with leading zeros are considered to be nonprime).

Original entry on oeis.org

1, 2, 11, 23, 101, 173, 902, 1562, 1559, 8120, 14032, 14033, 73082, 126290, 604523, 657743, 723269, 1136684, 5918933, 5972147, 10227787, 25051529, 53276231, 54333278, 92071913, 441753767, 479669051, 483743986, 828662228, 3971590751, 4315446629
Offset: 0

Views

Author

Hieronymus Fischer, Nov 22 2012

Keywords

Comments

The sequence is well-defined in that for each n the set of numbers with n prime substrings is not empty. Proof: Define m(0):=1, m(1):=2 and m(n+1):=9*m(n)+2 for n>0. This results in m(n)=2*sum_{j=0..n-1} 9^j = (9^n - 1)/4 or m(n)=1, 2, 22, 222, 2222, 22222, …, (in base-9) for n=0,1,2,3,…. Evidently, for n>0 m(n) has n 2’s and these are the only prime substrings in base-9 representation. This is why every substring of m(n) with more than one digit is a product of two integers > 1 (by definition) and can therefore not be a prime number.
No term is divisible by 9.

Examples

			a(1) = 2 = 2_9, since 2 is the least number with 1 prime substring in base-9 representation.
a(2) = 11 = 12_9, since 11 is the least number with 2 prime substrings in base-9 representation (2_9 and 12_9).
a(3) = 23 = 25_9, since 23 is the least number with 3 prime substrings in base-9 representation (2_9, 3_9, and 23_9).
a(4) = 101 = 122_9, since 101 is the least number with 4 prime substrings in base-9 representation (2 times 2_9, 12_9=11, and 122_9=101).
a(7) = 1562 = 2125_9, since 1562 is the least number with 7 prime substrings in base-9 representation (2 times 2_9, 5_9, 12_9=11, 21_9=19, 25_9=23, and 212_9=173).
		

Crossrefs

Formula

a(n) > 9^floor(sqrt(8*n-7)-1)/2), for n>0.
a(n) <= (9^n - 1)/4, n>0.
a(n+1) <= 9*a(n)+3.

A217102 Minimal number (in decimal representation) with n nonprime substrings in binary representation (substrings with leading zeros are considered to be nonprime).

Original entry on oeis.org

1, 2, 7, 5, 4, 11, 10, 12, 8, 22, 21, 19, 17, 16, 60, 39, 37, 34, 36, 32, 83, 71, 74, 69, 67, 66, 64, 143, 139, 141, 135, 134, 131, 130, 128, 283, 271, 269, 263, 267, 262, 261, 257, 256, 541, 539, 527, 526, 523, 533, 519, 514, 516, 512, 1055, 1053, 1047, 1067
Offset: 1

Views

Author

Hieronymus Fischer, Dec 12 2012

Keywords

Comments

There are no numbers with zero nonprime substrings in binary representation. For all bases > 2 there is always a number (=2) with zero nonprime substrings (Cf. A217103-A217109, A213302).
If p is a number with k prime substrings and d digits (in binary representation), p even, m>=d, than b := p*2^(m-d) has m*(m+1)/2 - k nonprime substrings, and a(A000217(n)-k) <= b.

Examples

			a(1) = 1, since 1 = 1_2 is the least number with 1 nonprime substring in binary representation.
a(2) = 2, since 2 = 10_2 is the least number with 2 nonprime substrings in binary representation (0 and 1).
a(3) = 7, since 7 = 111_2 is the least number with 3 nonprime substrings in binary representation (3-times 1, the prime substrings are 2-times 11 and 111).
a(10) = 22, since 22 = 10110_2 is the least number with 10 nonprime substrings in binary representation, these are 0, 0, 1, 1, 1, 01, 011, 110, 0110 and 10110 (remember, that substrings with leading zeros are considered to be nonprime).
		

Crossrefs

Formula

a(n) >= 2^floor((sqrt(8*n-7)-1)/2) for n>=1, equality holds if n=1 or n+1 is a triangular number (cf. A000217).
a(n) >= 2^floor((sqrt(8*n+1)-1)/2) for n>1, equality holds if n+1 is a triangular number.
a(A000217(n)-1) = 2^(n-1), n>1.
a(A000217(n)-k) >= 2^(n-1) + k-1, 1<=k<=n, n>1.
a(A000217(n)-k) = 2^(n-1) + p, where p is the minimal number >= 0 such that 2^(n-1) + p, has k prime substrings in binary representation, 1<=k<=n, n>1.

A217109 Minimal number (in decimal representation) with n nonprime substrings in base-9 representation (substrings with leading zeros are considered to be nonprime).

Original entry on oeis.org

2, 1, 12, 9, 83, 84, 81, 748, 740, 731, 729, 6653, 6581, 6563, 6564, 6561, 59222, 59069, 59068, 59051, 59052, 59049, 531614, 531569, 531464, 531460, 531452, 531443, 531441, 4784122, 4783142, 4783147, 4783070, 4782989, 4782971, 4782972, 4782969, 43048283
Offset: 0

Views

Author

Hieronymus Fischer, Dec 12 2012

Keywords

Comments

The sequence is well-defined in that for each n the set of numbers with n nonprime substrings is not empty. Proof: Define m(n):=2*sum_{j=i..k} 9^j, where k:=floor((sqrt(8*n+1)-1)/2), i:= n-A000217(k). For n=0,1,2,3,... the m(n) in base-9 representation are 2, 22, 20, 222, 220, 200, 2222, 2220, 2200, 2000, 22222, 22220, .... m(n) has k+1 digits and (k-i+1) 2’s, thus, the number of nonprime substrings of m(n) is ((k+1)*(k+2)/2)-k-1+i = (k*(k+1)/2)+i = n, which proves the statement.
If p is a number with k prime substrings and d digits (in base-9 representation), m>=d, than b := p*9^(m-d) has m*(m+1)/2 - k nonprime substrings, and a(A000217(n)-k) <= b.

Examples

			a(0) = 2, since 2 = 2_9 is the least number with zero nonprime substrings in base-9 representation.
a(1) = 1, since 1 = 1_9 is the least number with 1 nonprime substring in base-9 representation.
a(2) = 12, since 12 = 13_9 is the least number with 2 nonprime substrings in base-9 representation (1 and 13).
a(3) = 9, since 9 = 10_9 is the least number with 3 nonprime substrings in base-9 representation (0, 1 and 10).
a(4) = 83, since 83 = 102_9 is the least number with 4 nonprime substrings in base-9 representation, these are 0, 1, 10, and 02 (remember, that substrings with leading zeros are considered to be nonprime).
		

Crossrefs

Formula

a(n) >= 9^floor((sqrt(8*n-7)-1)/2) for n>0, equality holds if n is a triangular number (cf. A000217).
a(A000217(n)) = 9^(n-1), n>0.
a(A000217(n)-k) >= 9^(n-1) + k, 0<=k0.
a(A000217(n)-k) = 9^(n-1) + p, where p is the minimal number >= 0 such that 9^(n-1) + p, has k prime substrings in base-9 representation, 0<=k0.

A179909 Primes with only one embedded prime.

Original entry on oeis.org

13, 17, 29, 31, 43, 47, 59, 67, 71, 79, 83, 97, 103, 107, 151, 163, 191, 199, 269, 281, 349, 421, 461, 463, 487, 509, 569, 607, 641, 661, 701, 709, 769, 787, 811, 821, 863, 877, 887, 907, 911, 919, 941, 1021, 1051, 1061, 1063, 1087, 1091, 1201, 1249, 1409
Offset: 1

Views

Author

Robert G. Wilson v, Aug 01 2010

Keywords

Comments

A079066(a(n)) = 1.

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a179909 n = a179909_list !! (n-1)
    a179909_list = map (a000040 . (+ 1)) $ elemIndices 1 a079066_list
    -- Reinhard Zumkeller, Jul 19 2011
  • Mathematica
    f[n_] := Block[ {id = IntegerDigits@n}, len = Length@ id - 1; Count[ PrimeQ@ Union[ FromDigits@# & /@ Flatten[ Table[ Partition[ id, k, 1], {k, len}], 1]], True] + 1]; Select[ Prime@ Range@ 230, f@# == 2 &]

A179919 Primes with eleven embedded primes.

Original entry on oeis.org

111317, 113177, 113537, 113719, 113731, 117193, 117331, 121379, 123733, 129719, 131797, 132173, 132971, 136733, 136739, 137197, 137321, 137339, 137353, 137359, 137393, 137573, 152311, 172313, 173137, 173359, 174311, 193373, 211319, 213799
Offset: 1

Views

Author

Robert G. Wilson v, Aug 01 2010

Keywords

Comments

A079066(a(n)) = 11.

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a179919 n = a179919_list !! (n-1)
    a179919_list = map (a000040 . (+ 1)) $ elemIndices 11 a079066_list
    -- Reinhard Zumkeller, Jul 19 2011
  • Mathematica
    f[n_] := Block[ {id = IntegerDigits@n}, len = Length@ id - 1; Count[ PrimeQ@ Union[ FromDigits@# & /@ Flatten[ Table[ Partition[ id, k, 1], {k, len}], 1]], True] + 1]; Select[ Prime@ Range@ 19110, f@# == 12 &]
Showing 1-10 of 42 results. Next