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.

A178007 Largest n-digit prime with the most digits equal to 9.

This page as a plain text file.
%I A178007 #14 Dec 20 2024 11:56:48
%S A178007 7,97,997,9949,99991,999979,9999991,99999989,999999929,9999999929,
%T A178007 99999999599,999999999989,9999999999799,99999999999959,
%U A178007 999999999999989,9999999999999199,99999999999999997,999999999999999989,9999999999999999919,99999999999999999989,999999999999999999899,9999999999999999999929
%N A178007 Largest n-digit prime with the most digits equal to 9.
%C A178007 First maximum the number of 9's, then choose the largest.
%C A178007 From _Robert Israel_, Dec 18 2024: (Start)
%C A178007 This is believed to be different from A241206, as there should be infinitely many n for which there is no n-digit prime with n-1 digits equal to 9.  No examples are known; the least such n is greater than 3400. (End)
%H A178007 Robert Israel, <a href="/A178007/b178007.txt">Table of n, a(n) for n = 1..996</a>
%p A178007 f:= proc(n) local i,j,a,b,x,y;
%p A178007      x:= 10^n-1;
%p A178007      for i from 0 to n-1 do
%p A178007        for a from 1 to 9 do
%p A178007          y:= x - a*10^i;
%p A178007          if isprime(y) then return y fi;
%p A178007      od od;
%p A178007      for i from 1 to n-1 do
%p A178007        for a from 1 to 9 do
%p A178007          for j from 0 to i-1 do
%p A178007            for b from 1 to 9 do
%p A178007              y:= x - a*10^i - b*10^j;
%p A178007              if isprime(y) then return y fi
%p A178007     od od od od;
%p A178007     FAIL
%p A178007 end proc:
%p A178007 map(f, [$1..30]); # _Robert Israel_, Dec 16 2024
%Y A178007 Cf. A037071, A105975, A003618, A241206, A266148.
%K A178007 nonn,base
%O A178007 1,1
%A A178007 _Lekraj Beedassy_, May 17 2010
%E A178007 Corrected and more terms by _Robert Israel_, Dec 16 2024