

A268338


Numbers that cycle under the following transformation: if m is even, divide by 2, if m is congruent to 1 mod 4, multiply by 3 and add 1; if m is congruent to 3 mod 4, multiply by 7 and add 1.


0




OFFSET

1,2


COMMENTS

Some numbers appear to grow indefinitely under these rules, but it is possible that they may eventually cycle at some point. All numbers up to 50 either cycle or transform to another number that cycles (typically 1). 51 is the first open case: it may eventually cycle or may continue to grow indefinitely.


LINKS

Table of n, a(n) for n=1..9.


EXAMPLE

23 is a member of this sequence. 23 is congruent to 3 mod 4. As a result, 23 transforms to 23*7+1 = 162. From there 162 > 81 > 244 > 122 > 61 > 184 > 92 > 46 > 23. 23 is the least member of this cycle.
49 is not a member of this sequence because it eventually reduces to 19, which cycles.


PROG

(Python)
a = 1
b = 1
prev = []
keep = []
count = 0
while b < 51:
....keep.append(a)
....flag1 = False
....flag2 = False
....if a % 2 == 0:
........a /= 2
....elif a % 4 == 1:
........a = a*3+1
....else:
........a = a*7+1
....if count > 50:
........b += 1
........a = b
........count = 0
........keep = []
....if keep.count(a) == 2 and a not in prev and a <= 50:
........prev.append(a)
........count = 0
........keep = []
........b += 1
........a = b
....count += 1
print(sorted(prev))
# David Consiglio, Jr., Feb 01 2016


CROSSREFS

Cf. A267703, A267970, A267969, A006666, A006370, A005186, A267970, A232711.
Sequence in context: A273553 A153691 A184308 * A171735 A201379 A056727
Adjacent sequences: A268335 A268336 A268337 * A268339 A268340 A268341


KEYWORD

nonn,more


AUTHOR

David Consiglio, Jr., Feb 01 2016


EXTENSIONS

Corrected and edited by David Consiglio, Jr., Apr 20 2016


STATUS

approved



