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.

Previous Showing 11-19 of 19 results.

A371475 Smallest weak prime in base 2n+1.

Original entry on oeis.org

2, 83, 223, 2789, 3347, 4751, 484439, 10513, 10909, 2823167, 68543, 181141, 6139219, 488651, 356479, 399946711, 22549349, 8371249, 660040873, 12088631, 3352003, 234606268969, 84343813, 82751411, 153722088497, 141451831, 11085190183, 350552595007, 535946951, 658716229
Offset: 1

Views

Author

Chai Wah Wu, Mar 24 2024

Keywords

Comments

Bisection of A186995. Smallest weak prime in odd bases appear to be relatively smaller than smallest weak prime in even bases. This could be due to the fact that for an odd base and an odd prime, any digit change with an odd difference from the original digit results in an even number and thus not prime, so only digit changes with an even difference need to be checked for primality, whereas for an even base, all digit changes need to be checked.
Smallest weak prime in odd bases of the form 6k+3 appear to be relatively larger than smallest weak prime in other odd bases.

Crossrefs

Cf. A186995, A050249 (base 10), A137985 (base 2).

Programs

  • Python
    from sympy import isprime, nextprime
    from sympy.ntheory import digits
    def A371475(n):
        if n == 1: return 2
        p, r = 5, (n<<1)+1
        while True:
            s = digits(p,r)[1:]
            l = len(s)
            for i,j in enumerate(s[::-1]):
                m = r**i
                for k in range(j&1,r,2):
                    if k!=j and isprime(p+(k-j)*m):
                        break
                else:
                    continue
                break
            else:
                return p
            p = nextprime(p)

Formula

a(n) = A186995(2*n+1).

Extensions

a(22)-a(27) from Michael S. Branicky, Apr 01 2024
a(28)-a(30) from Michael S. Branicky, Apr 06 2024

A185188 Twin primes which are weakly prime numbers.

Original entry on oeis.org

64067207819, 64067207821, 86132413439, 86132413441, 343051899689, 343051899691, 841323181889, 841323181891, 889872452759, 889872452761, 908010864419, 908010864421, 973782583469, 973782583471
Offset: 1

Views

Author

Terentyev Oleg, Feb 19 2011

Keywords

Comments

Intersection of A001097 and A050249

A186694 Numbers ending in 1, 3, 7 or 9 such that changing any one decimal digit produces a composite number.

Original entry on oeis.org

212159, 294001, 505447, 584141, 595631, 604171, 872897, 971767, 1062599, 1203623, 1282529, 1293671, 1524181, 1566691, 1702357, 1830661, 2017963, 2474431, 2690201, 3085553, 3326489, 3716213, 3964169, 4103917, 4134953, 4173921, 4310617, 4376703
Offset: 1

Views

Author

Arkadiusz Wesolowski, Feb 25 2011

Keywords

Comments

Union of A050249 and A143641.
This sequence is infinite because Terence Tao proved that sequence A050249 is infinite.

Crossrefs

Programs

  • Mathematica
    primeProof[n_] := Module[{d, e, isPP, num}, d=IntegerDigits[n]; isPP=True; Do[e=d; e[[i]]=j; num=FromDigits[e]; If[num != n && PrimeQ[num], isPP=False; Break[]], {i, Length[d]}, {j, 0, 9}]; isPP]; Select[Range[1, 1000000, 2], Mod[#, 5] > 0 && primeProof[#] &] (* T. D. Noe, Feb 26 2011 *)

A199428 Extreme weakly prime numbers.

Original entry on oeis.org

40144044691, 58058453543, 89797181359, 185113489357, 213022025663, 222498988079, 365115312521, 397195264507, 507086259359, 537598896647, 576872778883, 671770400281, 710587610861, 719174481061, 815380174991, 840202011349, 855194972407, 869287849361, 891600776149
Offset: 1

Views

Author

Carlos Rivera, Nov 06 2011

Keywords

Comments

Primes that become composite if any digit is removed, changed, or inserted anywhere. First & smallest term found by Jens K. Andersen in 2008; five more by Giovanni Resta in Nov. 2011. Expected infinite of them. These primes emerge in relation to the prime-version of classical Doublets puzzle by Lewis Carrol. Correspond to the "aloof" words as named by Donald Knuth.

Crossrefs

Cf. A050249.

Extensions

More terms from Giovanni Resta, Aug 15 2019

A226241 Primes that cannot be reached from 2 via a chain of primes obtained adding or deleting a digit from the end or the beginning of the previous term of the chain.

Original entry on oeis.org

89, 101, 103, 107, 109, 151, 163, 227, 251, 257, 263, 269, 281, 307, 389, 401, 409, 457, 503, 509, 521, 557, 563, 569, 587, 601, 607, 701, 709, 809, 821, 827, 857, 863, 881, 887, 907, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069
Offset: 1

Views

Author

Giovanni Resta, Jun 01 2013

Keywords

Comments

All the primes containing a 0 are members since a 0 cannot be added at the end (it is even) nor at the beginning since, for example, 02 and 0013 are not canonical representations. The sequence is infinite, since there are exactly 820293 other primes that can be reached from 2, the largest one being 5481899436575987524681453773937333.

Examples

			All the primes < 89 can be reached from 2. For example, 2 -> 23 -> 3 -> 37.
		

Crossrefs

Programs

  • Mathematica
    step[p_] := Block[{dn = 10^IntegerLength@p}, Select[ Union[{Floor[p/10], Mod[p, dn/10]}, p*10 + {1, 3, 7, 9}, Range[9]*dn + p], PrimeQ[#] &]]; old = {}; new = {2}; wrk = {}; While[new != {}, wrk = Flatten[step /@ new]; old = Union[new, old]; new = Complement[wrk, old]; Print["# = ", Length@old, "  max = ", Max[old], " new # = ", Length@new]]; Print["Missing up to 1000 = ", Complement[Prime@Range[168], old]]

A353737 Length of longest n-digit optimal prime ladder (base 10).

Original entry on oeis.org

2, 4, 7, 9, 11, 13, 15
Offset: 1

Views

Author

Michael S. Branicky, May 09 2022

Keywords

Comments

A prime ladder (in base b) starts with a prime, ends with a prime, and each step produces a new prime by changing exactly one base-b digit.
A shortest such construct between two given primes is optimal.
Analogous to a word ladder (see Wikipedia link).
Here, n-digit primes do not allow leading 0 digits.
If all n-digit primes are disconnected, a(n) = 1; if there are no n-digit primes, a(n) = 0.
a(7) >= 15.
It follows from Bertrand's postulate that there exist n-digit primes for all n >= 1, so a(n) is never 0. - Pontus von Brömssen, May 11 2022

Examples

			The 1-digit optimal prime ladder 3 - 5 is tied for the longest amongst 1-digit primes, so a(1) = 2.
The 2-digit optimal prime ladder 97 - 17 - 13 - 53 is tied for the longest amongst 2-digit primes, so a(2) = 4.
The 3-digit optimal prime ladder 389 - 383 - 283 - 281 - 251 - 751 - 761 is tied for the longest amongst 3-digit primes, so a(3) = 7.
The 4-digit optimal prime ladder 4651 - 4951 - 4931 - 4933 - 4733 - 6733 - 6833 - 6883 - 6983 is tied for the longest amongst 4-digit primes, so a(4) = 9.
The 5-digit optimal prime ladder 88259 - 48259 - 45259 - 45959 - 41959 - 41969 - 91969 - 91961 - 99961 - 99761 - 99721 is tied for the longest amongst 5-digit primes, so a(5) = 13.
The 6-digit optimal prime ladder 440497 - 410497 - 410491 - 710491 - 710441 - 710443 - 717443 - 917443 - 917843 - 907843 - 905843 - 905833 - 995833 is tied for the longest amongst 6-digit primes, so a(6) = 13.
The 7-digit optimal prime ladder 3038459 - 3032459 - 3032453 - 3034453 - 3034457 - 3034657 - 3074657 - 3074557 - 4074557 - 4079557 - 4779557 - 4779547 - 7779547 - 7759547 - 7755547 is tied for the longest amongst 7-digit primes, so a(7) = 15. - _Michael S. Branicky_, May 21 2022
		

Crossrefs

Formula

a(n) is the number of vertices of a longest shortest path in the graph G = (V, E), where V = {n-digit base-10 primes} and E = {(v, w) | H_10(v, w) = 1}, where H_b is the Hamming distance in base b.

Extensions

a(7) from Michael S. Branicky, May 21 2022

A158641 Strong primes p: adding 2 to any one digit of p produces a prime number (no digits 8 & 9 in p).

Original entry on oeis.org

3, 5, 11, 17, 41, 107, 137, 347, 2111, 2657, 3527, 4421, 6761, 21011, 24371, 32057
Offset: 1

Views

Author

Zak Seidov, Mar 23 2009

Keywords

Comments

All terms are lesser of twin pairs.
The sequence is finite. In particular, there are no terms longer than 5 digits since 2*10^k for k=0,1,...,5 give all nonzero residues modulo 7, implying that adding 2 to some digit yields a multiple of 7. - Max Alekseyev, Apr 25 2010

Examples

			2111 is in this sequence because all 2111, 4111, 2311, 2131 and 2113 are prime numbers.
32057 is in this sequence because all 32057, 52057, 34057, 32257, 32077 and 32059 are prime numbers.
		

Crossrefs

Cf. A050249, A158124, A158125 Weakly prime numbers (changing any one digit always produces a composite number).

Programs

  • Maple
    Lton := proc(L) local i; add(op(i,L)*10^(i-1),i=1..nops(L)) ; end: isA158641 := proc(p) local pdgs,pplus,i ; if isprime(p) then pdgs := convert(p,base,10) ; if convert(pdgs,set) intersect {8,9} <> {} then false; else for i from 1 to nops(pdgs) do pplus := subsop(i=2+op(i,pdgs),pdgs) ; if not isprime(Lton(pplus)) then RETURN(false); fi; od: true; fi; else false; fi; end: for n from 1 do p := ithprime(n) ; if isA158641(p) then print(p) ; fi; od: # R. J. Mathar, Apr 16 2009
  • Mathematica
    spQ[p_]:=Max[IntegerDigits[p]]<8&&AllTrue[FromDigits/@Table[MapAt[ 2+#&,IntegerDigits[ p],n],{n,IntegerLength[p]}],PrimeQ]; Select[Prime[ Range[ 3500]],spQ] (* Harvey P. Dale, Nov 26 2022 *)
  • PARI
    test(p)=my(v=eval(Vec(Str(p)))); for(i=1,#v, if(v[i]>7,return(0))); for(i=0,#v-1, if(!isprime(p+2*10^i), return(0))); 1
    forprime(p=2,4e9, if(isprime(p+2) && test(p), print1(p","))) \\ Charles R Greathouse IV, Sep 09 2009
    
  • PARI
    has(n)=if(vecmax(Set(digits(n)))>7, return(0)); for(i=0,#digits(n)-1, if(!isprime(n+2*10^i), return(0))); 1
    select(has, primes(3438)) \\ Charles R Greathouse IV, Mar 11 2016

Extensions

Keywords full, fini from Max Alekseyev, Apr 25 2010

A343075 Digitally delicate square numbers (changing any one decimal digit always produces a nonsquare).

Original entry on oeis.org

25, 121, 144, 169, 196, 256, 289, 324, 1024, 1089, 1156, 1296, 1369, 1444, 1521, 1681, 1764, 1849, 1936, 2500, 3136, 3249, 3364, 3481, 3721, 3844, 3969, 4096, 4356, 4489, 4624, 4761, 5041, 5184, 6084, 6241, 6561, 6724, 6889, 7056, 7396
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 04 2021

Keywords

Comments

If k is the count of digitally delicate square numbers <= n, then empirically lim_{n->oo} k/n = sqrt(5)/3.

Examples

			n = 25, changing the digit 2 in 25 to d5, d from {0,1,3,4,5,6,7,8,9} gives no square, changing the digit 5 in 25 to 2d, d from {0,1,2,3,4,6,7,8,9} gives no square. Thus n = 25 is a member of the sequence.
		

Crossrefs

Programs

  • Mathematica
    changes[n_] := Module[{d = IntegerDigits[n]}, FromDigits @ ReplacePart[d, First[#] -> Last[#]] & /@ Tuples[{Range[Length[d]], Range[0, 9]}]]; q[n_] := AllTrue[changes[n], # == n || ! IntegerQ @ Sqrt[#] &]; Select[Range[100]^2, q] (* Amiram Eldar, Apr 04 2021 *)
  • Python
    from sympy import integer_nthroot
    def is_square(n): return integer_nthroot(n, 2)[1]
    def change1(n):
      s = str(n)
      for i in range(len(s)):
        for d in set("0123456789") - {s[i]}:
          yield int(s[:i] + d + s[i+1:])
    def ok(sqr): return not any(is_square(t) for t in change1(sqr))
    print(list(filter(ok, (k*k for k in range(87))))) # Michael S. Branicky, Apr 04 2021

A354440 Digitally delicate primes where the number of digits appended on the left needed to get a prime increases.

Original entry on oeis.org

294001, 604171, 971767, 2690201, 10564877, 104097043, 354975121, 1378229029, 1444623667, 1594371379, 3979115747, 15737262803, 22090236251, 28198307351, 35373071549, 49430022721, 67580736437, 142243533671, 659956292591, 1385321944133
Offset: 1

Views

Author

Jason Rodgers, May 29 2022

Keywords

Comments

Digitally delicate primes (A050249) are primes such that if any single digit is changed the new number is composite. This sequence gives the smallest such prime that needs more digits added to the left to get to another prime. While this list is not complete it has been shown to be finite. A widely digitally delicate prime is known which never becomes prime regardless of the number of extra digits.
294001 can add 1
604171 can add 3
971767 can add 4
2690201 can add 5
10564877 can add 6
104097043 can add 7
354975121 can add 10
1378229029 can add 11
1444623667 can add 12
1594371379 can add 14
3979115747 can add 15
15737262803 can add 16
22090236251 can add 20
28198307351 can add 26
35373071549 can add 27
49430022721 can add 28
67580736437 can add 30
142243533671 can add 47
659956292591 can add 59
1385321944133 can add 76

Examples

			You can add any 1 extra digit on the left to 294001 without getting a prime but adding two digits would allow for the creation of a prime. For example 10294001 is prime but none of X294001 are.
Starting at 604171 you could add 3 extra digits to the left but not 4 without being able to produce a prime number.
X604171 is not prime
X0604171 is not prime
X00604171 is not prime
however 4000604171 is a prime number
For the largest one found so far
X1385321944133
X01385321944133
X001385321944133
...
X000000000000000000000000000000000000000000000000000000000000000000000000001385321944133 are all composite
but 900000000000000000000000000000000000000000000000000000000000000000000000000001385321944133 is prime
		

References

  • Michael Filaseta and Jeremiah Southwick, Primes that become composite after changing an arbitrary digit, Math. Comp. (2021) Vol. 90, 979-993. doi:10.1090/mcom/3593

Crossrefs

Cf. A050249 (digitally delicate primes).

Programs

  • Java
    import java.math.BigInteger;
    public class delicateprimes {
    public static void main(String[] args) {
      BigInteger i,reci=new BigInteger("0");
      i= new BigInteger("1");
      long count=0, v,rec=-1;
      for(long loop=1;;loop++)
      {
        i=i.nextProbablePrime();
        v = delicate(i,true);
        if(v>rec) {count++; rec=v;reci=i;System.out.println("REC=("+reci+", "+rec+") " +loop +"   "+count);}
        if(loop%100000==0)System.out.println("Still running, last prime seen was "+i);
      }
    }
    static int delicate(BigInteger a,boolean f) // Returns how many digits can be tacked on the delicate prime. f=false just tests the prime with no extra 0s
    {
      int e, length,max=200;
      if(!f)max=1;
      String num="", num2="";
      if(!prime(a))return -1;
      for(e=0;e0)length=e;else length = num.length();
        for(int j=0;j
    				

Extensions

Partially edited by N. J. A. Sloane, Sep 03 2022
Previous Showing 11-19 of 19 results.