cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A277068 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.

This page as a plain text file.
%I A277068 #40 Sep 15 2017 23:29:25
%S A277068 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 A277068 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 A277068 4,2,2,2,3,1,7,2,1,1,2,2,6,7,1,1,2,2,8
%N A277068 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 A277068 Statistics of a(n) for the first 10^6 terms:
%C A277068 +------+-----------------+------------+
%C A277068 |      | number of terms |            |
%C A277068 |      |    such that    |            |
%C A277068 |   n  | gcd(s1, s2) = n | percentage |
%C A277068 +------+-----------------+------------+
%C A277068 |    1 |     401614      |   40.16%   |
%C A277068 |    2 |     305471      |   30.54%   |
%C A277068 |    3 |      44381      |    4.44%   |
%C A277068 |    4 |      76228      |    7.62%   |
%C A277068 |    5 |      15966      |    1.60%   |
%C A277068 |    6 |      34514      |    3.45%   |
%C A277068 |    7 |       8969      |    0.90%   |
%C A277068 |    8 |      19156      |    1.92%   |
%C A277068 |    9 |       4941      |    0.49%   |
%C A277068 |   10 |      12212      |    1.22%   |
%C A277068 |   11 |       3316      |    0.33%   |
%C A277068 |   12 |       8234      |    0.82%   |
%C A277068 | > 12 |      64998      |    6.50%   |
%C A277068 +------+-----------------+------------+
%C A277068 It seems that the values of the third column oscillate infinitely when n tend towards infinity.
%C A277068 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 A277068 Michel Lagneau, <a href="/A277068/b277068.txt">Table of n, a(n) for n = 1..10000</a>
%H A277068 Robert G. Wilson v, <a href="/A277068/a277068.txt">The first occurrence of a(n)</a>
%e A277068 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 A277068 nn:=10^7:
%p A277068 for n from 1 to 100 do:
%p A277068   m:=n:s1:=0:s2:=0:
%p A277068    for i from 1 to nn while(m<>1) do:
%p A277068     if irem(m,2)=0
%p A277068      then
%p A277068      s2:=s2+m:m:=m/2:
%p A277068      else
%p A277068      s1:=s1+m:m:=3*m+1:
%p A277068     fi:
%p A277068    od:
%p A277068      x:=gcd(s1+1,s2): printf(`%d, `,x):
%p A277068   od:
%t A277068 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 A277068 (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 A277068 Cf. A213909, A213916, A271973.
%K A277068 nonn
%O A277068 1,5
%A A277068 _Michel Lagneau_, Sep 28 2016