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.

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

This page as a plain text file.
%I A112386 #33 Jun 20 2024 02:42:20
%S A112386 11,211,31,41,511111,61,71,811,911,101,1111111111111111111,
%T A112386 121111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111,
%U A112386 131,14111111111,151,16111,1711111111,181,191,2011,211,22111,2311,241
%N A112386 Smallest prime obtained by appending one or more 1's to n, -1 if no such prime exists.
%C A112386 a(37) = -1 since there is a covering of the set {371, 3711, 37111, ...} by the prime moduli 3, 7, 13, 37. Hence, there are infinitely many values -1 in the sequence (at 371, 3711, 37111, ...). - _Emmanuel Vantieghem_, Oct 27 2022
%C A112386 a(38) = -1 because 38 followed by m >= 1 1's is divisible by 3 or 37 or by (7*10^k-1)/3 if m = 3k. - _Toshitaka Suzuki_, Nov 07 2023
%H A112386 Toshitaka Suzuki, <a href="/A112386/b112386.txt">Table of n, a(n) for n = 1..55</a>
%e A112386 a(5) = 511111 because 51, 511, 5111 and 51111 are not primes.
%t A112386 f[n_] := Block[{k = 1, e = Floor[Log[10, n] + 1]}, While[ !PrimeQ[n*10^k + (10^k - 1)/9], k++ ]; n*10^k + (10^k - 1)/9]; Array[f, 24] (* _Robert G. Wilson v_, Dec 05 2005 *)
%t A112386 Table[SelectFirst[Table[FromDigits[PadRight[IntegerDigits[k],n,1]],{n,IntegerLength[k]+1,250}],PrimeQ],{k,25}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Nov 30 2017 *)
%Y A112386 Cf. A030430, A069568.
%K A112386 nonn,base
%O A112386 1,1
%A A112386 Michel Dauchez (mdzdm(AT)yahoo.fr), Dec 04 2005
%E A112386 Edited, corrected and extended by _Robert G. Wilson v_, Dec 05 2005
%E A112386 Name edited by _Emmanuel Vantieghem_, Oct 27 2022