login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A036931 Smallest n-digit prime containing only digits 1 and 4, or 0 if no such prime exists. 2

%I #10 Mar 09 2020 09:12:33

%S 0,11,0,4111,11411,0,1114111,11111141,0,1111111411,11111141411,0,

%T 1111111111441,11111111111411,0,1111111111114441,11111111111414411,0,

%U 1111111111111111111,11111111111111414441,0,1111111111111111144141

%N Smallest n-digit prime containing only digits 1 and 4, or 0 if no such prime exists.

%C For any positive integer k, a(3k) = 0 as any 3k-digit number containing only digits 1 or 4 or both has a digit-sum divisible by 3 and thus the number is divisible by 3. - _Rick L. Shepherd_, Feb 08 2004

%H Jinyuan Wang, <a href="/A036931/b036931.txt">Table of n, a(n) for n = 1..1000</a>

%F a(3k) = 0 and a(A004023(k)) = (10^A004023(k) - 1)/9 = A004022(k) for all positive integers k. - _Rick L. Shepherd_, Feb 08 2004

%t Flatten[Table[Select[FromDigits/@Tuples[{1, 4}, n], PrimeQ, 1], {n, 25}]/.{}->{0}] (* _Jinyuan Wang_, Mar 09 2020 *)

%Y Cf. A020452, A036304, A036229.

%Y Cf. A004022 (repunit primes), A004023.

%K nonn,base

%O 1,2

%A _Patrick De Geest_, Jan 04 1999

%E More terms from _Rick L. Shepherd_, Feb 08 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 07:57 EDT 2024. Contains 371698 sequences. (Running on oeis4.)