login
A063871
Trajectory of 3 under map n->7n-1 if n odd, n->n/2 if n even.
3
3, 20, 10, 5, 34, 17, 118, 59, 412, 206, 103, 720, 360, 180, 90, 45, 314, 157, 1098, 549, 3842, 1921, 13446, 6723, 47060, 23530, 11765, 82354, 41177, 288238, 144119, 1008832, 504416, 252208, 126104, 63052, 31526, 15763, 110340, 55170, 27585, 193094, 96547
OFFSET
0,1
LINKS
EXAMPLE
Since 3 is odd, the next term is 7 * 3 - 1 = 20.
And since 20 is even, the next term is 20/2 = 10.
MATHEMATICA
NestList[If[OddQ[#], 7# - 1, #/2] &, 3, 50] (* Harvey P. Dale, Aug 04 2011 *)
PROG
(PARI) { for (n=0, 50, if (n, if(a%2, a=7*a - 1, a/=2), a=3); print1(a, ", ") ) } \\ Harry J. Smith, Sep 01 2009
(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(42)) # Michael S. Branicky, Mar 20 2021
CROSSREFS
Sequence in context: A013332 A223282 A223480 * A084316 A126810 A115280
KEYWORD
nonn,easy
AUTHOR
Jason Earls, Aug 27 2001
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), Aug 29 2001
Title edited by Michael S. Branicky, Mar 20 2021
STATUS
approved