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

A051362 Primes remaining prime if any digit is deleted (zeros allowed).

Original entry on oeis.org

23, 37, 53, 73, 113, 131, 137, 173, 179, 197, 311, 317, 431, 617, 719, 1013, 1031, 1097, 1499, 1997, 2239, 2293, 3137, 4019, 4919, 6173, 7019, 7433, 9677, 10193, 10613, 11093, 19973, 23833, 26833, 30011, 37019, 40013, 47933, 73331, 74177
Offset: 1

Views

Author

Harvey P. Dale, May 31 2000

Keywords

Comments

These might be called "super-prime numbers". - Jaime Gutierrez (jgutierrez(AT)matematicas.net), Sep 27 2007
A proper subset of A034895. - Robert G. Wilson v, Oct 12 2014
The largest known number in this sequence is a 274-digit prime consisting of 163 4s, followed by 80 0s, followed by 31 1s. See the CodeGolf link. - Dmitry Kamenetsky, Feb 26 2021

Crossrefs

Programs

  • Haskell
    import Data.List (inits, tails)
    a051362 n = a051362_list !! (n-1)
    a051362_list = filter p $ drop 4 a000040_list where
       p x = all (== 1) $ map (a010051 . read) $
                 zipWith (++) (inits $ show x) (tail $ tails $ show x)
    -- Reinhard Zumkeller, Dec 17 2011, Aug 24 2011
    
  • Mathematica
    rpQ[n_]:=Module[{idn=IntegerDigits[n]},And@@PrimeQ[FromDigits/@ Subsets[ IntegerDigits[ n],{Length[idn]-1}]]]; Select[Prime[Range[40000]], rpQ]
    prpQ[n_]:=AllTrue[FromDigits/@Table[Delete[IntegerDigits[n],d],{d,IntegerLength[ n]}],PrimeQ]; Select[Prime[Range[7500]],prpQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 27 2020 *)
  • PARI
    is(n)=my(v=Vec(Str(n)),k);for(i=1, #v, k=eval(concat(vecextract(v, 2^#v-1-2^(i-1))));if(!isprime(k),return(0)));isprime(n) \\ Charles R Greathouse IV, Oct 05 2011
    
  • Python
    from sympy import isprime
    def ok(n):
        if n < 10 or not isprime(n): return False
        s = str(n)
        return all(isprime(int(s[:i]+s[i+1:])) for i in range(len(s)))
    print([k for k in range(10**5) if ok(k)]) # Michael S. Branicky, Nov 02 2023
  • Sage
    def is_A051362(n):
        prime = is_prime(n)
        if prime:
            L = ZZ(n).digits(10)
            for k in range(len(L)):
                K = L[:]; del K[k]
                prime = is_prime(ZZ(K, base=10))
                if not prime: break
        return prime
    A051362_list = lambda n: filter(is_A051362, range(n))
    A051362_list(77777) # Peter Luschny, Jul 17 2014
    

A092624 Numbers with exactly two prime digits.

Original entry on oeis.org

22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 122, 123, 125, 127, 132, 133, 135, 137, 152, 153, 155, 157, 172, 173, 175, 177, 202, 203, 205, 207, 212, 213, 215, 217, 220, 221, 224, 226, 228, 229, 230, 231, 234, 236, 238, 239, 242, 243, 245
Offset: 1

Views

Author

Jani Melik, Apr 11 2004

Keywords

Comments

A193238(a(n))=2; subsequence of A118950. [Reinhard Zumkeller, Jul 19 2011]

Examples

			25 has two prime digits, 2 and 5;
207 has two prime digits, 2 and 7.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a092624 n = a092624_list !! (n-1)
    a092624_list = elemIndices 2 a193238_list
    -- Reinhard Zumkeller, Jul 19 2011
  • Maple
    stev_sez:=proc(n) local i, tren, st, ans, anstren; ans:=[ ]: anstren:=[ ]: tren:=n: for i while (tren>0) do st:=round( 10*frac(tren/10) ): ans:=[ op(ans), st ]: tren:=trunc(tren/10): end do; for i from nops(ans) to 1 by -1 do anstren:=[ op(anstren), op(i,ans) ]; od; RETURN(anstren); end: ts_stpf:=proc(n) local i, stpf, ans; ans:=stev_sez(n): stpf:=0: for i from 1 to nops(ans) do if (isprime(op(i,ans))='true') then stpf:=stpf+1; # number of prime digits fi od; RETURN(stpf) end: ts_pr_nd:=proc(n) local i, stpf, ans, ans1, tren; ans:=[ ]: stpf:=0: tren:=1: for i from 1 to n do if ( ts_stpf(i) = 2) then ans:=[ op(ans), i ]: tren:=tren+1; fi od; RETURN(ans) end: ts_pr_nd(500);
  • Mathematica
    Select[Range[300],Count[IntegerDigits[#],?PrimeQ]==2&] (* _Harvey P. Dale, Apr 20 2025 *)

A092625 Numbers with exactly three prime digits.

Original entry on oeis.org

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, 533, 535, 537, 552, 553, 555, 557, 572, 573, 575, 577, 722, 723, 725
Offset: 1

Views

Author

Jani Melik, Apr 11 2004

Keywords

Comments

It is the same as A046034 from two digit numbers from 22 up to four digit numbers from 1222.
A193238(a(n))=3; subsequence of A118950. [Reinhard Zumkeller, Jul 19 2011]

Examples

			222 has three prime digits, three times 2;
1235 has three prime digits, 2, 3 and 5.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a092625 n = a092625_list !! (n-1)
    a092625_list = elemIndices 3 a193238_list
    -- Reinhard Zumkeller, Jul 19 2011
  • Maple
    stev_sez:=proc(n) local i, tren, st, ans, anstren; ans:=[ ]: anstren:=[ ]: tren:=n: for i while (tren>0) do st:=round( 10*frac(tren/10) ): ans:=[ op(ans), st ]: tren:=trunc(tren/10): end do; for i from nops(ans) to 1 by -1 do anstren:=[ op(anstren), op(i,ans) ]; od; RETURN(anstren); end: ts_stpf:=proc(n) local i, stpf, ans; ans:=stev_sez(n): stpf:=0: for i from 1 to nops(ans) do if (isprime(op(i,ans))='true') then stpf:=stpf+1; # number of prime digits fi od; RETURN(stpf) end: ts_pr_nt:=proc(n) local i, stpf, ans, ans1, tren; ans:=[ ]: stpf:=0: tren:=1: for i from 1 to n do if ( ts_stpf(i) = 3) then ans:=[ op(ans), i ]: tren:=tren+1; fi od; RETURN(ans) end: ts_pr_nt(2000);
  • Mathematica
    Select[Range[800],Total[Boole[PrimeQ[IntegerDigits[#]]]]==3&] (* Harvey P. Dale, Dec 31 2023 *)

A076979 Deleting exactly one digit yields a prime.

Original entry on oeis.org

12, 13, 15, 17, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 45, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 65, 67, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 82, 83, 85, 87, 92, 93, 95, 97, 101, 102, 103, 105
Offset: 1

Views

Author

Amarnath Murthy, Oct 23 2002

Keywords

Crossrefs

Cf. A034895.

Programs

  • PARI
    isok(n)={my(b=1); while(b<=n && !isprime(n%b + n\b\10*b), b*=10); b<=n} \\ Andrew Howroyd, Dec 10 2024

A178423 Semiprimes for which dropping any digit gives a prime number.

Original entry on oeis.org

22, 25, 33, 35, 55, 57, 77, 111, 119, 371, 411, 413, 417, 437, 471, 473, 611, 671, 713, 731, 1037, 1073, 1079, 1379, 1397, 1673, 1739, 1937, 1991, 2571, 2577, 2811, 3113, 3131, 3173, 3317, 4331, 4439, 4499, 4631, 6017, 6431, 6773, 7619, 9977, 12777
Offset: 1

Views

Author

Jonathan Vos Post, May 27 2010

Keywords

Comments

This is the 2nd row of the infinite array A[k,n] = n-th number with k prime factors (not necessarily distinct) for which dropping any digit gives a prime number.
The first row A[1,n] = A051362 = numbers n such that n remains prime if any digit is deleted (zeros allowed).
The 3rd row A[3,n] begins {27 = 3^3, 52 = 2^2 * 13, 75 = 3 * 5^2, 117 = 3^2 * 13, 171 = 3^2 * 19, ...}.
The 4th row A[4,n] begins: {2277 = 3^2 * 11 * 23, 5577 = 3 * 11 * 13^2, 8211 = 3 * 7 * 17 * 23, 8811 = 3^2 * 11 * 89, ...}.
The 5th row A[5,n] begins:{32 = 2^5, 72 = 2^3 x 3^2, ...}.

Examples

			a(9) = 119 because this is a semiprime (119 = 7 * 17), dropping the leftmost digit gives 19 (a prime), dropping the middle digit gives 19 (a prime), and dropping the rightmost digit gives 11 (a prime).
		

Crossrefs

Programs

  • Mathematica
    ddp[n_]:=Module[{idn=IntegerDigits[n]},PrimeOmega[n]==2 && And@@PrimeQ[ FromDigits/@Table[Drop[idn,{i}],{i,Length[idn]}]]]; Select[Range[ 13000],ddp] (* Harvey P. Dale, Apr 10 2012 *)

Formula

A001358 INTERSECTION A034895.

A178755 Integers that become semiprime when any single digit is removed.

Original entry on oeis.org

44, 46, 49, 64, 66, 69, 94, 96, 99, 104, 155, 215, 221, 222, 225, 226, 251, 255, 262, 265, 333, 334, 335, 338, 339, 349, 355, 358, 385, 393, 394, 395, 469, 515, 551, 555, 557, 558, 577, 585, 587, 622, 625, 655, 695, 774, 777, 822, 825, 826, 855, 857, 862, 865
Offset: 1

Views

Author

Jonathan Vos Post, Jun 09 2010

Keywords

Comments

The subsequence of semiprimes begins: 46, 49, 69, 94, 155, 215, 221, 226, 262, 265, 334, 335, 339, 355, 358, 393, 394, 395, 469, 515, 551, 622, 655, 695, 862, 865, 914, 933, 934, 951, 955, 1111, 1115, 1119, 1159, 1219, 1411, 1415, 1466, 2021, 2026, 2062, 2095, 2159, 2899, 2959, 2995, 2998, 3035, 3039, ....
The subsequence of primes begins: 251, 349, 557, 577, 587, 857, 877, 1559, 1669, 4111, 4973, 5051, 5119, 5519, 5591, 6299, 6679, 6871, 6899, 6949, 7213, 7789, 7949, 7993, 8669, 8699, 9133, 9221, 9551, 9749, ....
This is to semiprimes A001358 as A034895 is to primes A000040. Note that this is not a subset of A107342, as there are values with nonsemiprime digits, beginning with 104, 155, 215, 221, 222, ....

Crossrefs

Programs

  • Mathematica
     Select[Range[3000],Union[PrimeOmega[FromDigits/@Subsets[IntegerDigits[#],{IntegerLength[#]-1}]]]=={2}&] (* Harvey P. Dale, Apr 25 2015 *)

Formula

a(10) = 104 because deleting the "1" gives "04" which by OEIS protocol becomes the semiprime 4=2*2; deleting the "0" gives the semiprime 14=2*7; and deleting the "4" gives the semiprime 10=2*5.

Extensions

Extended by Ray Chandler

A267413 Dropping any binary digit gives a prime number.

Original entry on oeis.org

6, 7, 11, 15, 35, 39, 63, 135, 255, 999, 2175, 8223, 16383, 57735, 131075, 131079, 262143, 524295, 1048575, 536870919, 1073735679, 2147483655, 4294967295, 17179770879, 4260641103903, 4611686018427387903, 4720069647059686260735, 1237940039285380274899124223
Offset: 1

Views

Author

Stanislav Sykora, Jan 14 2016

Keywords

Comments

This is the binary analog of A034895. The sequence contains mostly numbers with very few binary digit runs (BDR, A005811). Those with one BDR are of the type 2^k-1, such that 2^(k-1)-1 is a Mersenne prime (A000668). Vice versa, if M is any Mersenne prime, then 2*M+1 is a term. The number 6 is the only term with an even number of BDRs. There are many terms with 3 BDRs. The first term with 5 BDRs is 57735. The next terms with at least 5 BDRs (if they exist at all) are larger than 10^10. So far, I could test that a(24) > 10^10.
From Robert Israel, Jan 14 2016: (Start)
For n >= 2, a(n) == 3 (mod 4).
2^k+3 is in the sequence if 2^(k-1)+1 and 2^(k-1)+3 are primes, i.e., 2^(k-1)+1 is in the intersection of A019434 and A001359. The only known terms of the sequence in this class are 7, 11, 35, 131075.
2^k+7 is in the sequence if 2^(k-1)+3 and 2^(k-1)+7 are primes: thus 2^(k-1)+3 is in A057733 and 2^(k-1)+7 is in A104066. Terms of the sequence in this class include 15, 39, 135, 131079, 524295, 536870919, 2147483655 (but no more for k <= 2000).
(End)
a(25) > 2^38. - Giovanni Resta, Apr 10 2016
For n > 1, a(n) = 2p+1 for some prime p. - Chai Wah Wu, Aug 27 2021
From Bert Dobbelaere, Aug 07 2023: (Start)
There are no more terms with an odd number of binary digits: from any number having an odd number of binary digits, one can always drop a digit and obtain a multiple of 3. Numbers of the form 2^k+3 (k even and k > 2) cannot be terms because 2^(k-1)+1 is a multiple of 3.
(End)

Examples

			Decimal and binary forms of the known terms:
   1           6                                110
   2           7                                111
   3          11                               1011
   4          15                               1111
   5          35                             100011
   6          39                             100111
   7          63                             111111
   8         135                           10000111
   9         255                           11111111
  10         999                         1111100111
  11        2175                       100001111111
  12        8223                     10000000011111
  13       16383                     11111111111111
  14       57735                   1110000110000111 <--- (a binary palindrome
  15      131075                 100000000000000011       with 5 digit runs)
  16      131079                 100000000000000111
  17      262143                 111111111111111111
  18      524295               10000000000000000111
  19     1048575               11111111111111111111
  20   536870919     100000000000000000000000000111
  21  1073735679     111111111111111110011111111111
  22  2147483655   10000000000000000000000000000111
  23  4294967295   11111111111111111111111111111111
  24 17179770879 1111111111111111100111111111111111
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local B,k,y;
       if not isprime(floor(n/2)) then return false fi;
       B:= convert(n,base,2);
       for k from 2 to nops(B) do
         if B[k] <> B[k-1] then
           y:= n mod 2^(k-1);
           if not isprime((y+n-B[k]*2^(k-1))/2) then return false fi
         fi
       od;
       true
    end proc:
    select(filter, [6, seq(i,i=7..10^6,4)]); # Robert Israel, Jan 14 2016
  • Mathematica
    Select[Range[2^20], AllTrue[Function[w, Map[FromDigits[#, 2] &@ Drop[w, {#}] &, Range@ Length@ w]]@ IntegerDigits[#, 2], PrimeQ] &] (* Michael De Vlieger, Jan 16 2016, Version 10 *)
  • PARI
    DroppingAnyDigitGivesAPrime(N,b) = {
    \\ Property-testing function; returns 1 if true for N, 0 otherwise
    \\ Works with any base b. Here used with b=2.
      my(k=b,m); if(N=(k\b), m=(N\k)*(k\b)+(N%(k\b));
        if ((m<2)||(!isprime(m)),return(0)); k*=b);
      return(1);
    }
    
  • Python
    from sympy import isprime
    def ok(n):
        if n < 7 or n%4 != 3: return n == 6
        b = bin(n)[2:]
        return all(isprime(int(b[:i]+b[i+1:], 2)) for i in range(len(b)))
    print(list(filter(ok, range(2, 2**20)))) # Michael S. Branicky, Jun 07 2021

Extensions

a(24) from Giovanni Resta, Apr 10 2016
a(25)-a(28) from Bert Dobbelaere, Aug 07 2023

A335072 Numbers with property that if you remove any digit and subtract 1 the result is prime.

Original entry on oeis.org

33, 34, 36, 38, 43, 44, 46, 48, 63, 64, 66, 68, 83, 84, 86, 88, 124, 142, 144, 148, 184, 204, 244, 308, 320, 380, 424, 442, 444, 448, 484, 544, 608, 620, 680, 724, 742, 744, 804, 844, 908, 980, 1104, 1140, 2284, 2728, 2824, 3608, 3908, 4440, 4444, 4588, 4644
Offset: 1

Views

Author

John Ryder, May 30 2020

Keywords

Examples

			33 is a term: remove any digit to be left with 3. Subtract 1 gives 2, which is prime.
4444 is a term: remove any digit to be left with 444. Subtract 1 to be left with 443, which is prime.
28 is not a term: remove any digit to be left with 2 or 8. Subtract 1 to be left with 1 or 7. 1 is not prime.
		

Crossrefs

Cf. A034895.

Programs

  • Maple
    q:= n-> (s-> andmap(i-> isprime(parse(cat(0,s[1..i-1],
                s[i+1..-1]))-1), [$1..length(s)]))(""||n):
    select(q, [$1..5000])[];  # Alois P. Heinz, May 30 2020
  • Mathematica
    rdpQ[x_]:=AllTrue[FromDigits/@Table[Drop[IntegerDigits[x],{n}],{n,IntegerLength[ x]}]-1,PrimeQ]; Select[Range[4700],rdpQ] (* Harvey P. Dale, Aug 21 2020 *)
Showing 1-8 of 8 results.