login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A353310 Number of terms encountered when iterating A353313, before reaching the first term that is a part of a finite cycle, or -1 if no finite cycle is ever reached. 4
0, 0, 1, 0, 0, 0, 2, 2, 1, 0, 0, 1, 1, 3, 1, 0, 0, 2, 3, 0, 0, 3, 5, 0, 2, 0, 1, 1, 0, 0, 1, 5, 7, 2, 0, 0, 2, 11, 13, 4, 0, 51, 2, 54, 0, 0, 4, 1, 0, 0, 0, 3, 3, 3, 4, 6, 6, 1, 4, 0, 0, 12, 2, 4, 10, 12, 6, 15, 15, 0, 50, 2, 3, 18, 53, 0, 56, 21, 2, 3, 0, 2, 5, 19, 0, 0, 62, 1, 59, 2, 2, 27, 65, 6, 5, 5, 8, 90, 8 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,7
LINKS
FORMULA
a(n) = A353311(n) - A353312(n).
EXAMPLE
For n = 1, when iterating with A353313, we obtain 1 -> 4 -> 9 -> 3 -> 1 -> etc, thus 1 itself is included in the closed cycle, and therefore a(1) = 0.
For n = 6, when iterating with A353313, we obtain 6 -> 2 -> 5 -> ..., and after 103 more iterations we obtain 5 again (see examples in A353311 and A353312), thus only the two initial numbers, 6 and 2 are outside of the final closed cycle, therefore a(6) = 2.
PROG
(PARI)
A353313(n) = { my(r=(n%3)); if(!r, n/3, ((5*((n-r)/3)) + r + 3)); };
A353310(n) = { my(visited = Map(), p); for(j=0, oo, if(mapisdefined(visited, n, &p), return(p), mapput(visited, n, j)); n = A353313(n)); };
CROSSREFS
Sequence in context: A365573 A370278 A369245 * A347883 A024712 A281497
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 14 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 31 22:56 EDT 2024. Contains 374809 sequences. (Running on oeis4.)