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.

A036945 Smallest n-digit prime containing only the digits 4 and 9, or 0 if no such prime exists.

This page as a plain text file.
%I A036945 #21 Aug 20 2021 15:14:03
%S A036945 0,0,449,4999,44449,444449,4444949,44444999,444499949,4444444999,
%T A036945 44444449949,444444494449,4444449444949,44444444449499,
%U A036945 444444444499499,4444444444444999,44444444444444999,444444444449449949
%N A036945 Smallest n-digit prime containing only the digits 4 and 9, or 0 if no such prime exists.
%H A036945 David A. Corneth, <a href="/A036945/b036945.txt">Table of n, a(n) for n = 1..538</a>
%e A036945 44449 is the least prime of 5 digits containing just digits 4 and 9 so a(5) = 44449. - _David A. Corneth_, Oct 10 2019
%t A036945 Join[{0,0},Table[SelectFirst[10*FromDigits[#]+9&/@Tuples[{4,9},n],PrimeQ],{n,2,20}]] (* _Harvey P. Dale_, Aug 20 2021 *)
%o A036945 (PARI) a(n) = my(s=4*(10^(n)-1)/9);forstep(i=1, 2^n-1, 2, fr = fromdigits(5 * binary(i)) + s; if(isprime(fr), return(fr))); 0 \\ _David A. Corneth_, Oct 10 2019
%Y A036945 Cf. A036229, A020466, A036319, A036929-A036951.
%K A036945 nonn,base
%O A036945 1,3
%A A036945 _Patrick De Geest_, Jan 04 1999