|
|
A261234
|
|
a(n) = number of steps to reach (3^n)-1 when starting from k = (3^(n+1))-1 and repeatedly applying the map that replaces k with k - (sum of digits in base-3 representation of k).
|
|
11
|
|
|
1, 2, 5, 12, 29, 74, 196, 530, 1445, 3956, 10862, 29901, 82592, 229233, 639967, 1797288, 5073707, 14381347, 40890492, 116559600, 333043360, 953890490, 2738788806, 7881915828, 22729464587, 65652788211, 189866467219, 549596773550, 1592118137130, 4615680732717, 13392399641613, 38894563977633, 113074467549440, 329080350818600, 958725278344368, 2795854777347489
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
Table[Length@ NestWhileList[# - Total@ IntegerDigits[#, 3] &, 3^(n + 1) - 1, # > 3^n - 1 &] - 1, {n, 0, 16}] (* Michael De Vlieger, Jun 27 2016 *)
|
|
PROG
|
(Scheme, three variants)
(definec (A261234 n) (let ((end (- (A000244 n) 1))) (let loop ((k (- (A000244 (+ 1 n)) 1)) (s 0)) (if (= k end) s (loop (* 2 (A054861 k)) (+ 1 s))))))
|
|
CROSSREFS
|
Cf. A261235 (first differences of this sequence).
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|