A290389 Inverse to A290308.
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 3, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 9, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 27, 268435456, 536870912, 1073741824, 2147483648, 4294967296
Offset: 0
Examples
A290308(1) = 0, hence a(0) = 1. A290308(2) = 1, hence a(1) = 2. A290308(3) = 10, hence a(10) = 3. A290308(4) = 2, hence a(2) = 4. A290308(5) = 100, hence a(100) = 5. A290308(6) = 101, hence a(101) = 6. A290308(7) = 1000, hence a(1000) = 7. A290308(8) = 3, hence a(3) = 8. A290308(9) = 20, hence a(20) = 9. A290308(10) = 1001, hence a(1001) = 10.
Links
Programs
-
Mathematica
f[n_] := Function[m, Sum[(1 + Mod[Floor[(8 n + 1 - 9^m)/(8*9^j)], 9]) 10^j, {j, 0, m - 1}]]@ Floor@ Log[9, 8 n + 1]; Block[{nn = 35, s},s = Association@ Array[f@ # -> # &, nn]; {1}~Join~Table[Times @@ MapIndexed[Prime[First[#2]]^#1 &, If[DigitCount[n, 10, 0] > 0, Function[t, Reverse@ Flatten@ Apply[Join, {SplitBy[Take[Reverse@ t, Length@ t - Length@ #],0] /. z_List /; First@ z == 0 :> Most@ z, #}] &@ TakeWhile[t, # == 0 &]]@ Reverse@ IntegerDigits[n], {Lookup[s, n]}]], {n, nn}]] (* Michael De Vlieger, Jul 31 2017 *)
-
PARI
See Links section.
Comments