login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A037101
Trajectory of 3 under map n->7n+1 if n odd, n->n/2 if n even.
2
3, 22, 11, 78, 39, 274, 137, 960, 480, 240, 120, 60, 30, 15, 106, 53, 372, 186, 93, 652, 326, 163, 1142, 571, 3998, 1999, 13994, 6997, 48980, 24490, 12245, 85716, 42858, 21429, 150004, 75002, 37501, 262508, 131254, 65627, 459390, 229695, 1607866, 803933
OFFSET
0,1
LINKS
MAPLE
a:= proc(n) option remember; local v;
v:= procname(n-1);
if v::odd then 7*v+1 else v/2 fi
end proc:
a(0):= 3:
map(a, [$0..100]); # Robert Israel, Jan 24 2020
MATHEMATICA
nxt[n_]:=If[OddQ[n], 7n+1, n/2]; NestList[nxt, 3, 40] (* Harvey P. Dale, Jun 05 2012 *)
PROG
(Python)
def iter(n): return 7*n+1 if n%2 == 1 else n//2
def aupton(terms):
alst = [3]
for n in range(1, terms+1): alst.append(iter(alst[-1]))
return alst
print(aupton(43)) # Michael S. Branicky, Mar 22 2021
CROSSREFS
Cf. A063871.
Sequence in context: A122495 A100977 A364163 * A226028 A248626 A360366
KEYWORD
nonn
AUTHOR
STATUS
approved