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 48 results. Next

A213300 Largest number with n nonprime substrings (substrings with leading zeros are considered to be nonprime).

Original entry on oeis.org

373, 3797, 37337, 73373, 373379, 831373, 3733797, 3733739, 8313733, 9973331, 37337397, 82337397, 99733313, 99733317, 99793373, 733133733, 831373379, 997333137, 997337397, 997933739, 7331337337, 8313733797, 9733733797, 9973331373, 9979337397, 9982337397
Offset: 0

Views

Author

Hieronymus Fischer, Aug 26 2012

Keywords

Comments

The sequence is well-defined in that for each n the set of numbers with n nonprime substrings is nonempty and finite. Proof of existence: Define m(n):=2*sum_{j=i..k} 10^j, where k:=floor((sqrt(8n+1)-1)/2), i:= n - k(k+1)/2. For n=0,1,2,3,... the m(n) 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. This proves existence. Proof of finiteness: Each 4-digit number has at least 1 nonprime substring. Hence each 4*(n+1)-digit number has at least n+1 nonprime substrings. Consequently, there is a boundary b < 10^(4n+3) such that all numbers > b have more than n nonprime substrings. It follows that the set of numbers with n nonprime substrings is finite.
The following statements hold true:
For all n>=0 there are minimal numbers with n nonprime substrings (cf. A213302 - A213304).
For all n>=0 there are maximal numbers with n nonprime substrings (= A213300 = this sequence).
For all n>=0 there are minimal numbers with n prime substrings (cf. A035244).
The greatest number with n prime substrings does not exist. Proof: If p is a number with n prime substrings, than 10*p is a greater number with n prime substrings.
Comment from N. J. A. Sloane, Sep 01 2012: it is a surprise that any number greater than 373 has a nonprime substring!

Examples

			a(0)=373, since 373 is the greatest number such that all substrings are primes, hence it is the maximal number with 0 nonprime substrings.
a(1)=3797, since the only nonprime substring of 3797 is 9 and all greater numbers have more than 1 nonprime substrings.
a(2)=37337, since the nonprime substrings of 37337 are 33 and 7337 and all greater numbers have > 2 nonprime substrings.
		

Crossrefs

Formula

a(n) >= A035244(A000217(A055642(a(n)))-n).

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.

A079397 Smallest prime with memory = n.

Original entry on oeis.org

2, 13, 23, 113, 137, 1237, 1733, 1373, 12373, 11317, 23719, 111317, 113171, 211373, 1131379, 1113173, 1317971, 2313797, 11131733, 11373379, 23931379, 113193797, 52313797, 129733313, 113733797, 523137971, 1113179719, 1317971939
Offset: 0

Views

Author

Joseph L. Pe, Feb 16 2003

Keywords

Comments

The memory of a prime p is the number of previous primes contained as substrings in (the decimal representation of) p.
Also the minimal prime such that the number of different prime substrings is n+1 (substrings with leading zeros are considered to be nonprime). - Hieronymus Fischer, Aug 26 2012

Examples

			113 is the smallest prime with memory = 3. (The smaller primes 3, 11, 13 are substrings of 113.) Hence a(3) = 113.
		

Crossrefs

Programs

  • 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]; t = Table[0, {30}]; p = 2; While[p < 11500000000, a = f@p; If[t[[a]] == 0, pp = PrimePi@p; t[[a]] = pp; Print[{a, p, pp}]]; p = NextPrime@p]; t (* Robert G. Wilson v, Aug 03 2010 *)

Formula

a(n) > 10^floor((sqrt(8*n+1)-1)/2). - Hieronymus Fischer, Aug 26 2012
a(n) >= min(A035244(k+1), k >= n). - Hieronymus Fischer, Aug 26 2012

Extensions

Edited and extended by Robert G. Wilson v, Feb 25 2003
a(24)-a(27) from Robert G. Wilson v, Aug 03 2010

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

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.

A213302 Smallest number with n nonprime substrings (Version 1: substrings with leading zeros are considered to be nonprime).

Original entry on oeis.org

2, 1, 11, 10, 103, 101, 100, 1017, 1011, 1002, 1000, 10037, 10023, 10007, 10002, 10000, 100137, 100073, 100023, 100003, 100002, 100000, 1000313, 1000037, 1000033, 1000023, 1000003, 1000002, 1000000, 10000337, 10000223, 10000137, 10000037, 10000023, 10000013, 10000002, 10000000, 100001733
Offset: 0

Views

Author

Hieronymus Fischer, Aug 26 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} 10^j, where k=floor((sqrt(8*n+1)-1)/2), i:= n-A000217(k). For n=0,1,2,3,… the m(n) 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.
The 3 versions according to A213302 - A213304 are quite different. Example: 1002 has 9 nonprime substrings in version 1 (0, 0, 00, 02, 002, 1, 10 100, 1002), in version 2 there are 6 nonprime substrings (02, 002, 1, 10, 100, 1002) and there are 4 nonprime substrings in version 3 (1, 10, 100, 1002).

Examples

			a(0)=2, since 2 is the least number with zero nonprime substrings.
a(1)=1, since 1 has 1 nonprime substrings.
a(2)=11, since 11 is the least number with 2 nonprime substrings.
a(3)=10, since 10 is the least number with 3 nonprime substrings, these are 1, 0 and 10 (‘0’ will be counted).
		

Crossrefs

Formula

a(n) >= 10^floor((sqrt(8*n-7)-1)/2) for n>0, equality holds if n is a triangular number > 0 (cf. A000217).
a(A000217(n)) = 10^(n-1), n>0.
a(A000217(n)-k) >= 10^(n-1)+k, n>0, 0<=k
a(A000217(n)-1) = 10^(n-1)+2, n>3, provided 10^(n-1)+1 is not a prime (which is proved to be true for all n-1 <= 50000 (cf. A185121) except n-1=16384 and is generally true for n-1 unequal to a power of 2).
a(A000217(n)-k) = 10^(n-1)+p, where p is the minimal number such that 10^(n-1) + p, has k prime substrings, n>0, 0<=k
Min(a(A000217(n)-k-i), 0<=i<=m) <= 10^(n-1)+p, where p is the minimal number with k prime substrings and m is the number of digits of p, and k+m
Min(a(A000217(n)-k-i), 0<=i<=A055642(A035244(k)) <= 10^(n-1)+A035244(k).
a(A000217(n)-k) <= 10^(n-1)+max(p(i), k<=i<=k+m), where p(i) is the minimal number with i prime substrings and m is the number of digits of p(i), and k+m
a(A000217(n)-k) <= 10^(n-1)+max(A035244(i), k<=i<=k+ A055642(i).
a(n) <= A213305(n).

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

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).
		

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

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).
		

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.

A217112 Greatest 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, 3, 7, 6, 15, 14, 31, 29, 30, 63, 61, 62, 127, 54, 125, 126, 255, 117, 251, 254, 189, 511, 479, 509, 510, 379, 502, 1023, 1021, 1007, 1022, 958, 1018, 1014, 2047, 2045, 1791, 2046, 2042, 2027, 2037, 4091, 4095, 4063, 3069, 4094, 4090, 4085, 8159, 8187, 8191, 8189, 8127
Offset: 1

Author

Hieronymus Fischer, Dec 20 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.
The set of numbers with n nonprime substrings is finite. Proof: Evidently, each 1-digit binary number represents 1 nonprime substring. Hence, each (n+1)-digit number has at least n+1 nonprime substrings. Consequently, there is a boundary b < 2^n, such that all numbers > b have more than n nonprime substrings.

Examples

			(1) = 1, since 1 = 1_2 (binary) is the greatest number with 1 nonprime substring.
a(2) = 3 = 11_2 has 3 substrings in binary representation (1, 1 and 11), two of them are nonprime substrings (1 and 1), and 11_2 = 3 is the only prime substrings. 3 is the greatest number with 2 nonprime substrings.
a(8) = 29 = 11101_2 has 15 substrings in binary representation (0, 1, 1, 1, 1, 11, 11, 10, 01, 111, 110, 101, 1110, 1101, 11101), exactly 8 of them are nonprime substrings (0, 1, 1, 1, 1, 01, 110, 1110). There is no greater number with 8 nonprime substrings in binary representation.
a(14) = 54 = 110110_2 has 21 substrings in binary representation, only 7 of them are prime substrings (10, 10, 11, 11, 101, 1011, 1101), which implies that exactly 14 substrings must be nonprime. There is no greater number with 14 nonprime substrings in binary representation.
		

Formula

a(n) >= A217102(n).
a(n) >= A217302(A000217(A070939(a(n)))-n).
Example: a(9)=30=11110_2, A000217(A070939(31))=15, hence, a(9)>=A217302(15-9)=27.
a(n) <= 2^n.
a(n) <= 2^min(6 + n/6, 20*floor((n+125)/126)).
a(n) <= 64*2^(n/6).
With m := floor(log_2(a(n))) + 1:
a(n+m+1) >= 2*a(n), if a(n) is even.
a(n+m) >= 2*a(n), if a(n) is odd.
Showing 1-10 of 48 results. Next