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.

A090464 Smallest number m such that n with by m sevens appended yields a prime, or -1 if no such m exists.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, -1, 1, 1, 0, 2, 0, 6, -1, 1, 0, 2, 1, 2, 1, -1, 0, 1, 0, 5, 1, 1, -1, 1, 0, 2, 1, 12, 0, -1, 0, 3, 1, 1, 0, 1, -1, 2, 8, 7, 0, 1, 1, -1, 1, 1, 0, 1, 0, 2, -1, 1, 2, 5, 0, 3, 2, -1, 0, 1, 0, 2, 1, 3, -1, 1, 0, 3, 4, 1, 0, -1, 1, 2, 1, 1, 0, 1, -1, 2, 1, 1
Offset: 1

Views

Author

Chuck Seggelin, Dec 02 2003

Keywords

Comments

a(n) = 0 if n is already prime. a(n) = -1 for n = any multiple of 7 other than 7 itself. Each multiple of 7 has been tested out to 2000 7's with no result found. The first eight values of n which are not multiples of 7 for which no answer has yet been found are 95, 480, 851, 891, 957, 1184, 1261, 1881. 95 has been tested out to 2100 7's, 1881 has been tested out to 1750 7's, the others have been tested out to 2000 7's. Pending solutions for these values of n, the first 10 record holders are currently 1, 8, 20, 40, 120, 128, 225, 260, 296, 711 with the values 1, 2, 6, 12, 16, 18, 56, 182, 434, 1648 respectively.
From Toshitaka Suzuki, Sep 26 2023: (Start)
a(95) = 2904, a(480) = 11330, a(851) = 28895, a(891) = -1, a(957) = 2903, a(1184) = 4646, a(1261) = -1 and a(1881) = 47927.
a(n) = -1 when n = 15873*k + 891, 1261, 2889, 3263, 3300, 7810, 8917, 9812, 12617, 13024, 14615 or 15066, because n followed by any positive number, m say, of 7's is divisible by at least one of the primes {3,11,13,37}.
Similarly,
a(n) = -1 when n = 11111111*k + 964146, 1207525, 2342974, 3567630, 7525789, 8134540, 8591231 or 9641467 by primes {11,73,101,137};
a(n) = -1 when n = 429000429*k + 23928593, 27079312, 36492115, 41207969, 52285750, 80569929, 89920882, 93857078, 133928703, 217208145, 223492302, 236849444, 239285937, 247857232, 259793116, 270793127, 323985244, 332698824, 333570182, 334985255, 346849554, 364921157, 376698868 or 412079697 by primes {3,11,13,101,9901};
a(n) = -1 when n = 1221001221*k + 14569863, 28792885, 145698637, 167698659, 225079510, 235985156, 247079532, 287928857, 331921124, 399492478, 415286113, 421492500, 437286135, 455985376, 489857474, 529929099, 551921344, 635208563, 709857694, 877208805, 896850104, 993570842, 1029793886 or 1138850346 by primes {3,11,37,101,9901};
a(n) = -1 when n = 1443001443*k + 85928655, 167698659, 176928746, 218921011, 233985154, 247079532, 310492389, 326286024, 376857361, 585793442, 655208583, 700699192, 746208674, 780080065, 791570640, 805850013, 843492922, 859286557, 882570731, 896850104, 1027793884, 1219922012, 1234986155 or 1377858362 by primes {3,13,37,101,9901}.
The first 10 record holders are 1, 8, 20, 40, 95, 480, 851, 1881, 2038, 2174 with the values 1, 2, 6, 12, 2904, 11330, 28895, 47927, 76206, 94146 respectively.
a(4444) > 300000 or a(4444) = -1.
(End)
For multiples of 7 it is confusing that the author writes in the first comment "has been tested out to 2000": If we denote n{m} = n*10^m + (10^m-1)/9*7 the number n with m '7's appended, then it is easy to see that (7k){m} / 7 = k*10^m + (10^m-1)/9 is an integer for all m >= 0. - M. F. Hasler, Jun 05 2024

Examples

			a(20) = 6 because six 7's must be appended to 20 before a prime is formed (20777777).
a(14) = -1 because no matter how many 7's are appended to 14, the resulting number is always divisible by 7 and can therefore not be prime.
		

Crossrefs

Cf. A363922 (m > 0).
Cf. A083747 (same, using ones), A090584 (using threes), A090465 (using nines).

Programs

  • PARI
    apply( {A090464(n, LIM=500)=n%7 && for(m=0, LIM, ispseudoprime(n) && return(m); n=n*10+7); -(n>7)}, [1..55]) \\ Retun value -1 means that a(n) = -1 or, if n%7 > 0, then possibly a(n) > LIM, the search limit given as 2nd (optional) parameter. - M. F. Hasler, Jun 05 2024

A090465 Smallest number m such that (n+1)*10^m-1 (i.e., n with m nines appended) yields a prime, or -1 if this will always yield a composite number.

Original entry on oeis.org

1, 0, 0, 2, 0, -1, 0, 1, -1, 1, 0, -1, 0, 1, -1, 2, 0, -1, 0, 2, -1, 1, 0, -1, 3, 1, -1, 4, 0, -1, 0, 2, -1, 1, 1, -1, 0, 1, -1, 1, 0, -1, 0, 1, -1, 16, 0, -1, 1, 1, -1, 3, 0, -1, 5, 1, -1, 15, 0, -1, 0, 2, -1, 12, 1, -1, 0, 2, -1, 1, 0, -1, 0, 2, -1, 1, 3, -1, 0, 1, -1, 1, 0, -1, 1, 2, -1, 33, 0, -1, 1, 1, -1, 3, 10, -1, 0, 3, -1, 1, 0, -1, 0, 1, -1, 1, 0, -1
Offset: 1

Views

Author

Chuck Seggelin, Dec 02 2003

Keywords

Comments

The first 9 record holders in this sequence are 1, 4, 25, 28, 46, 88, 374, 416, 466 with the values 1, 2, 3, 4, 16, 33, 57, 70, 203 respectively.
The next 3 record holders are 1342, 1802, 1934 with the values 29711, 45882, 51836 respectively. 4420 may be the next record holder as no solution has been found for it yet. 4420 was tested out to 300000 nines with no prime formed. - Toshitaka Suzuki, May 27 2024

Examples

			a(25) = 3 because three 9's must be appended to 25 before a prime is formed (25999).
a(6) = -1 because no matter how many 9's are appended to 6, the resulting number is always divisible by 3 and can therefore not be prime.
		

Crossrefs

Cf. A083747 (The Wilde Primes, i.e. same operation using ones), A090584 (using threes), A090464 (using sevens).

Programs

  • Maple
    f:= proc(n) local x,m;
      if n mod 3 = 0 and n <> 3 then return -1 fi;
      x:= n;
      for m from 0 to 10^4 do
       if isprime(x) then return m fi;
        x:= 10*x+9
      od;
    fail
    end proc:
    map(f, [$1..200]); # Robert Israel, Jun 05 2024
  • PARI
    apply( {A090465(n, LIM=500)=n%3 && for(m=0, LIM, ispseudoprime(n) && return(m); n=n*10+9); -(n>3)}, [1..55]) \\ Retun value -1 means that a(n) = -1 or, if n%3 > 0, then possibly a(n) > LIM, the search limit given as second (optional) parameter. - M. F. Hasler, Jun 05 2024

Formula

a(p) = 0 for p prime.
a(n) = -1 if n is a proper multiple of 3.

Extensions

Definition edited by M. F. Hasler, Jun 05 2024

A372056 Smallest prime obtained by appending one or more 3's to n, or -1 if no such prime exists.

Original entry on oeis.org

13, 23, -1, 43, 53, -1, 73, 83, -1, 103, 113, -1, 1333333333333333, 1433, -1, 163, 173, -1, 193, 20333, -1, 223, 233, -1, 2533333333, 263, -1, 283, 293, -1, 313, 323333, -1, 3433, 353, -1, 373, 383, -1
Offset: 1

Views

Author

Toshitaka Suzuki, Mar 30 2024

Keywords

Comments

Next term is 40 followed by 483 3's and is too large to display here (see the b-file).

Examples

			For n = 13, a(13) = 1333333333333333 is a prime (but 133,1333,13333 etc. are not primes).
		

Crossrefs

See A112394 for another version.

Extensions

Edited by N. J. A. Sloane, Apr 24 2024

A372262 a(n) = smallest number m > 0 such that n followed by m 3's yields a prime, or -1 if no such m exists.

Original entry on oeis.org

1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 14, 2, -1, 1, 1, -1, 1, 3, -1, 1, 1, -1, 8, 1, -1, 1, 1, -1, 1, 4, -1, 2, 1, -1, 1, 1, -1, 483, 2, -1, 1, 1, -1, 1, 2, -1, 2, 1, -1, 1, 2, -1, 3, 1, -1, 6, 1, -1, 1, 5, -1, 1, 1, -1, 1, 1, -1, 5, 3, -1, 1, 1, -1, 3, 1, -1, 2, 4
Offset: 1

Views

Author

Toshitaka Suzuki, Apr 24 2024

Keywords

Comments

a(n) = -1 when n = 3*k because no matter how many 3's are appended to n, the resulting number is always divisible by 3 and therefore cannot be prime.
a(n) = -1 when n = 37037*k + 2808, 3666, 4070, 9287, 18799, 21574, 28083, 30558, 33300, 33740, 36663 or 36707, because n followed by any positive number, m say, of 3's is divisible by at least one of the primes {7,11,13,37}.
a(817) > 300000 or a(817) = -1.

Examples

			a(20)=3 because 203 and 2033 are composite but 20333 is prime.
		

Crossrefs

Programs

  • Mathematica
    snm[n_]:=Module[{k=1},If[Mod[n,3]==0,-1,While[CompositeQ[FromDigits[ PadRight[ IntegerDigits[ n],k+ IntegerLength[ n],3]]],k++];k]]; Array[snm,80] (* Harvey P. Dale, Aug 06 2024 *)
Showing 1-4 of 4 results.