login
The number of n-digit near-repdigit primes (A164937).
1

%I #30 Jul 19 2021 21:01:16

%S 0,0,46,43,40,53,35,49,40,38,44,52,35,45,49,42,38,57,27,45,38,47,37,

%T 52,33,45,56,38,36,65,29,56,48,40,38,58,37,33,57,40,37,61,41,39,37,44,

%U 36,55,47,43,47,43,35,62,43,46,29,35,37,56,39,41,46,48,39,74,45,34,34,35,34,67

%N The number of n-digit near-repdigit primes (A164937).

%C The average is 44.25 with a standard deviation of about 9.48 for the first 1000 terms.

%C First occurrence of 20 < k < 80: 1132, ??22??, 1304, 433, 141, 181, 19, 118, 31, 253, 357, 137, 25, 68, 7, 29, 23, 10, 44, 5, 43, 16, 4, 11, 14, 3, 22, 33, 8, 139, 82, 12, 6, 102, 48, 27, 18, 36, 270, 198, 42, 54, 498, 90, 30, 738, 72, 222, 192, 852, 84, 342, ??73??, 66, ??75??, 816, 264, ??78??, 298; where ??xx?? denotes an unknown value for the index xx.

%C Roughly speaking, the probability that a random n-digit number is prime is about 1/(n*log(10)). The number of near-repdigit n-digit numbers is 81*n. Therefore it would be reasonable to expect around 81/log(10) (about 35) primes for each n. - _Giovanni Resta_, Jun 19 2015

%H Robert G. Wilson v, <a href="/A258915/b258915.txt">Table of n, a(n) for n = 1..1532</a>

%e a(1) & a(2) = 0 by definition.

%e a(3) = 46 since there are 46 terms of 3 digits, see A164937(1) - A164937(46).

%t f[n_] := Block[{lst = {}, r = (10^(n - 1) - 1)/9}, Do[ AppendTo[ lst, DeleteCases[ Select[ FromDigits[ Permutations[ Append[ IntegerDigits[ a*r], d]]], PrimeQ@# && # > 100 &], r]], {a, 9}, {d, 0, 9}]; Length@ Union@ Flatten@ lst](* adapted after _Arkadiusz Wesolowski_ of A164937 *) Array[f, 70]

%t (* to view the terms assign the terms in the b-file to "lst" and then *) ListPlot@ Sort@ lst (* and/or *) g[n_] := Count[lst, n]; DiscretePlot[ g[n], {n, 23, 80}]

%Y Cf. A164937.

%K nonn

%O 1,3

%A _Robert G. Wilson v_, Jun 14 2015