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

A069489 Primes > 1000 in which every substring of length 3 is also prime.

Original entry on oeis.org

1013, 1019, 1031, 1097, 1277, 1373, 1499, 1571, 1733, 1811, 1997, 2113, 2239, 2293, 2719, 3079, 3137, 3313, 3373, 3491, 3499, 3593, 3673, 3677, 3733, 3739, 3797, 4013, 4019, 4211, 4337, 4397, 4673, 4877, 4919, 5233, 5419, 5479, 6011, 6073, 6079, 6131
Offset: 1

Views

Author

Amarnath Murthy, Mar 30 2002

Keywords

Comments

Minimum number of digits is taken to be 4 as all 3-digit primes would be trivial members.
Zero may occur only as second digit from left. - Zak Seidov, Dec 28 2020
All the digits after the two first digits from left are necessarily odd. - Bernard Schott, Mar 20 2022

Examples

			11317 is a term as the three substrings of length 3 i.e. 113,131 and 317 all are primes.
		

Crossrefs

Programs

  • Haskell
    a069489 n = a069489_list !! (n-1)
    a069489_list = filter g $ dropWhile (<= 1000) a000040_list where
       g x = x < 100 || a010051 (x `mod` 1000) == 1 && g (x `div` 10)
    -- Reinhard Zumkeller, Apr 07 2014
  • Mathematica
    Do[ If[ Union[ PrimeQ[ Map[ FromDigits, Partition[ IntegerDigits[ Prime[n]], 3, 1]]]] == {True}, Print[ Prime[n]]], {n, PrimePi[1000] + 1, 10^3}]
    Select[Prime[Range[169,800]],AllTrue[FromDigits/@Partition[ IntegerDigits[ #],3,1], PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 05 2019 *)

Extensions

Edited, corrected and extended by Robert G. Wilson v, Apr 12 2002

A069488 Primes > 100 in which every substring of length 2 is also prime.

Original entry on oeis.org

113, 131, 137, 173, 179, 197, 311, 313, 317, 373, 379, 419, 431, 479, 613, 617, 619, 673, 719, 797, 971, 1117, 1171, 1319, 1373, 1973, 1979, 2311, 2371, 2971, 3119, 3137, 3719, 3797, 4111, 4373, 6113, 6131, 6173, 6197, 6719, 6737
Offset: 1

Views

Author

Amarnath Murthy, Mar 30 2002

Keywords

Comments

Minimum number of digits is taken to be 3 as all two-digit primes would be trivial members.
From Robert G. Wilson v, May 12 2014: (Start)
The number of terms below 10^n: 0, 0, 21, 46, 123, 329, 810, 1733, 3985, 9710, ..., .
The least term with n digits is: 113, 1117, 11113, 111119, ..., see A090534.
The largest term with n digits is: 971, 9719, 97973, 979717, ..., see A242377.
The digits 2, 4, 5, 6 and 8 can only appear at the beginning of the prime and the digit 0 never appears. But the digits 1, 3, 7 and 9 can appear anywhere, yet only 1,1 can appear as a pair.
\10^n
d\ 1&2 3 4 5 6 7 8 9 10 Total % @ 10^10
\
1 0 19 34 146 648 1162 2678 8037 22740 39.188034
2 0 0 3 6 27 18 66 175 449 0.816186
3 0 14 19 63 326 712 1526 3855 11040 19.403018
4 0 3 2 13 54 92 143 384 1031 1.895550
5 0 0 0 9 17 24 45 176 426 0.763995
6 0 4 6 4 24 66 146 233 630 1.224834
7 0 14 20 100 436 907 1980 5442 15421 26.875285
8 0 0 3 6 24 25 37 176 388 0.721797
9 0 9 13 38 157 361 763 1790 5125 9.111301
Total 0 63 100 385 1713 3367 7384 20268 57250 100.00000
(End)

Examples

			3719 is a term as the three substrings of length 2, i.e., 37, 71 and 19, are all prime.
		

Crossrefs

Cf. A069489 and A069490.
Cf. A010051, subsequence of zeroless primes: A038618.

Programs

  • Haskell
    a069488 n = a069488_list !! (n-1)
    a069488_list = filter f $ dropWhile (<= 100) a038618_list where
       f x = x < 10 || a010051 (x `mod` 100) == 1 && f (x `div` 10)
    -- Reinhard Zumkeller, Apr 07 2014
  • Mathematica
    Do[ If[ Union[ PrimeQ[ Map[ FromDigits, Partition[ IntegerDigits[ Prime[n]], 2, 1]]]] == {True}, Print[ Prime[n]]], {n, PrimePi[100] + 1, 500}]

Extensions

Edited, corrected and extended by Robert G. Wilson v, Apr 12 2002

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