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.

A272232 Smallest k > 0 such that R_k//n//R_k is prime, where R_k is the repunit A002275(k) of length k and // denotes concatenation; or -1 if no such k exists.

Original entry on oeis.org

1, 9, -1, 1, 2, 1, 10, 3, 1, 1, 3, -1, 2, 3, 33, 1, 2, 1, 1, 21, 1, 2, -1, 1, 7, 48, 292, 4, 3, 1, 1, 2, 1, -1, 135, -1, 1, -1, 1, 34, 3, 3, 40, 2, -1, 1, 3, 1, 1, 32, 61, 1, 2, 1, 137, -1, 3, 1, 2, 42, 1, 14, 1, 262, 2, 22, -1, 3, 9, 2, 33, 73, 1, 3, 1, 2, 3, -1, 2, 2, 1
Offset: 0

Views

Author

Felix Fröhlich, Apr 23 2016

Keywords

Comments

a(2) = -1 (see second comment in A258372).
a(n) = -1 if n > 0 is in A099814 (see fourth comment in A004022).
a(n) = -1 if n is of the form A000042(i)*10^j+A000042(i) for some j > i > 0, since the resulting number is divisible by A002275(k)//A000042(i).
a(n) = -1 if n is a term of A010785 with an even number of digits, since any number of the form 1..1d..d1..1 with an even number of digits d is divisible by 11.
a(n) = 1 if there exists an integer x such that n = (A002275(A004023(x))-A011557(x)-1)/10.
From Chai Wah Wu, Nov 07 2019: (Start)
a(n) = -1 if n has an even number of digits and is a multiple of 11. In particular, a(n) = -1 if n is a term of A056524.
a(n) = -1 if n = (10^k+1)(10^m-1)/9 for some m > 0, k >= 0.
(End)
a(140) > 20000. - Hans Havermann, May 21 2022

Examples

			a(0) = 1 since 101 is prime; a(1) refers to the prime 1111111111111111111.
a(124) = -1 because R_k//124//R_k is divisible by 125*10^k-1.
		

Crossrefs

Programs

  • Mathematica
    Table[SelectFirst[Range[10^4], PrimeQ@ FromDigits@ Flatten@ {#, IntegerDigits@ n, #} &@ Table[1, {#}] &], {n, 0, 91}] /. k_ /; MissingQ@ k -> 0 (* Michael De Vlieger, Apr 25 2016, Version 10.2 *)
  • PARI
    a(n) = my(k=1); while(!ispseudoprime(eval(Str((10^k-1)/9, n, (10^k-1)/9))), k++); k

Extensions

a(35)-a(80) from Giovanni Resta, May 01 2016
Escape clausae value changed to -1 by N. J. A. Sloane, May 17 2022

A307873 The concatenation pkp is the number obtained by placing prime p either side of R_k, the k-th repunit (1, k times); a(n) is the smallest k such that pkp is prime, where p=prime(n), or -1 if no such k exists.

Original entry on oeis.org

-1, 1, -1, 10905, 15, 2, 1, 2, 3, 1, 3, 173, 1, 14, 1, 43, 1, 5, 11, 1, 2, 3, 3, 1, 2, -1, 5, 421, 3, 1, -1, 1, 1, 3, -1, 15, -1, 3, 3, 163, -1, 3, 13, -1, 679, -1, 5, 5, -1, 107, 93, 1, -1, 3, -1, 1, -1, 9, 5, -1, -1, 9, 1089, -1, 3, 7, 3, 15, -1, 27, -1, 1, -1, 27, 17, 25, 1, 15, 3
Offset: 1

Views

Author

David James Sycamore, May 02 2019

Keywords

Comments

Primes (from above data) for which pkp is composite for all k are 2, 5, 101, 127, 149, 157, 179, 193, 199, 227, 241, 257, 269, 281, 283, 311, 347, 353, 367. In every case the factorization of pkp contains at least one characteristic prime divisor (very different from A306861).
Conjecture: There are an infinite number of -1 terms in this sequence.

Examples

			2/2k2, 5/5k5, 7/101k101, 11,13/127k127, 11/149k149, for all k, so a(1)=a(3)=a(26)= a(31)=a(35)=-1. For prime(n)=A004023(2)=R_19, a(n)=R_(317-2*19)=R_279.
		

Crossrefs

Programs

  • Maple
    P(p) := proc (p::prime, N::posint := 5000) local n, k, m0, m; n := length(p); for k from 1 to N do m0 := add(10^i, i = 0 .. k-1); m := p*10^(k+n)+m0*10^n+p; if isprime(m) then return k end if; if `mod`(k, 1000) = 0 then print(k) end if end do end proc; P(p) # substitute a prime p here to run the code, it produces an answer (k) if one exists <=N and terms must be computed one at a time.

Formula

If prime(n) is a repunit prime R_k, for some k in A004023 and R_t is the smallest repunit prime such that t > 2*k, then a(n)=R_(t-2*k).
Showing 1-2 of 2 results.