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

A178597 Where records occur in A039996.

Original entry on oeis.org

1, 6, 9, 30, 33, 203, 220, 1368, 2638, 10561, 10726, 18926, 86693, 101294, 170447, 734638, 749502, 1503095, 3131428, 6504583, 27508889, 56295291, 66084700, 98097954
Offset: 1

Views

Author

Zak Seidov, May 30 2010

Keywords

Examples

			a(17)=749502 because prime(749502)=11373379, and
there are A178596(17)=20 primes embedded in 11373379:
{3, 7, 11, 13, 17, 31, 71, 79, 97, 113, 131, 179, 317, 797, 971, 11317, 17971, 131797, 317971, 1317971}.
		

Crossrefs

Extensions

a(18)-a(24) from Donovan Johnson, Jun 10 2010

A178596 Records in A039996.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 23, 25, 26, 27, 28, 29
Offset: 1

Views

Author

Zak Seidov, May 30 2010

Keywords

Examples

			a(17)=20 because A178597(17)=749502, prime(749502)=11373379, and there are 20 primes embedded in 11373379: {3, 7, 11, 13, 17, 31, 71, 79, 97, 113, 131, 179, 317, 797, 971, 11317, 17971, 131797, 317971, 1317971}.
		

Crossrefs

Extensions

a(18)-a(24) from Donovan Johnson, Jun 10 2010

A179908 First appearance of n in A039996: Primes embedded in prime(n).

Original entry on oeis.org

1, 6, 9, 30, 33, 203, 270, 220, 1476, 1368, 2638, 10561, 10726, 18926, 87984, 86693, 101294, 170447, 734638, 749502, 1503095, 6475615, 3131428, 7364000, 6504583, 27508889, 56295291, 66084700, 98097954
Offset: 1

Views

Author

Robert G. Wilson v, Aug 01 2010

Keywords

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 < 2*10^9, a = f@p; If[ t[[a]] == 0, pp = PrimePi@p; t[[a]] = pp; Print[{a, p, pp}]]; p = NextPrime@p]; t

A046034 Numbers whose digits are primes.

Original entry on oeis.org

2, 3, 5, 7, 22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 222, 223, 225, 227, 232, 233, 235, 237, 252, 253, 255, 257, 272, 273, 275, 277, 322, 323, 325, 327, 332, 333, 335, 337, 352, 353, 355, 357, 372, 373, 375, 377, 522, 523, 525, 527, 532
Offset: 1

Views

Author

Keywords

Comments

If n is represented as a zerofree base-4 number (see A084544) according to n=d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n) = Sum_{j=0..m} c(d(j))*10^j, where c(k)=2,3,5,7 for k=1..4. - Hieronymus Fischer, May 30 2012
According to A153025, it seems that 5, 235 and 72335 are the only terms whose square is also a term, i.e., which are also in the sequence A275971 of square roots of the terms which are squares, listed in A191486. - M. F. Hasler, Sep 16 2016

Examples

			a(100)   = 2277,
a(10^3)  = 55327,
a(9881)  = 3233232,
a(10^4)  = 3235757,
a(10922) = 3333333,
a(10^5)  = 227233257.
		

Crossrefs

Programs

  • Haskell
    a046034 n = a046034_list !! (n-1)
    a046034_list = filter (all (`elem` "2357") . show ) [0..]
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Magma
    [n: n in [2..532] | Set(Intseq(n)) subset [2, 3, 5, 7]];  // Bruno Berselli, Jul 19 2011
    
  • Mathematica
    Table[FromDigits /@ Tuples[{2, 3, 5, 7}, n], {n, 3}] // Flatten (* Michael De Vlieger, Sep 19 2016 *)
  • PARI
    is_A046034(n)=Set(isprime(digits(n)))==[1] \\ M. F. Hasler, Oct 12 2013
    
  • Python
    def A046034(n):
        m = (3*n+1).bit_length()-1>>1
        return int(''.join(('2357'[(3*n+1-(1<<(m<<1)))//(3<<((m-1-j)<<1))&3] for j in range(m)))) # Chai Wah Wu, Feb 08 2023

Formula

A055642(a(n)) = A193238(a(n)). - Reinhard Zumkeller, Jul 19 2011
From Hieronymus Fischer, Apr 20, May 30 and Jun 25 2012: (Start)
a(n) = Sum_{j=0..m-1} ((2*b(j)+1) mod 8 + floor(b(j)/4) - floor((b(j)-1)/4))*10^j, where m = floor(log_4(3*n+1)), b(j) = floor((3*n+1-4^m)/(3*4^j)).
a(n) = Sum_{j=0..m-1} A010877(A005408(b(j)) + A002265(b(j)) - A002265(b(j)-1))*10^j.
Special values:
a(1*(4^n-1)/3) = 2*(10^n-1)/9.
a(2*(4^n-1)/3) = 1*(10^n-1)/3.
a(3*(4^n-1)/3) = 5*(10^n-1)/9.
a(4*(4^n-1)/3) = 7*(10^n-1)/9.
Inequalities:
a(n) <= 2*(10^log_4(3*n+1)-1)/9, equality holds for n = (4^k-1)/3, k>0.
a(n) <= 2*A084544(n), equality holds iff all digits of A084544(n) are 1.
a(n) > A084544(n).
Lower and upper limits:
lim inf a(n)/10^log_4(n) = (7/90)*10^log_4(3) = 0.48232167706987..., for n -> oo.
lim sup a(n)/10^log_4(n) = (2/9)*10^log_4(3) = 1.378061934485343..., for n -> oo.
where 10^log_4(n) = n^1.66096404744...
G.f.: g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(2 + z(j) + 2*z(j)^2 + 2*z(j)^3 - 7*z(j)^4)/(1-z(j)^4), where z(j) = x^4^j.
Also g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(1-z(j))*(2 + 3*z(j) + 5*z(j)^2 + 7*z(j)^3)/(1-z(j)^4), where z(j)=x^4^j.
Also: g(x) = (1/(1-x))*(2*h_(4,0)(x) + h_(4,1)(x) + 2*h_(4,2)(x) + 2*h_(4,3)(x) - 7*h_(4,4)(x)), where h_(4,k)(x) = Sum_{j>=0} 10^j*x^((4^(j+1)-1)/3)*x^(k*4^j)/(1-x^4^(j+1)). (End)
Sum_{n>=1} 1/a(n) = 1.857333779940977502574887651449435985318556794733869779170825138954093657197... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 15 2024

Extensions

More terms from Cino Hilliard, Aug 06 2006
Typo in second formula corrected by Hieronymus Fischer, May 12 2012
Two typos in example section corrected by Hieronymus Fischer, May 30 2012

A211681 Numbers such that all the substrings of length <= 2 are primes.

Original entry on oeis.org

2, 3, 5, 7, 23, 37, 53, 73, 237, 373, 537, 737, 2373, 3737, 5373, 7373, 23737, 37373, 53737, 73737, 237373, 373737, 537373, 737373, 2373737, 3737373, 5373737, 7373737, 23737373, 37373737, 53737373, 73737373, 237373737, 373737373, 537373737, 737373737
Offset: 1

Views

Author

Hieronymus Fischer, Apr 30 2012

Keywords

Comments

The terms are primes for n = 1, 2, 3, 4, 5, 6, 7, 8, 10, 21, 23, 27, 31, 43, 45, 60, 67, 82, 91, .... The further terms until index 102 are composite. For the subsequence with prime terms see A211682. - [updated by Hieronymus Fischer, Oct 02 2018]
From Hieronymus Fischer, Oct 02 2018: (Start)
For indices n > 8, prime terms satisfy n mod 24 = 1, 3, 5, 7, 10, 12, 19, 21, 23. However, this condition is not sufficient. Indeed, for n <= 200 most of those terms are proven composite unless the terms with n = 103, 106, 123, 156, 165, 175, 178, 191, 193 and 195 which are potentially prime.
The terms are composite for n > 10 and n mod 24 = 0, 2, 4, 6, 8, 9, 11, 13, 14, 15, 16, 17, 18, 20, 22 (see formula section for the details).
(End)
Cf. A213299 for the partial sums.

Examples

			a(11)=537, since all substrings of length <= 2 are primes (5, 3, 7, 53 and 37).
a(21)=237373, the substrings of length <= 2 are 2, 3, 7, 23, 37, 73.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits/@Select[Tuples[{2,3,5,7},n],AllTrue[FromDigits/@ Partition[ #,2,1],PrimeQ]&],{n,9}]//Flatten (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 13 2020 *)

Formula

a(1+8*k) = 2*10^(2k) + 37*(10^(2k)-1)/99,
a(2+8*k) = 3*10^(2k) + 73*(10^(2k)-1)/99,
a(3+8*k) = 5*10^(2k) + 37*(10^(2k)-1)/99,
a(4+8*k) = 7*10^(2k) + 37*(10^(2k)-1)/99,
a(5+8*k) = 23*10^(2k) + 73*(10^(2k)-1)/99,
a(6+8*k) = 37*10^(2k) + 37*(10^(2k)-1)/99,
a(7+8*k) = 53*10^(2k) + 73*(10^(2k)-1)/99,
a(8+8*k) = 73*10^(2k) + 73*(10^(2k)-1)/99, for k >= 0.
a(n) = ((2*n+7) mod 8 + dn3 - dn2)*10^dn_1 + floor((37+36*(dn2-dn1))*10^dn_1/99), where dn1 = floor((n+1)/4), dn2 = floor((n+2)/4), dn3 = floor((n+3)/4), dn_1 = floor((n-1)/4). [updated by Hieronymus Fischer, Oct 02 2018]
From Hieronymus Fischer, Oct 02 2018: (Start)
a(24k + 0) = 73*(10^(6k-2) + (10^(6k-2)-1)/99), for k > 0.
a(24k + 2) = 3*(1245790*(10^(6k)-1)/999999 + 1),
a(24k + 4) = 7*(1053390*(10^(6k)-1)/999999 + 1),
a(24k + 6) = 37*(10^(6k) + (10^(6k)-1)/99),
a(24k + 8) = 73*(10^(6k) + (10^(6k)-1)/99),
a(24k + 9) = 3*(79124500*(10^(6k)-1)/999999 + 79),
a(24k + 11) = 3*(79124500*(10^(6k)-1)/999999 + 79 + 10^(6k+2)),
a(24k + 13) = 3*(791245000*(10^(6k)-1)/999999 + 791),
a(24k + 14) = 37*(10^(6k+2) + (10^(6k+2)-1)/99),
a(24k + 15) = 3*(791245000*(10^(6k)-1)/999999 + 791 + 10^(6k+3)),
a(24k + 16) = 73*(10^(6k+2) + (10^(6k+2)-1)/99),
a(24k + 17) = 7*(3391050000*(10^(6k)-1)/999999 + 3391),
a(24k + 18) = 7*(5339100000*(10^(6k)-1)/999999 + 5339),
a(24k + 20) = 3*(24579100000*(10^(6k)-1)/999999 + 24579),
a(24k + 22) = 37*(10^(6k+4) + (10^(6k+4)-1)/99), for k >= 0.
(End)
Recursion for n>8:
a(n) = 10*(1+a(n-4)) - a(n-4) mod 10.
G.f.: (2*x*(1+x^10) + 3*x^2*(1 + x^3 + x^5 + x^6) + 5*x^3*(1+x^6) + 7*x^4*(1+x^2))/((1-10*x^4)*(1-x^8)). [corrected by Hieronymus Fischer, Sep 03 2012]
From Chai Wah Wu, Feb 08 2023: (Start)
a(n) = a(n-1) + 9*a(n-4) - 9*a(n-5) + 10*a(n-8) - 10*a(n-9) for n > 9.
G.f.: x*(2*x^7 - 2*x^6 + 5*x^5 - 2*x^4 + 2*x^3 + 2*x^2 + x + 2)/((x - 1)*(x^4 + 1)*(10*x^4 - 1)). (End)

A211684 Numbers > 1000 such that all the substrings of length = 3 are primes (substrings with leading '0' are considered to be nonprime).

Original entry on oeis.org

1131, 1137, 1139, 1271, 1277, 1311, 1313, 1317, 1373, 1379, 1397, 1491, 1499, 1571, 1577, 1631, 1673, 1677, 1733, 1739, 1797, 1811, 1911, 1919, 1937, 1971, 1977, 1991, 1997, 2113, 2233, 2239, 2271, 2277, 2293, 2331, 2337, 2397, 2419, 2571
Offset: 1

Views

Author

Hieronymus Fischer, Jun 08 2012

Keywords

Comments

Only numbers > 1000 are considered, since all 3-digit primes are trivial members. See A069489 for the sequence with prime terms > 1000.
The sequence is infinite (for example, consider the continued concatenation of '19' or of '337': 1919, 19191, 191919, ..., 3373, 33733, 337337, ... are members).
Infinitely many terms are palindromic.
A 10-automatic sequence realized by a linear recurrence relation. - Charles R Greathouse IV, Jan 04 2013

Examples

			a(1) = 1131, since all substrings of length = 3 (113 and 131) are primes.
a(33) = 2271, since all substrings of length = 3 (227, 271) are primes.
		

Crossrefs

A211685 Prime numbers > 1000 such that all the substrings of length >= 3 are primes (substrings with leading '0' are considered to be nonprime).

Original entry on oeis.org

1277, 1373, 1499, 1571, 1733, 1811, 1997, 2113, 2239, 2293, 2719, 3137, 3313, 3373, 3491, 3499, 3593, 3673, 3677, 3733, 3739, 3797, 4211, 4337, 4397, 4673, 4877, 4919, 5233, 5419, 5479, 6131, 6173, 6197, 6199, 6311, 6317, 6599, 6619, 6733
Offset: 1

Views

Author

Hieronymus Fischer, Jun 08 2012

Keywords

Comments

Only numbers > 1000 are considered, since all 3-digit primes are trivial members.
By definition, each term of the sequence with more than 4 digits is built up by an overlapped union of previous terms, i.e., a(59)=33739 has the two embedded previous terms a(14)=3373 and a(21)=3739.
The sequence is finite, the last term is 349199 (n=63). Proof of finiteness: Let p be a number with more than 6 digits. By the argument above, each 6-digit substring of p must be a previous term. The only 6-digit term is 349199. Thus, there is no number p with the desired property.

Examples

			a(1)=1277, since all substrings of length >= 3 are primes (127, 277, and 1277).
a(63)=349199, all substrings of length >= 3 (349, 491, 919, 199, 3491, 4919, 9199, 34919, 49199 and 349199) are primes.
		

Crossrefs

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.

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
Showing 1-10 of 73 results. Next