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-5 of 5 results.

A068669 Noncomposite numbers in which every substring is noncomposite.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 71, 73, 113, 131, 137, 173, 311, 313, 317, 373, 1373, 3137
Offset: 1

Views

Author

Amarnath Murthy, Mar 02 2002

Keywords

Comments

It is easy to see that this sequence is complete - the only potential 5-digit candidate 31373 is not prime. - Tanya Khovanova, Dec 09 2006

Examples

			137 is a member as all the substrings, i.e. 1, 3, 7, 13, 37, 137, are noncomposite.
All substrings of 3137 are noncomposite numbers: 1, 3, 7, 13, 37, 137, 313, 3137. - _Jaroslav Krizek_, Dec 25 2011
		

Crossrefs

Programs

  • Mathematica
    noncompositeQ[n_] := n == 1 || PrimeQ[n]; Reap[ Do[ id = IntegerDigits[n]; lid = Length[id]; test = And @@ noncompositeQ /@ FromDigits[#, 10]& /@ Flatten[ Table[ Take[id, {i, j}], {i, 1, lid}, {j, i, lid}], 1]; If[test, Sow[n]], {n, Join[{1}, Prime /@ Range[10000]]}]][[2, 1]](* Jean-François Alcover, May 09 2012 *)

Extensions

1 added following a redefinition by Jaroslav Krizek. - R. J. Mathar, Jan 20 2012

A143390 Numbers in which every suffix (in base 10) is 1 or a prime.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 23, 31, 37, 41, 43, 47, 53, 61, 67, 71, 73, 83, 97, 101, 103, 107, 113, 131, 137, 167, 173, 197, 211, 223, 241, 271, 283, 307, 311, 313, 317, 331, 337, 347, 353, 367, 373, 383, 397, 401, 431, 443, 461, 467, 503, 523, 541, 547, 571, 601
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 13 2008

Keywords

Comments

Subsequence of A042986 apart from first term; a(n+1)=A042986(n) for n<25.

Crossrefs

Programs

  • Mathematica
    prQ[n_] := n == 1 || PrimeQ[n];
    okQ[n_] := Module[{dd = IntegerDigits[n]}, AllTrue[Range[Length[dd]-1], prQ@ FromDigits@ Drop[dd, #]&]];
    {1}~Join~Select[ Prime@Range[1000], okQ] (* Jean-François Alcover, Nov 20 2019 *)
  • PARI
    is(n)=my(d=digits(n,10)); for(i=1,#d-1, if(!isprime(fromdigits(d[i..#d],10)), return(0))); isprime(d[#d]) || d[#d]==1 \\ Charles R Greathouse IV, Nov 26 2016

A160337 1 plus primes using only digits {0, 1, 2, 3, 5, 7}.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 71, 73, 101, 103, 107, 113, 127, 131, 137, 151, 157, 173, 211, 223, 227, 233, 251, 257, 271, 277, 307, 311, 313, 317, 331, 337, 353, 373, 503, 521, 523, 557, 571, 577, 701, 727, 733, 751, 757, 773, 1013, 1021, 1031
Offset: 1

Views

Author

Mohit Singh Kanwal (mohit_kanwal(AT)hotmail.com), May 10 2009

Keywords

Crossrefs

Programs

  • Python
    from sympy import isprime
    def ok(n): return n == 1 or (set(str(n)) <= set("012357") and isprime(n))
    print([m for m in range(1032) if ok(m)]) # Michael S. Branicky, Jan 25 2021

A168167 Numbers with d digits (d>0) which have at least 2d distinct primes as substrings.

Original entry on oeis.org

1373, 3137, 3797, 5237, 6173, 11317, 11373, 13733, 13739, 13797, 17331, 19739, 19973, 21137, 21317, 21373, 21379, 22397, 22937, 23117, 23137, 23173, 23371, 23373, 23719, 23797, 23971, 24373, 26173, 26317, 27193, 27197, 29173, 29537
Offset: 1

Views

Author

M. F. Hasler, Nov 28 2009

Keywords

Comments

"Substrings" includes the whole number in itself.
The terms up to 11317 are primes themselves. The subsequence A168169 lists primes which have more than 2d prime substrings.
From Robert Israel, Nov 11 2020: (Start)
Palindromes in the sequence include 1337331, 1375731, and 1793971.
Even numbers in the sequence include 313732, 313792 and 1131712. (End)

Examples

			The least number with d digits to have 2d distinct prime substrings is a(1)=1373, with 4 digits and #{3, 7, 13, 37, 73, 137, 373, 1373} = 8.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local i,j,count,d,S,x,y;
      d:= ilog10(n)+1;
      count:= 0; S:= {};
      for i from 0 to d-1 do
        x:= floor(n/10^i);
        for j from i to d-1 do
          y:= x mod 10^(j-i+1);
          if not member(y,S) and isprime(y) then count:= count+1; S:= S union {y}; if count = 2*d then return true fi fi
      od od;
      false
    end proc:
    select(filter, [$10..10^5]); # Robert Israel, Nov 11 2020
  • PARI
    {for( p=1, 1e6, #prime_substrings(p) >= #Str(p)*2 & print1(p", "))} /* see A168168 for prime_substrings() */

A168169 Primes with d digits (d>0) which have more than 2d distinct primes as substrings.

Original entry on oeis.org

23719, 31379, 52379, 113171, 113173, 113797, 123719, 153137, 179719, 199739, 211373, 213173, 229373, 231197, 231379, 233113, 233713, 236779, 237331, 237619, 237971, 241973, 259397, 291373, 313739, 317971, 327193, 337397, 343373, 353173
Offset: 1

Views

Author

M. F. Hasler, Nov 28 2009

Keywords

Comments

"Substrings" includes the whole number in itself.
This is a subsequence of A168167.
The least palindrome in this sequence is 9179719.

Examples

			The least number with d digits to have over 2d distinct prime substrings is the prime a(1)=23719, with 5 digits and #{2, 3, 7, 19, 23, 37, 71, 719, 2371, 3719, 23719} = 11.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local i,j,count,d,S,x,y;
      if not isprime(n) then return false fi;
      d:= ilog10(n)+1;
      count:= 0; S:= {};
      for i from 0 to d-1 do
        x:= floor(n/10^i);
        for j from i to d-1 do
          y:= x mod 10^(j-i+1);
          if not member(y,S) and isprime(y) then count:= count+1; S:= S union {y}; if count > 2*d then return true fi fi
      od od;
      false
    end proc:
    select(filter, [seq(i,i=1..10^6,2)]); # Robert Israel, Nov 11 2020
  • PARI
    {forprime( p=1, default(primelimit), #prime_substrings(p) > #Str(p)*2 & print1(p", "))} /* see A168168 for prime_substrings() */
Showing 1-5 of 5 results.