login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 3

%I #43 May 21 2022 17:37:46

%S 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,

%T 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,

%U 2,42,1,14,1,262,2,22,-1,3,9,2,33,73,1,3,1,2,3,-1,2,2,1

%N 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.

%C a(2) = -1 (see second comment in A258372).

%C a(n) = -1 if n > 0 is in A099814 (see fourth comment in A004022).

%C 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).

%C 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.

%C a(n) = 1 if there exists an integer x such that n = (A002275(A004023(x))-A011557(x)-1)/10.

%C From _Chai Wah Wu_, Nov 07 2019: (Start)

%C 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.

%C a(n) = -1 if n = (10^k+1)(10^m-1)/9 for some m > 0, k >= 0.

%C (End)

%C a(140) > 20000. - _Hans Havermann_, May 21 2022

%H Hans Havermann, <a href="/A272232/b272232.txt">Table of n, a(n) for n = 0..139</a>

%e a(0) = 1 since 101 is prime; a(1) refers to the prime 1111111111111111111.

%e a(124) = -1 because R_k//124//R_k is divisible by 125*10^k-1.

%t 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 *)

%o (PARI) a(n) = my(k=1); while(!ispseudoprime(eval(Str((10^k-1)/9, n, (10^k-1)/9))), k++); k

%Y Cf. A000042, A002275, A056524, A098814, A004023, A258372, A306861.

%K sign,base

%O 0,2

%A _Felix Fröhlich_, Apr 23 2016

%E a(35)-a(80) from _Giovanni Resta_, May 01 2016

%E Escape clausae value changed to -1 by _N. J. A. Sloane_, May 17 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 00:00 EDT 2024. Contains 371696 sequences. (Running on oeis4.)