login
A353309
The maximum sum of base-3 digits occurring among all numbers reached after n, when iterating map x -> A353313(x) starting from x=n, or -1 if no finite cycle is ever reached.
2
0, 2, 18, 2, 2, 18, 18, 6, 18, 2, 18, 5, 2, 18, 6, 18, 6, 18, 18, 18, 5, 6, 18, 5, 18, 6, 18, 2, 5, 6, 18, 18, 18, 5, 18, 5, 2, 6, 18, 18, 5, 13, 6, 13, 6, 18, 8, 18, 6, 5, 6, 18, 6, 18, 18, 18, 8, 18, 5, 18, 5, 18, 5, 6, 6, 18, 18, 18, 8, 5, 13, 5, 18, 18, 13, 6, 13, 18, 18, 8, 18, 2, 18, 18, 5, 6, 13, 6, 13, 6
OFFSET
0,2
LINKS
EXAMPLE
When starting iterating A353313 from n=7, we obtain -> 14 -> 25 -> 44 -> 75 -> 25 -> 44 -> 75 -> 25 -> etc, ad infinitum. Applying A053735 to all distinct terms encountered after 7, that is [14, 25, 44, 75] gives us base-3 digit sums [4, 5, 6, 5], therefore a(7) = 6, which is the largest sum.
PROG
(PARI)
A053735(n) = sumdigits(n, 3);
A353313(n) = { my(r=(n%3)); if(!r, n/3, ((5*((n-r)/3)) + r + 3)); };
A353309(n) = { my(visited = Map(), m=0); for(j=1, oo, n = A353313(n); m=max(m, A053735(n)); if(mapisdefined(visited, n), return(m), mapput(visited, n, j))); };
CROSSREFS
Cf. also A352895.
Sequence in context: A279883 A266166 A077452 * A113918 A253603 A094048
KEYWORD
nonn,look
AUTHOR
Antti Karttunen, Apr 13 2022
STATUS
approved