A364714 Least positive integer whose average digit in base b equals (b-1)/2 (the expected value for random digits) for 2 <= b <= n.
2, 38, 141, 3468, 36990, 36990
Offset: 2
Examples
For n = 4, 141 is 10001101 in binary with average digit 1/2, 12020 in base 3 with average digit 2/2 = 1, and 2031 in base 4 with average digit 3/2. No smaller number has this property, so a(4) = 141.
Crossrefs
Programs
-
PARI
isokb(k, b) = my(d=digits(k,b)); vecsum(d)/#d == (b-1)/2; isok(k, n) = for (b=2, n, if (!isokb(k, b), return(0));); 1; a(n) = my(k=1); while (!isok(k, n), k++); k; \\ Michel Marcus, Aug 05 2023
Comments