A096240 Number of n-digit base-7 deletable primes.
3, 7, 21, 59, 184, 534, 1620, 4889, 15607, 50138, 165569, 551580, 1860565, 6345080
Offset: 1
Programs
-
Mathematica
b = 7; a = {3}; d = {2, 3, 5}; For[n = 2, n <= 7, n++, p = Select[Range[b^(n - 1), b^n - 1], PrimeQ[#] &]; ct = 0; For[i = 1, i <= Length[p], i++, c = IntegerDigits[p[[i]], b]; For[j = 1, j <= n, j++, t = Delete[c, j]; If[t[[1]] == 0, Continue[]]; If[MemberQ[d, FromDigits[t, b]], AppendTo[d, p[[i]]]; ct++; Break[]]]]; AppendTo[a, ct]]; a (* Robert Price, Nov 12 2018 *)
Extensions
9 more terms from Ryan Propper, Jul 19 2005
Comments