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

A258372 Smallest nonnegative number k not starting or ending with the digit 1 that forms a prime when it is sandwiched between n ones to the left of k and n ones to the right of k.

Original entry on oeis.org

0, 3, 4, 8, 36, 8, 5, 72, 28, 6, 79, 212, 23, 6, 73, 24, 52, 62, 3, 28, 220, 53, 75, 58, 228, 9, 265, 89, 214, 86, 215, 4, 7, 39, 295, 40, 87, 216, 97, 6, 264, 53, 287, 223, 4, 239, 259, 25, 57, 364, 49, 38, 93, 86, 27, 30, 80, 24, 6, 356, 50, 645, 395, 206
Offset: 1

Views

Author

Felix Fröhlich, May 28 2015

Keywords

Comments

n = 1 is the only case where a(n) = 0, since for any n > 1, A138148(n) is divisible by A002275(n).
No n exists such that a(n) = 2, since any number of the form A100706(n)+A011557(n) is of the form A000533(n)*A002275(n+1) (see comment by Robert Israel in A107123).
a(n) = 3 iff n is in A107123.
a(n) = 4 iff n is in A107124.
If k has an even number of digits and is a multiple of 11, then k is not a term. If k = (10^r+1)(10^m-1)/9 for some m > 0, r >= 0, then k is not a term. If A272232(k) = 0, then k is not a term. - Chai Wah Wu, Nov 08 2019

Examples

			a(1) = 0, because 101 is prime.
a(5) = 36, because the smallest x >= 0 such that 11111_x_11111 (where '_' denotes concatenation) is prime is 36. The decimal expansion of that prime is 111113611111.
		

Crossrefs

Programs

  • Mathematica
    Table[k = 0; s = Table[1, {n}]; While[Or[!PrimeQ[FromDigits[s ~Join~ IntegerDigits[k] ~Join~ s]], Or[First@ IntegerDigits@ k == 1, Last@ IntegerDigits@ k == 1]], k++]; k, {n, 64}] (* Michael De Vlieger, May 28 2015 *)
  • PARI
    a000042(n) = (10^n-1)/9
    a(n) = my(k=0); while(k==10 || k%10==1 || k\(10^(#Str(k)-1))==1 || !ispseudoprime(eval(Str(a000042(n), k, a000042(n)))), k++); k

A306861 The concatenation kpk is the number obtained by placing k leading and trailing 1's around the prime p; a(n) is the smallest k such that kpk is prime, where p = prime(n), or -1 if no such k exists.

Original entry on oeis.org

-1, 1, 1, 3, -1, 3, 1, 21, 1, 1, 2, -1, 3, 2, 1, 1, 42, 14, 3, 73, 3, 2, 1, 4, 3, -1, 2, 1, 3, 1, 3, 1, 3, 3, 1, 6, 2, 3, 192, 1, 4, 3, 3, 8, 1, 9, 36, 5, 12, 5, 18, 1, 26, 1, 16, 10, 15, 2, 72, 22, 3, 4, 2, 4, 5, 1, 12, 5, 13, 3, 9, 1, 6, 60, 2, 1, 58
Offset: 1

Views

Author

David James Sycamore, Mar 14 2019

Keywords

Comments

For p = 2,11,37,101 kpk is composite for all k, hence a(n) = -1.
For p = 397 (n=78), 563, 739, 1249, ... no k (<= 12000) has yet been found such that kpk is prime, but also there is no proof yet that k does not exist.
If p = prime(n) is an odd repunit prime, a(n) is half the difference in repunit length between p and the next repunit prime.
Conjecture: There are infinitely many -1 terms in this sequence.
This is a subsequence of A272232. - Hans Havermann, May 17 2022

Examples

			a(1) = -1 because k2k is divisible by the (k+1)-th repunit for all k. The same argument applies to a(26) (p=101). a(2)=1 since 131 is prime, a(3)=1 since 151 is prime, a(4)=3 since 1117111 is prime. a(5)=-1 because k11k is always divisible by 11.
a(12) = -1 because the factor cycle for k37k comprises a covering congruence as follows: k==1 (mod 3)-->3|k37k; k==2 (mod 3)--> 13|k37k; k==3 (mod 3)--> 37|p37p.
For a(78) (p=397) no k (up to 30000) has been found such that kpk is prime.
		

Crossrefs

Programs

  • Maple
    Wrapped_prime := proc (p::prime, N::posint := 5000) local n, k, m0, m; n := length(p); for k to N do m0 := add(10^i, i = 0 .. k-1); m := m0+10^k*p+10^(k+n)*m0; if isprime(m) then return k end if end do end proc
    Wrapped_prime(p). #Enter a value for p in this line and the code will calculate the first k for which kpk is prime (up to a max value of N, which can be chosen arbitrarily).
Showing 1-2 of 2 results.