OFFSET
0,1
MATHEMATICA
NestList[If[EvenQ[#], #/2, 9#+1]&, 3, 50] (* Harvey P. Dale, Sep 06 2022 *)
PROG
(Python)
from itertools import accumulate
def f(n, _): return 9*n+1 if n%2 == 1 else n//2
def aupton(terms): return list(accumulate([3]*terms, f))
print(aupton(48)) # Michael S. Branicky, Mar 28 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved