A337497 a(n) is the smallest integer k with exactly n bases b such that k in base b contains the digit b-1; or -1 if there is no such integer.
0, 1, 2, 5, 7, 11, 19, 39, 23, 69, 103, 47, 59, 125, 95, 143, 119, 179, 299, 251, 335, 527, 239, 419, 599, 359, 479, 1019, 671, 1619, 1727, 959, 719, 1319, 839, 2039, 1259, 2771, 2339, 2099, 1439, 5471, 1679, 2159, 3695, 3599, 2879, 5939, 3779, 2519, 4619, 3359, 4319
Offset: 0
Examples
a(7) is 39 because 39 has 7 bases b (which are 2,4,5,8,10,20 and 40) where the digits of n contain the digit b-1 and this does not happen for a smaller integer.
Links
- François Marques, Table of n, a(n) for n = 0..3443
- François Marques, Table of known a(n) values, for n = 0..10000. Unknown values are replaced by a question mark.
Programs
-
Mathematica
mainBaseQ[n_, b_] := MemberQ[IntegerDigits[n, b], b - 1]; basesCount[n_] := Count[Range[2, n + 1], ?(mainBaseQ[n, #] &)]; m = 50; seq = Table[-1, {m}]; c = 0; n = 0; While[c < m, i = basesCount[n]; If[i <= m - 1 && seq[[i + 1]] < 0, c++; seq[[i + 1]] = n]; n++]; seq (* _Amiram Eldar, Sep 01 2020 *)
-
PARI
a(n) = for(k=0,+oo, if(sum(b=2, k+1, vecmax(digits(k, b)) == b-1)==n, return(k)) ); \\ François Marques, Nov 19 2020
Comments