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.

Showing 1-3 of 3 results.

A353313 If n is of the form 3k, then a(n) = k, and if n is of the form 3k+r, with r = 1 or 2, then a(n) = 5*k + 3 + r.

Original entry on oeis.org

0, 4, 5, 1, 9, 10, 2, 14, 15, 3, 19, 20, 4, 24, 25, 5, 29, 30, 6, 34, 35, 7, 39, 40, 8, 44, 45, 9, 49, 50, 10, 54, 55, 11, 59, 60, 12, 64, 65, 13, 69, 70, 14, 74, 75, 15, 79, 80, 16, 84, 85, 17, 89, 90, 18, 94, 95, 19, 99, 100, 20, 104, 105, 21, 109, 110, 22, 114, 115, 23, 119, 120, 24, 124, 125, 25, 129, 130, 26
Offset: 0

Views

Author

Antti Karttunen, Apr 13 2022

Keywords

Comments

It is conjectured that all iterations of this sequence starting from any n >= 0 will eventually reach a finite cycle, which by necessity then contains at least one multiple of three. See Drozd links and A349876.

Crossrefs

Cf. A353305 (the smallest number reached after the starting point n), A353309 (the largest base-3 digit sum reached after the starting point n).

Programs

  • Mathematica
    Table[With[{c=Mod[n,3]},If[c==0,n/3,(5n-2c+9)/3]],{n,0,80}]  (* Harvey P. Dale, Aug 09 2025 *)
  • PARI
    A353313(n) = { my(r=(n%3)); if(!r,n/3,((5*((n-r)/3)) + r + 3)); };

A353311 Number of distinct terms encountered when A353313 is iterated, or -1 if the iteration never reaches a finite cycle.

Original entry on oeis.org

1, 4, 104, 4, 4, 103, 105, 5, 104, 4, 103, 4, 5, 106, 4, 103, 6, 105, 106, 103, 3, 6, 108, 3, 105, 3, 104, 5, 3, 6, 104, 108, 110, 5, 103, 3, 6, 14, 116, 107, 3, 54, 5, 57, 3, 103, 7, 104, 6, 3, 6, 106, 9, 106, 107, 109, 12, 104, 7, 103, 3, 115, 5, 7, 13, 115, 109, 118, 21, 3, 53, 5, 106, 121, 56, 3, 59, 124, 105
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, therefore a(2) = 104.
		

Crossrefs

Programs

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

Formula

a(n) = A353310(n) + A353312(n).
a(n) > A349877(n) for all n.

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.

Original entry on oeis.org

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
Offset: 0

Views

Author

Antti Karttunen, Apr 14 2022

Keywords

Examples

			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.
		

Crossrefs

Programs

  • 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)); };

Formula

a(n) = A353311(n) - A353312(n).
Showing 1-3 of 3 results.