Problem #207
Unlucky base
Given a number a, consider the set S(a) = { a^i : i>=0 } . You create a sorted sequence G formed by taking any number of distinct elements of the set S(a) and adding them. Let the kth smallest number which can be constructed using this for a given a be denoted as (a,k).
Find the answer for (a,k) = (13,423732713), submit your answer modulo 4222236787
The elements of the sequence G go as follows {1, 13, 14, 169, 170, 182, 183 ...}