OFFSET
0,2
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
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..19683
FORMULA
EXAMPLE
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.
PROG
(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
(PARI)
A353314(n) = { my(r=(n%3)); if(!r, n, ((5*((n-r)/3)) + r + 3)); };
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Nicholas Drozd, Dec 03 2021
EXTENSIONS
Definition corrected and more terms from Antti Karttunen, Apr 14 2022
STATUS
approved