login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = gcd(s1, s2), where s1 is the sum of the odd numbers and s2 is the sum of the even numbers in the Collatz (3x+1)trajectory of n.
3

%I #40 Sep 15 2017 23:29:25

%S 1,1,1,1,6,1,18,1,3,2,1,1,1,2,2,1,2,21,1,6,2,1,3,1,2,1,2,6,2,4,2,1,1,

%T 4,2,3,1,1,2,2,3,2,2,1,1,1,1,1,2,12,2,1,1,2,2,2,1,4,3,4,2,2,2,1,5,1,1,

%U 4,2,2,2,3,1,7,2,1,1,2,2,6,7,1,1,2,2,8

%N a(n) = gcd(s1, s2), where s1 is the sum of the odd numbers and s2 is the sum of the even numbers in the Collatz (3x+1)trajectory of n.

%C Statistics of a(n) for the first 10^6 terms:

%C +------+-----------------+------------+

%C | | number of terms | |

%C | | such that | |

%C | n | gcd(s1, s2) = n | percentage |

%C +------+-----------------+------------+

%C | 1 | 401614 | 40.16% |

%C | 2 | 305471 | 30.54% |

%C | 3 | 44381 | 4.44% |

%C | 4 | 76228 | 7.62% |

%C | 5 | 15966 | 1.60% |

%C | 6 | 34514 | 3.45% |

%C | 7 | 8969 | 0.90% |

%C | 8 | 19156 | 1.92% |

%C | 9 | 4941 | 0.49% |

%C | 10 | 12212 | 1.22% |

%C | 11 | 3316 | 0.33% |

%C | 12 | 8234 | 0.82% |

%C | > 12 | 64998 | 6.50% |

%C +------+-----------------+------------+

%C It seems that the values of the third column oscillate infinitely when n tend towards infinity.

%C Records: 1, 6, 18, 21, 23, 93, 187, 560, 1730, 5098, 10552, 11060, 11657, 31072, 32468, 306770, 793906, 1956888, 3107101, 12210181, etc.; they appear at 1, 5, 7, 18, 133, 147, 186, 270, 839, 5090, 5244, 5488, 23255, 62132, 113624, 153341, 793842, 6849034, 9321240, 12210146, etc. - _Robert G. Wilson v_, Oct 03 2016

%H Michel Lagneau, <a href="/A277068/b277068.txt">Table of n, a(n) for n = 1..10000</a>

%H Robert G. Wilson v, <a href="/A277068/a277068.txt">The first occurrence of a(n)</a>

%e a(5)=6 because the Collatz trajectory of 5 is 5 -> 16 -> 8 -> 4 -> 2 -> 1 => s1 = 5+1 = 6, s2 = 16+8+4+2 = 30, and gcd(6, 30) = 6.

%p nn:=10^7:

%p for n from 1 to 100 do:

%p m:=n:s1:=0:s2:=0:

%p for i from 1 to nn while(m<>1) do:

%p if irem(m,2)=0

%p then

%p s2:=s2+m:m:=m/2:

%p else

%p s1:=s1+m:m:=3*m+1:

%p fi:

%p od:

%p x:=gcd(s1+1,s2): printf(`%d, `,x):

%p od:

%t Collatz[n_] := NestWhileList[ If[ OddQ[#], 3#+1, #/2] &, n, # > 1 &]; f[n_] := Block[{c = Collatz@ n}, GCD[Plus @@ Select[c, OddQ], Plus @@ Select[c, EvenQ]]]; Array[f, 86] (* _Robert G. Wilson v_, Oct 03 2016 *)

%o (PARI) a(n) = {my(se = 0); my(so = 0); while (n!=1, if (n % 2, so+=n; n = 3*n+1, se +=n; n = n/2);); gcd(se, so+1);} \\ _Michel Marcus_, Oct 03 2016

%Y Cf. A213909, A213916, A271973.

%K nonn

%O 1,5

%A _Michel Lagneau_, Sep 28 2016