OFFSET
1,2
COMMENTS
Consider numbers of the form 1, 12, 123, 1234, ..., N. Find the highest power of 7^p such that 7^p < N. Then p = [log(N)/log(7)] and for 0 <= qi <= 6 [N/7^p] = q1 + r1 [r1/7^(p-1)] = q2 + r2 ........................ rp/7^1 = qp + rp+1 rp+1/7^0 = qp+1 0 For N = 1234, p = [log(1234)/log(7)] = 3 division quot rem 1234/7^3 = 3 205 205/7^2 = 4 9 9/7^1 = 1 2 2/7^0 = 2 0 The sequence of quotients, top down, forms the entry in the table for 1234. Obviously this algorithm works for any N.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..318
FORMULA
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Cino Hilliard, Aug 29 2004
STATUS
approved