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

A232125 Smallest prime such that the n numbers obtained by removing 1 digit on the right are also prime, while no digit can be added on the right to get another prime.

Original entry on oeis.org

53, 53, 317, 2393, 23333, 373393, 2399333, 23399339, 1979339333, 103997939939, 4099339193933, 145701173999399393, 2744903797739993993333, 52327811119399399313393, 13302806296379339933399333
Offset: 0

Views

Author

Michel Marcus, Nov 19 2013

Keywords

Comments

Inspired by article on 43 in Archimedes' Lab link.

Examples

			a(0)=53 because 53 is the smallest prime such that all numbers obtained by adding a digit to the right are composite.
a(1)=53 because 5 and 53 are primes.
a(2)=317 because 3, 31, 317 are all primes, and 317 has the same property as 53 when adding a digit to the right.
		

Crossrefs

Programs

  • PARI
    a(n) = {n++; v = vector(n); i = 1; ok = 0; until (ok, while ((i>1) && (v[i] == 9), v[i] = 0; i--); if (i == 1, v[i] = nextprime(v[i]+1), v[i] = v[i]+1); curp = sum (j=1, i, v[j]*(10^(i-j))); if (isprime(curp), if (i != n, i++, nbp = 0; for (z=1, 9, if (isprime(10*curp+z), nbp++);); if (nbp == 0, ok = 1);););); sum (j=1, n, v[j]*(10^(n-j)));}
    
  • Python
    from sympy import isprime, nextprime
    def a(n):
        p, oo = 2, float('inf')
        while True:
            extends, reach, r1 = 0, [str(p)], []
            while len(reach) > 0 and extends <= n:
                minnotext = oo
                for s in reach:
                    wasextended = False
                    for d in "1379":
                        if isprime(int(s+d)): r1.append(s+d); wasextended = True
                    if not wasextended: minnotext = min(minnotext, int(s))
                if extends == n and minnotext < oo: return minnotext
                if len(r1) > 0: extends += 1
                reach, r1 = r1, []
            p = nextprime(p)
    for n in range(12): print(a(n), end=", ") # Michael S. Branicky, Aug 08 2021

Extensions

a(12)-a(13) from Michael S. Branicky, Aug 08 2021
a(14) from Michael S. Branicky, Aug 23 2021

A240678 Primes p such that p*10+k is prime for exactly one value of the digit k.

Original entry on oeis.org

11, 29, 41, 47, 71, 79, 83, 131, 137, 139, 151, 163, 173, 181, 191, 227, 257, 263, 277, 281, 293, 307, 311, 313, 359, 383, 449, 491, 503, 509, 557, 563, 569, 577, 587, 593, 601, 617, 647, 659, 661, 677, 683, 719, 739, 743, 751, 809, 821, 827, 857, 877, 881
Offset: 1

Views

Author

Colin Barker, Apr 10 2014

Keywords

Examples

			11 is in the sequence because 113 is prime, but 111, 117 and 119 are not prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200]],Total[Boole[PrimeQ[10 #+{1,3,7,9}]]]==1&] (* Harvey P. Dale, Apr 19 2019 *)
  • PARI
    forprime(p=2, 1500, t=0; forstep(k=1, 9, 2, if(isprime(p*10+k), t++)); if(t==1, print1(p, ", ")))
    
  • Python
    from sympy import isprime, primerange
    def ok(p): return sum(1 for k in [1, 3, 7, 9] if isprime(p*10+k)) == 1
    def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
    print(aupto(881)) # Michael S. Branicky, Nov 29 2021

A240679 Primes p such that p*10+k is prime for exactly two values of the digit k.

Original entry on oeis.org

2, 3, 5, 17, 23, 37, 59, 67, 73, 97, 101, 127, 149, 157, 193, 197, 211, 223, 229, 233, 239, 241, 269, 283, 331, 337, 349, 353, 373, 379, 401, 433, 439, 463, 467, 479, 487, 499, 571, 607, 613, 619, 631, 673, 691, 701, 733, 757, 769, 811, 853, 859, 937, 941
Offset: 1

Views

Author

Colin Barker, Apr 10 2014

Keywords

Examples

			2 is in the sequence because 23 and 29 are prime, but 21 and 27 are not prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200]],Count[Table[10 #+k,{k,{1,3,7,9}}],?PrimeQ] == 2&] (* _Harvey P. Dale, Jan 24 2019 *)
  • PARI
    forprime(p=2, 1500, t=0; forstep(k=1, 9, 2, if(isprime(p*10+k), t++)); if(t==2, print1(p, ", ")))

A240680 Primes p such that p*10+k is prime for exactly three values of the digit k.

Original entry on oeis.org

7, 13, 31, 43, 61, 103, 109, 199, 271, 367, 409, 421, 523, 541, 547, 787, 823, 829, 883, 1009, 1033, 1117, 1237, 1291, 1669, 1999, 2131, 2161, 2203, 2269, 2437, 2503, 2593, 2671, 2857, 3049, 3253, 3271, 3361, 3559, 3583, 3769, 3823, 4003, 4201, 4339, 4357
Offset: 1

Views

Author

Colin Barker, Apr 10 2014

Keywords

Examples

			7 is in the sequence because 71, 73 and 79 are prime, but 77 is not prime.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(10^4) | {k: k in [1,3,7,9] | IsPrime(p*10+k)} in Subsets({1,3,7,9},3)]; // Bruno Berselli, Apr 10 2014
  • Mathematica
    Select[Prime[Range[600]],Total[Boole[PrimeQ[10#+{1,3,7,9}]]]==3&] (* Harvey P. Dale, Apr 07 2023 *)
  • PARI
    forprime(p=2, 10000, t=0; forstep(k=1, 9, 2, if(isprime(p*10+k), t++)); if(t==3, print1(p, ", ")))
    

A240689 The number of values of the digit k for which prime(n)*10+k is prime.

Original entry on oeis.org

2, 2, 2, 3, 1, 3, 2, 4, 2, 1, 3, 2, 1, 3, 1, 0, 2, 3, 2, 1, 2, 1, 1, 0, 2, 2, 3, 0, 3, 0, 2, 1, 1, 1, 2, 1, 2, 1, 0, 1, 0, 1, 1, 2, 2, 3, 2, 2, 1, 2, 2, 2, 2, 0, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 0, 2, 2, 0, 2, 2, 1, 3, 2, 2, 1, 0, 0, 2, 3, 0, 3, 0, 2, 2, 0
Offset: 1

Views

Author

Colin Barker, Apr 10 2014

Keywords

Examples

			a(16) = 0 because prime(16) = 53, and 531, 533, 537 and 539 are not prime.
a(5) = 1 because prime(5) = 11, and 113 is prime, but 111, 117 and 119 are not prime.
a(1) = 2 because prime(1) = 2, and 23 and 29 are prime, but 21 and 27 are not prime.
a(4) = 3 because prime(4) = 7, and 71, 73 and 79 are prime, but 77 is not prime.
a(8) = 4 because prime(8) = 19, and 191, 193, 197 and 199 are all prime.
		

Crossrefs

Programs

A155762 Prime numbers p such that prepending any single decimal digit to p does not produce a prime.

Original entry on oeis.org

2, 5, 149, 401, 509, 773, 809, 1021, 1103, 1289, 1301, 1451, 1697, 1709, 1747, 1877, 1889, 2087, 2389, 2521, 2663, 3373, 3511, 3631, 3733, 3779, 3821, 3919, 3947, 3989, 4003, 4073, 4241, 4289, 4339, 4637, 4643, 4801, 4931, 5039, 5113, 5387, 5417, 5477
Offset: 1

Views

Author

Dmitry Kamenetsky, Jan 26 2009

Keywords

Comments

149 is in the sequence, because the following numbers are all composite: 1149, 2149, 3149, 4149, 5149, 6149, 7149, 8149 and 9149.

Crossrefs

Cf. A119289.

Programs

  • Mathematica
    Select[Prime@Range@1000, NoneTrue[#+10^IntegerLength@#*Range@9, PrimeQ]&] (* Hans Rudolf Widmer, May 28 2022 *)
  • Python
    from sympy import isprime, primerange
    def ok(p): return not any(isprime(int(d+str(p))) for d in "123456789")
    print(list(filter(isprime, primerange(2, 5500)))) # Michael S. Branicky, May 28 2022

A239747 Super-prime leaders: right-truncatable primes p with property that appending any single decimal digit to p does not produce a prime.

Original entry on oeis.org

53, 317, 599, 797, 2393, 3793, 3797, 7331, 23333, 23339, 31193, 31379, 37397, 73331, 373393, 593993, 719333, 739397, 739399, 2399333, 7393931, 7393933, 23399339, 29399999, 37337999, 59393339, 73939133
Offset: 1

Views

Author

Arkadiusz Wesolowski, Mar 26 2014

Keywords

Comments

The name "super-prime leaders" is not due to the author.

Examples

			2393 belongs to this sequence because 2393, 239, 23 and 2 are all prime; 10*2393 + k, for k = 0 to 9, are all composite.
		

References

  • Joe Roberts, Lure of the Integers, The Mathematical Association of America, 1992, p. 292.

Crossrefs

Subsequence of A024770 and of A119289.

Programs

  • PARI
    f=1; for(n=2, 73939133, v=n; t=1; while(isprime(n), if(!Mod(f, n^2)==0, t=t*n); c=n; n=(c-lift(Mod(c, 10)))/10); if(n==0, f=f*t); n=v); s=Set(factor(f)[, 1]); for(k=1, #s, p=s[k]; if(!Mod(f, p^2)==0, print1(p, ", ")));

Formula

A024770 INTERSECT A119289.

A240843 Primes p with property that appending or prepending any single decimal digit to p does not produce a prime.

Original entry on oeis.org

773, 1103, 1301, 3947, 3989, 4241, 4637, 4931, 5039, 5387, 5417, 6803, 6917, 6971, 7229, 7451, 7703, 7753, 10211, 10303, 10337, 10607, 10657, 10723, 10859, 11117, 11399, 11423, 11489, 11717, 11813, 11971, 11987, 12119, 12329, 12541, 12653, 12659, 12907, 12983
Offset: 1

Views

Author

Arkadiusz Wesolowski, Apr 13 2014

Keywords

Examples

			1103 belongs to this sequence because 10*1103 + k and k*10^4 + 1103, for k = 1 to 9, are all composite.
		

Crossrefs

Subsequence of A119289 and of A155762.

Programs

  • Mathematica
    fQ[n_] := Block[{e = Floor[ Log10@ n] + 1, r = Range@ 9}, Union@ Flatten[ PrimeQ[{10 n + r, r*10^e + n}]] == {False}]; Select[ Prime@ Range@ 1550, fQ] (* Robert G. Wilson v, Apr 15 2014 *)
  • PARI
    for(n=2, 12983, v=n; if(isprime(n), s=#Str(v); t=0; for(k=1, 9, if(isprime(10*v+k)||isprime(k*10^s+v), break, t++)); if(t==9, print1(v, ", "))); n=v);

Formula

A119289 INTERSECT A155762.

A346979 Count of the prime decimal descendants of n.

Original entry on oeis.org

83, 63, 23, 22, 23, 11, 29, 23, 3, 4, 54, 1, 9, 14, 6, 7, 3, 4, 7, 40, 0, 4, 19, 15, 8, 7, 10, 14, 5, 6, 2, 7, 0, 16, 9, 11, 12, 13, 4, 1, 34, 1, 8, 14, 5, 1, 13, 5, 5, 16, 6, 0, 9, 0, 24, 4, 6, 19, 2, 9, 25, 16, 0, 7, 4, 4, 3, 11, 2, 7, 7, 4, 1, 15, 2, 8, 8
Offset: 0

Views

Author

Ya-Ping Lu, Aug 09 2021

Keywords

Comments

The number of direct decimal descendants (i.e., decimal children) of n is A038800(n). The number of prime decimal descendants of the n-th prime is A214342(p_n). a(n) is the number of prime decimal descendants of n, which include the prime decimal children of n, the prime decimal children of the prime decimal children of n, and so on.
a(0) = Sum_{m=1..4} (A214342(m) + 1); a(1) = Sum_{m=5..8} (A214342(m) + 1).
a(A032352(m)) = 0; a(A119289(m)) = 0.
A214342 is a subset, as A214342(m) = a(prime(m)).
Conjecture 1: a(n) <= 83. Conjecture 2: lim_{n->oo} (n0/n) = 1, where n0 is the number of zero terms, a(k) = 0, for k <= n.

Examples

			a(4) = 23. The 23 prime decimal descendants of 4 are shown in the tree below.
       _____ 4__________________________
      /      |                          \
     41   ___43______________            47
    /    /   |               \             \
  419  431  433               439          479
            / \              /   \        /   \
        4337  4339         4391  4397   4793  4799
             /  |  \        |     |     /  \
        43391 43397 43399 43913 43973 47933 47939
                            |
                         439133
                            |
                        4391339
		

Crossrefs

Programs

  • Mathematica
    Table[Length@Rest@Flatten[FixedPointList[(b=#;Select[Flatten[(a=#;FromDigits/@(Join[IntegerDigits@a,{#}]&/@If[b=={0},Range@9,{1,3,7,9}]))&/@b],PrimeQ])&,{n}]],{n,0,76}] (* Giorgos Kalogeropoulos, Aug 16 2021 *)
  • Python
    from sympy import isprime
    def p_count(k):
        global ct; d = [2, 3, 5, 7] if k == 0 else [1, 3, 7, 9]
        for i in range(4):
            m = 10*k + d[i]
            if isprime(m): ct += 1; p_count(m)
        return ct
    for n in range(100):
        ct = 0; print(p_count(n))
Showing 1-9 of 9 results.