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.

A268707 Smallest n-digit prime having at least n-1 digits equal to 9.

This page as a plain text file.
%I A268707 #17 Mar 21 2016 12:44:59
%S A268707 2,19,199,1999,49999,199999,2999999,19999999,799999999,9199999999,
%T A268707 59999999999,959999999999,9919999999999,59999999999999,
%U A268707 499999999999999,9299999999999999,99919999999999999,994999999999999999,9991999999999999999,29999999999999999999
%N A268707 Smallest n-digit prime having at least n-1 digits equal to 9.
%H A268707 Michel Lagneau, Michael De Vlieger and Robert G. Wilson v, <a href="/A268707/b268707.txt">Table of n, a(n) for n = 1..1225</a>
%t A268707 f[n_] := Block[{k = 0, p = {}, r = (10^n - 1), s = Range@ 10 - 10}, While[k < n - 0, AppendTo[p, Select[r + 10^k*s, PrimeQ]]; k++]; p = Min@ Flatten@ p]; Array[f, 20]
%o A268707 (PARI) a(n)=my(t=10^n-1,p); forstep(d=n-1,0,-1, forstep(k=8,1,-1, p=t-10^d*k; if(ispseudoprime(p), return(p)))); -1 \\ _Charles R Greathouse IV_, Mar 21 2016
%Y A268707 Cf. A037071, A241100, A268702 - A268706, A241206, A266148.
%K A268707 nonn,base
%O A268707 1,1
%A A268707 _Michel Lagneau_, _Michael De Vlieger_ and _Robert G. Wilson v_, Feb 11 2016