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

A039996 Number of distinct primes embedded in prime(n) as substrings.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 1, 3, 2, 2, 3, 1, 2, 2, 3, 2, 1, 2, 2, 3, 2, 2, 1, 2, 1, 2, 2, 1, 4, 3, 4, 5, 3, 1, 2, 3, 2, 3, 5, 4, 1, 2, 3, 4, 2, 3, 4, 3, 3, 4, 4, 3, 3, 4, 3, 2, 4, 3, 2, 4, 4, 3, 4, 4, 5, 3, 4, 4, 2, 4, 4, 4, 5, 5, 3, 3, 4, 1, 1, 3, 2, 4, 3, 3, 3, 1, 3, 2, 2, 3, 4, 2, 1, 1, 3, 2, 3, 5, 3, 4, 3, 3, 2, 4
Offset: 1

Views

Author

Keywords

Examples

			a(26) = 1 since the only prime substring of "101" is 101.
a(48) = 4 since the only distinct prime substrings of "223" are 2, 3, 23, 223. - _David A. Corneth_, Jul 06 2020
		

Crossrefs

Programs

  • Maple
    a:= n-> (s-> nops(select(t -> t[1]<>"0" and isprime(parse(t)),
            {seq(seq(s[i..j], i=1..j), j=1..length(s))})))(""||(ithprime(n))):
    seq(a(n), n=1..105);  # Alois P. Heinz, Jul 29 2025
  • Mathematica
    f[n_] := Block[{id = IntegerDigits@ Prime@n, len = Floor[ Log[10, Prime@n] + 1]}, Count[ PrimeQ@ Union[ FromDigits@# & /@ Flatten[ Table[ Partition[id, k, 1], {k, len}], 1]], True]]; Array[f, 105] (* Robert G. Wilson v, Jun 28 2010 *)
  • PARI
    dp(n)=if(n<12, return(if(isprime(n), [n], []))); my(v=vecsort(select(isprime, eval(Vec(Str(n)))), , 8), t); while(n>9, if(gcd(n%10, 10)>1, n\=10; next); t=10; while((t*=10)Charles R Greathouse IV, Apr 22 2015

Formula

a(n) = A039997(prime(n)).
a(n) <= A039994(n). - Charles R Greathouse IV, Apr 22 2015
a(n) = A079066(n) + 1. - Alois P. Heinz, Jul 29 2025

Extensions

Name corrected by David A. Corneth, Jul 06 2020

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

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

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 &]

A179922 Primes with twelve embedded primes.

Original entry on oeis.org

113171, 113173, 113797, 123719, 153137, 179719, 199739, 213173, 229373, 231197, 233113, 233713, 236779, 237331, 237619, 237971, 241973, 259397, 317971, 327193, 343373, 353173, 361373, 372719, 373379, 382373, 432713, 519733, 521137, 521317
Offset: 1

Views

Author

Robert G. Wilson v, Aug 01 2010

Keywords

Comments

A079066(a(n)) = 12.

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a179922 n = a179922_list !! (n-1)
    a179922_list = map (a000040 . (+ 1)) $ elemIndices 12 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@ 43150, f@# == 13 &]

A179910 Primes with two embedded primes.

Original entry on oeis.org

23, 37, 53, 73, 127, 139, 157, 167, 193, 211, 227, 229, 241, 251, 263, 277, 307, 331, 383, 389, 419, 433, 439, 443, 457, 467, 503, 521, 541, 557, 563, 577, 587, 599, 619, 631, 643, 647, 659, 677, 683, 727, 751, 757, 761, 827, 829, 839, 857, 859, 883, 929
Offset: 1

Views

Author

Robert G. Wilson v, Aug 01 2010

Keywords

Comments

It appears that p having n embedded primes means that the set of prime integers generated by contiguous proper substrings of p has size n.
A079066(a(n)) = 2.

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a179910 n = a179910_list !! (n-1)
    a179910_list = map (a000040 . (+ 1)) $ elemIndices 2 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@ 160, f@# == 3 &]
    Select[ Prime@ Range@ 160, Function[ n, Length@ Select[ Union[ FromDigits /@ (Flatten[ Table[ Partition[#, k, 1], {k, Length@ # - 1}], 1] &)@ IntegerDigits@ n], PrimeQ]]@ # == 2 &] (* Michael Somos, Jan 13 2011 *)

A179911 Primes with three embedded primes.

Original entry on oeis.org

113, 131, 179, 197, 223, 233, 239, 257, 271, 283, 293, 311, 313, 337, 347, 353, 359, 367, 397, 431, 479, 547, 571, 593, 613, 617, 653, 719, 733, 739, 743, 773, 797, 823, 853, 937, 953, 971, 1013, 1031, 1097, 1103, 1117, 1129, 1151, 1163, 1213, 1217, 1229
Offset: 1

Views

Author

Robert G. Wilson v, Aug 01 2010

Keywords

Comments

A079066(a(n)) = 3.

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a179911 n = a179911_list !! (n-1)
    a179911_list = map (a000040 . (+ 1)) $ elemIndices 3 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@ 210, f@# == 4 &]

A179912 Primes with four embedded primes.

Original entry on oeis.org

137, 173, 317, 373, 379, 523, 673, 1123, 1153, 1171, 1193, 1223, 1231, 1277, 1279, 1283, 1297, 1307, 1327, 1531, 1579, 1597, 1613, 1637, 1759, 1783, 1823, 1913, 1931, 2053, 2153, 2333, 2339, 2341, 2351, 2393, 2399, 2411, 2467, 2503, 2539, 2543, 2557
Offset: 1

Views

Author

Robert G. Wilson v, Aug 01 2010

Keywords

Comments

A079066(a(n)) = 4.

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a179912 n = a179912_list !! (n-1)
    a179912_list = map (a000040 . (+ 1)) $ elemIndices 4 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@ 380, f@# == 5 &]

A179913 Primes with five embedded primes.

Original entry on oeis.org

1237, 1319, 1367, 1523, 1571, 1723, 1753, 1979, 1997, 2131, 2179, 2239, 2273, 2293, 2297, 2357, 2377, 2383, 2389, 2417, 2437, 2473, 2531, 2579, 2593, 2617, 2711, 2731, 2753, 2797, 3119, 3167, 3257, 3271, 3313, 3371, 3547, 3571, 3593, 3617, 3671, 3677
Offset: 1

Views

Author

Robert G. Wilson v, Aug 01 2010

Keywords

Comments

A079066(a(n)) = 5.

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a179913 n = a179913_list !! (n-1)
    a179913_list = map (a000040 . (+ 1)) $ elemIndices 5 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@ 510, f@# == 6 &]
Showing 1-10 of 17 results. Next