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.

A353312 Size of the finite cycle eventually reached by iterating A353313, or -1 if no finite cycle is ever reached.

Original entry on oeis.org

1, 4, 103, 4, 4, 103, 103, 3, 103, 4, 103, 3, 4, 103, 3, 103, 6, 103, 103, 103, 3, 3, 103, 3, 103, 3, 103, 4, 3, 6, 103, 103, 103, 3, 103, 3, 4, 3, 103, 103, 3, 3, 3, 3, 3, 103, 3, 103, 6, 3, 6, 103, 6, 103, 103, 103, 6, 103, 3, 103, 3, 103, 3, 3, 3, 103, 103, 103, 6, 3, 3, 3, 103, 103, 3, 3, 3, 103, 103, 3, 103
Offset: 0

Views

Author

Antti Karttunen, Apr 13 2022

Keywords

Examples

			Starting from n=2 and iterating A353313, we obtain the following 104 terms [2, 5, 10, 19, 34, 59, 100, 169, 284, 475, 794, 1325, 2210, 3685, 6144, 2048, 3415, 5694, 1898, 3165, 1055, 1760, 2935, 4894, 8159, 13600, 22669, 37784, 62975, 104960, 174935, 291560, 485935, 809894, 1349825, 2249710, 3749519, 6249200, 10415335, 17358894, 5786298, 1928766, 642922, 1071539, 1785900, 595300, 992169, 330723, 110241, 36747, 12249, 4083, 1361, 2270, 3785, 6310, 10519, 17534, 29225, 48710, 81185, 135310, 225519, 75173, 125290, 208819, 348034, 580059, 193353, 64451, 107420, 179035, 298394, 497325, 165775, 276294, 92098, 153499, 255834, 85278, 28426, 47379, 15793, 26324, 43875, 14625, 4875, 1625, 2710, 4519, 7534, 12559, 20934, 6978, 2326, 3879, 1293, 431, 720, 240, 80, 135, 45, 15] before the iteration returns to 5 again, in other words, forming a finite cycle of length 103, therefore a(2) = 103.
		

Crossrefs

Programs

  • PARI
    A353313(n) = { my(r=(n%3)); if(!r,n/3,((5*((n-r)/3)) + r + 3)); };
    A353312(n) = { my(visited = Map()); for(j=1, oo, if(mapisdefined(visited, n), return(j-mapget(visited, n)), mapput(visited, n, j)); n = A353313(n)); };

Formula

a(n) = A353311(n) - A353310(n).