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-3 of 3 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

A261450 Smallest k such that A011557(n)//k//rev is prime, where rev is the string of digits of A011557(n) reversed (retaining any leading zeros) and // denotes concatenation.

Original entry on oeis.org

0, 3, 3, 3, 5, 8, 29, 5, 8, 15, 3, 21, 8, 3, 21, 3, 8, 18, 20, 92, 110, 51, 102, 6, 57, 23, 5, 114, 8, 32, 41, 6, 236, 6, 39, 60, 110, 62, 36, 17, 53, 21, 161, 41, 159, 57, 137, 42, 83, 114, 126, 80, 30, 36, 278, 107, 425, 111, 68, 68, 95, 29, 8, 53, 426, 48
Offset: 0

Views

Author

Felix Fröhlich, Aug 23 2015

Keywords

Comments

Is a(n) = 0 for any n > 0? If such an n exists, that n is a term of A000079 (cf. Greathouse, 2010).
All terms are congruent to 0 or 2 modulo 3, since if k is congruent to 1 modulo 3, 1000...0//k//00...01 is divisible by 3 and thus not prime.
a(n) <= A100026(n-1) with equality when a(n) is a palindrome. - Michel Marcus, Sep 11 2015

Examples

			a(1) = 3, because 10001, 10101, and 10201 are composite and 10301 is prime.
a(6) = 29, because 29 is the smallest k such that 1000000//k//0000001 is prime. The decimal expansion of that prime is 1000000290000001.
		

Crossrefs

Programs

  • Mathematica
    Table[k = 0; d = IntegerDigits[10^n]; While[! PrimeQ@ FromDigits@ Join[d, IntegerDigits@ k, Reverse@ d], k++]; k, {n, 0, 65}] (* Michael De Vlieger, Aug 26 2015 *)
  • PARI
    a(n) = x=10^n; k=0; while(!ispseudoprime(eval(Str(x, k, concat(Vecrev(Str(x)))))), k++); k
    
  • Perl
    use ntheory ":all"; for my $n (0..50) { my($t,$c)=(0); $t++ while $c=1 . 0 x $n . $t . 0 x $n . 1, !is_prob_prime($c); say "$n $t"; } # Dana Jacobsen, Oct 02 2015

A345223 a(n) is the smallest k >= 0 such that the decimal concatenation 1 (n times) || k || 1 (n times) is a prime, or -1 if no such k exists.

Original entry on oeis.org

0, 3, 4, 8, 10, 8, 5, 21, 1, 6, 1, 116, 23, 6, 73, 24, 16, 62, 3, 10, 19, 53, 61, 58, 191, 9, 265, 12, 133, 86, 141, 4, 7, 39, 193, 31, 51, 13, 31, 6, 31, 53, 287, 139, 4, 239, 187, 25, 18, 144, 31, 38, 93, 86, 27, 30, 16, 24, 6, 356, 50, 91, 395, 117, 217, 61
Offset: 1

Views

Author

Felix Fröhlich, Jun 11 2021

Keywords

Comments

a(n) = 0 only for n = 1, since A138148(1) = 101 is the only prime in A138148.
a(n) = 1 iff n is of the form (A004023(i)-1)/2 for some i >= 1.
No term equals 2, see second comment in A258372.

Examples

			For n = 3: 1110111, 1111111, 1112111 and 1113111 are all composite, while 1114111 is prime, so the smallest number that can be inserted between strings of three ones so that the concatenation is prime is 4. Therefore a(3) = 4.
		

Crossrefs

Programs

  • Mathematica
    Table[Module[{k=0},While[!PrimeQ[FromDigits[Flatten[Join[{PadRight[ {},n,1],IntegerDigits[ k],PadRight[{},n,1]}]]]],k++];k],{n,70}] (* Harvey P. Dale, Jun 03 2024 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    a(n) = my(v=vector(n, t, 1), d, w=[]); for(k=0, oo, d=digits(k); w=concat(v, d); w=concat(w, v); if(ispseudoprime(eva(w)), return(k)))
    
  • Python
    from sympy import isprime
    def a(n, d=1):
        k, bread = 0, str(d)*n
        while not isprime(int(bread + str(k) + bread)): k += 1
        return k
    print([a(n) for n in range(1, 67)]) # Michael S. Branicky, Jun 11 2021
Showing 1-3 of 3 results.