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.

A327820 Smallest prime with n holes in its decimal digits.

This page as a plain text file.
%I A327820 #50 Sep 27 2019 15:46:56
%S A327820 2,19,83,89,809,1889,4889,46889,48889,468889,688889,3888889,4888889,
%T A327820 28888889,88884889,288888889,808888889,4488888889,8688888889,
%U A327820 48808888889,48888888889,288888888889,888088888889,1888888888889,4888888888889,48808888888889,88848888888889
%N A327820 Smallest prime with n holes in its decimal digits.
%C A327820 Smallest prime p such that A064692(p) = n. Also record-holders in A327462. - _Felix Fröhlich_, Sep 27 2019
%C A327820 The sequence is not monotonically increasing: a(32) > a(33). - _Giovanni Resta_, Sep 27 2019
%H A327820 Giovanni Resta, <a href="/A327820/b327820.txt">Table of n, a(n) for n = 0..100</a>
%t A327820 s[0] = {1,2,3,5,7}; s[1] = {0,4,6,9}; s[2] = {8}; m[{sn_, t_}] := Union[Sort /@ Tuples[s[sn], {t}]]; f[nd_, nh_] := Block[{v, pa = Tally /@ IntegerPartitions[ nh, {nd}, {0, 1, 2}], bst = Infinity}, Do[v = Flatten /@ Tuples[m /@ p]; Do[z = Select[ FromDigits /@ Select[ Permutations[e], First[#] > 0 && OddQ[Last[#]] &], PrimeQ]; bst = Min[bst, {z}], {e, v}], {p, pa}]; bst]; a[0]=2; a[n_] := Block[{nd = Ceiling[(n + 1)/2], b}, While[! IntegerQ@ (b = f[nd, n]), nd++]; b]; a /@ Range[0, 30] (* _Giovanni Resta_, Sep 27 2019 *)
%o A327820 (PARI) count_holes(n) = my(d=digits(n), i=0); for(k=1, #d, if(d[k]==0 || d[k]==4 || d[k]==6 || d[k]==9, i++, if(d[k]==8, i+=2))); i
%o A327820 a(n) = forprime(p=1, , if(count_holes(p)==n, return(p))) \\ _Felix Fröhlich_, Sep 27 2019
%Y A327820 Cf. A064692, A249572, A250256, A327462.
%K A327820 nonn,base
%O A327820 0,1
%A A327820 _Andrew Heathwaite_, Sep 26 2019
%E A327820 a(7) corrected and more terms added by _Felix Fröhlich_, Sep 27 2019
%E A327820 More terms from _Giovanni Resta_, Sep 27 2019