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.
%I A037061 #16 Jul 21 2025 00:22:16 %S A037061 2,41,443,4441,44449,444443,24444443,424444441,444444443,4444444447, %T A037061 44444444441,444444444443,14444444444449,440444444444441, %U A037061 2444444444444447,44044444444444441,424444444444444447,4344444444444444449,42444444444444444443,44444444444444444447 %N A037061 Smallest prime containing exactly n 4's. %C A037061 The last digit of n cannot be 4, therefore a(n) must have at least n+1 digits. It is probable that none among [10^n/9]*40 + {1,3,7,9} is prime in which case a(n) must have n+2 digits. We conjecture that for all n >= 0, a(n) equals [10^(n+1)/9]*40 + b with 1 <= b <= 9 and one of the (first) digits 4 replaced by a 0, 1, 2 or 3. - _M. F. Hasler_, Feb 22 2016 %H A037061 M. F. Hasler, <a href="/A037061/b037061.txt">Table of n, a(n) for n = 0..200</a> %F A037061 a(n) = prime(A037060(n)). - _Amiram Eldar_, Jul 21 2025 %t A037061 f[n_, b_] := Block[{k = 10^(n + 1), p = Permutations[ Join[ Table[b, {i, 1, n}], {x}]], c = Complement[Table[j, {j, 0, 9}], {b}], q = {}}, Do[q = Append[q, Replace[p, x -> c[[i]], 2]], {i, 1, 9}]; r = Min[ Select[ FromDigits /@ Flatten[q, 1], PrimeQ[ # ] & ]]; If[r ? Infinity, r, p = Permutations[ Join[ Table[ b, {i, 1, n}], {x, y}]]; q = {}; Do[q = Append[q, Replace[p, {x -> c[[i]], y -> c[[j]]}, 2]], {i, 1, 9}, {j, 1, 9}]; Min[ Select[ FromDigits /@ Flatten[q, 1], PrimeQ[ # ] & ]]]]; Table[ f[n, 4], {n, 1, 18}] %o A037061 (PARI) A037061(n)={my(p, t=10^(n+1)\9*40); forvec(v=[[-1, n], [-4, -1]], nextprime(p=t+10^(n-v[1])*v[2])-p<10 && return(nextprime(p)))} \\ _M. F. Hasler_, Feb 22 2016 %Y A037061 Cf. A065587, A037060, A034388, A036507-A036536. %Y A037061 Cf. A037053, A037055, A037057, A037059, A037063, A037065, A037067, A037069, A037071. %K A037061 nonn,base %O A037061 0,1 %A A037061 _Patrick De Geest_, Jan 04 1999 %E A037061 More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Mar 23 2003 %E A037061 More terms and a(0) = 2 from _M. F. Hasler_, Feb 22 2016