cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A353309 #10 Apr 15 2022 10:32:58
%S A353309 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,
%T A353309 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,
%U A353309 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
%N 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.
%H A353309 Antti Karttunen, <a href="/A353309/b353309.txt">Table of n, a(n) for n = 0..19683</a>
%e A353309 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.
%o A353309 (PARI)
%o A353309 A053735(n) = sumdigits(n, 3);
%o A353309 A353313(n) = { my(r=(n%3)); if(!r,n/3,((5*((n-r)/3)) + r + 3)); };
%o A353309 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))); };
%Y A353309 Cf. A053735, A353313.
%Y A353309 Cf. also A352895.
%K A353309 nonn,look
%O A353309 0,2
%A A353309 _Antti Karttunen_, Apr 13 2022