A137269 Number of primes with maximal digit product for a digit sum of n.
0, 1, 1, 2, 1, 0, 2, 1, 0, 1, 2, 0, 5, 1, 0, 4, 3, 0, 8, 2, 0, 2, 2, 0, 10, 1, 0, 5, 4, 0, 8, 1, 0, 4, 2, 0, 17, 151, 0, 7, 4, 0, 13, 3, 0, 812, 3, 0, 17, 4, 0, 12, 1, 0, 13, 1, 0, 6, 2, 0, 18, 1, 0, 11, 1000, 0, 24, 2, 0, 5, 1, 0, 25, 1, 0, 10, 2, 0, 23, 2, 0, 9, 1
Offset: 1
Examples
a(19)=8 and a(20)=2 because we respectively have the 8 primes 333433, 334333, 343333, 2332333, 2333323, 3223333, 3233323, 3332233 all with a maximal digit product of 3^5*2^2 = 972 for a digit sum of 19 and the 2 primes 3233333, 3333233 with maximal digit product 3^6*2 = 1458 for digit sum 20.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..802
Programs
-
Mathematica
Needs["Combinatorica`"]; Table[If[And[n > 3, Divisible[n, 3]], 0, Length@ MaximalBy[Select[FromDigits /@ Flatten[Map[Permutations, Combinatorica`Partitions@ n], 1] /. x_ /; EvenQ@ x -> Nothing, PrimeQ], Times @@ IntegerDigits@ # &]], {n, 24}] (* Michael De Vlieger, Dec 11 2015, Version 10 *)
Extensions
a(25) and a(28) corrected and a(29)-a(83) added by Chai Wah Wu, Nov 30 2015
Comments