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.

A090465 Smallest number m such that (n+1)*10^m-1 (i.e., n with m nines appended) yields a prime, or -1 if this will always yield a composite number.

This page as a plain text file.
%I A090465 #21 Jun 08 2025 16:15:42
%S A090465 1,0,0,2,0,-1,0,1,-1,1,0,-1,0,1,-1,2,0,-1,0,2,-1,1,0,-1,3,1,-1,4,0,-1,
%T A090465 0,2,-1,1,1,-1,0,1,-1,1,0,-1,0,1,-1,16,0,-1,1,1,-1,3,0,-1,5,1,-1,15,0,
%U A090465 -1,0,2,-1,12,1,-1,0,2,-1,1,0,-1,0,2,-1,1,3,-1,0,1,-1,1,0,-1,1,2,-1,33,0,-1,1,1,-1,3,10,-1,0,3,-1,1,0,-1,0,1,-1,1,0,-1
%N A090465 Smallest number m such that (n+1)*10^m-1 (i.e., n with m nines appended) yields a prime, or -1 if this will always yield a composite number.
%C A090465 The first 9 record holders in this sequence are 1, 4, 25, 28, 46, 88, 374, 416, 466 with the values 1, 2, 3, 4, 16, 33, 57, 70, 203 respectively.
%C A090465 The next 3 record holders are 1342, 1802, 1934 with the values 29711, 45882, 51836 respectively. 4420 may be the next record holder as no solution has been found for it yet. 4420 was tested out to 300000 nines with no prime formed. - _Toshitaka Suzuki_, May 27 2024
%H A090465 Toshitaka Suzuki, <a href="/A090465/b090465.txt">Table of n, a(n) for n = 1..4419</a>
%F A090465 a(p) = 0 for p prime.
%F A090465 a(n) = -1 if n is a proper multiple of 3.
%e A090465 a(25) = 3 because three 9's must be appended to 25 before a prime is formed (25999).
%e A090465 a(6) = -1 because no matter how many 9's are appended to 6, the resulting number is always divisible by 3 and can therefore not be prime.
%p A090465 f:= proc(n) local x,m;
%p A090465   if n mod 3 = 0 and n <> 3 then return -1 fi;
%p A090465   x:= n;
%p A090465   for m from 0 to 10^4 do
%p A090465    if isprime(x) then return m fi;
%p A090465     x:= 10*x+9
%p A090465   od;
%p A090465 fail
%p A090465 end proc:
%p A090465 map(f, [$1..200]); # _Robert Israel_, Jun 05 2024
%o A090465 (PARI) apply( {A090465(n, LIM=500)=n%3 && for(m=0, LIM, ispseudoprime(n) && return(m); n=n*10+9); -(n>3)}, [1..55]) \\ Retun value -1 means that a(n) = -1 or, if n%3 > 0, then possibly a(n) > LIM, the search limit given as second (optional) parameter. - _M. F. Hasler_, Jun 05 2024
%Y A090465 Cf. A083747 (The Wilde Primes, i.e. same operation using ones), A090584 (using threes), A090464 (using sevens).
%K A090465 base,sign
%O A090465 1,4
%A A090465 _Chuck Seggelin_, Dec 02 2003
%E A090465 Definition edited by _M. F. Hasler_, Jun 05 2024