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-4 of 4 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)); };

A349877 a(n) is the number of times the map x -> A353314(x) needs to be applied to n to reach a multiple of 3, or -1 if the trajectory never reaches a multiple of 3.

Original entry on oeis.org

0, 2, 14, 0, 1, 13, 0, 4, 1, 0, 12, 3, 0, 1, 3, 0, 4, 1, 0, 11, 2, 0, 1, 2, 0, 2, 1, 0, 2, 3, 0, 1, 3, 0, 10, 1, 0, 4, 5, 0, 1, 7, 0, 3, 1, 0, 3, 2, 0, 1, 2, 0, 2, 1, 0, 2, 4, 0, 1, 9, 0, 3, 1, 0, 3, 4, 0, 1, 5, 0, 6, 1, 0, 4, 2, 0, 1, 2, 0, 2, 1, 0, 2, 7, 0, 1, 4, 0, 6, 1, 0, 6, 3, 0, 1, 3, 0, 5, 1, 0, 8, 2, 0
Offset: 0

Views

Author

Nicholas Drozd, Dec 03 2021

Keywords

Comments

Equally, number of iterations of A353313 needed to reach a multiple of 3, or -1 if no multiple of 3 is ever reached. - Antti Karttunen, Apr 14 2022

Examples

			a(1) = 2 : 1 -> 4 -> 9 (as it takes two applications of A353314 to reach a multiple of three),
a(2) = 14 : 2 -> 5 -> 10 -> 19 -> 34 -> 59 -> 100 -> 169 -> 284 -> 475 -> 794 -> 1325 -> 2210 -> 3685 -> 6144
a(3) = 0 : 3 (as the starting point 3 is already a multiple of 3).
a(4) = 1 : 4 -> 9
a(7) = 4 : 7 -> 14 -> 25 -> 44 -> 75.
		

Crossrefs

Programs

  • PARI
    A353314(n) = { my(r=(n%3)); if(!r,n,((5*((n-r)/3)) + r + 3)); };
    A349877(n) = { my(k=0); while(n%3, k++; n = A353314(n)); (k); }; \\ Antti Karttunen, Apr 14 2022
  • Python
    import itertools
    def f(n):
        for i in itertools.count():
            quot, rem = divmod(n, 3)
            if rem == 0:
                return i
            n = (5 * quot) + rem + 3
    

Formula

From Antti Karttunen, Apr 14 2022: (Start)
If A010872(n) = 0 then a(n) = 0, otherwise a(n) = 1 + a(A353314(n)).
a(n) < A353311(n) for all n.
(End)

Extensions

Definition corrected and more terms from Antti Karttunen, Apr 14 2022

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).

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).
Showing 1-4 of 4 results.