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.

A333716 a(0)=1; for n>0, a(n) is the greatest common divisor (GCD) of n and the sum of the previous terms back to the last GCD term, if the GCD is not already in the sequence; otherwise a(n) = a(n-1) + n.

This page as a plain text file.
%I A333716 #19 Aug 01 2021 01:56:24
%S A333716 1,2,4,7,11,5,11,18,26,3,13,24,36,49,63,78,94,111,129,148,168,189,211,
%T A333716 234,258,283,309,336,364,393,423,454,486,519,553,588,624,661,699,738,
%U A333716 778,819,861,43,87,132,178,225,273,322,10,61,113,166,220,275,331,388,446,505,565
%N A333716 a(0)=1; for n>0, a(n) is the greatest common divisor (GCD) of n and the sum of the previous terms back to the last GCD term, if the GCD is not already in the sequence; otherwise a(n) = a(n-1) + n.
%C A333716 This sequence is similar to A337490 except that here when a GCD term is added to the sequence the sum of previous terms is reset to the value of that GCD. Subsequent terms calculate the sum of previous terms back to this last GCD value. See the examples below.
%C A333716 Unlike A337490 this sequence shows numerous drops in value as the sum used when calculating the GCD with n is constantly being reset back to a smaller value anytime a unique GCD value greater than 1 is found. In the first one million terms the sequence drops in value 1516 times, the largest drop occurring from a(738133) = 45463489818 to a(738134) = 738134.
%H A333716 Scott R. Shannon, <a href="/A333716/a333716.png">Graph of the terms for n=0 to n=1000000</a>.
%e A333716 a(4) = 11 as the sum of the previous terms is a(0)+...+a(3) = 14, and the GCD of 14 and 4 is 2. However 2 has already appeared so a(4) = a(3) + n = 7 + 4 = 11.
%e A333716 a(5) = 5 as the sum of all previous terms is a(0)+...+a(4) = 25, and the GCD of 25 and 5 is 5, and as 5 has not previously appeared a(5) = 5. As this term adds a GCD value to the sequence, the running sum of previous terms is now set to 5.
%e A333716 a(6) = 11 as the sum of previous terms is now just a(5) = 5, and as the GCD of 5 and 6 is 1, which already appears in the sequence, a(6) = a(5) + 6 = 5 + 6 = 11.
%e A333716 a(9) = 3 as the sum of previous terms back to the last GCD term is a(5)+...+a(8) = 60, and the GCD of 60 and 9 is 3, and as 3 has not previously appeared, a(9) = 3. As this term adds a GCD value to the sequence, the running sum of previous terms is now set to 3.
%t A333716 Block[{k = 0}, Nest[Append[#, If[FreeQ[#1, #3], Set[k, #2]; #3, #1[[-1]] + #2]] & @@ {#1, #2, GCD[Total@ #1[[k + 1 ;; #2]], #2]} & @@ {#, Length@ #} &, {1}, 60]] (* _Michael De Vlieger_, Sep 20 2020 *)
%Y A333716 Cf. A337490, A165430, A064814, A082299, A005132, A336957.
%K A333716 nonn
%O A333716 0,2
%A A333716 _Scott R. Shannon_, Sep 03 2020