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.

A347297 a(1) = 1; for n >= 1, if a(n) is even then a(n+1) = a(n) / 2, otherwise, say a(n) is the k-th odd term in the sequence, a(n+1) = a(n) + k.

This page as a plain text file.
%I A347297 #15 Jan 25 2022 08:51:31
%S A347297 1,2,1,3,6,3,7,12,6,3,9,16,8,4,2,1,9,18,9,19,30,15,27,40,20,10,5,19,
%T A347297 34,17,33,50,25,43,62,31,51,72,36,18,9,31,54,27,51,76,38,19,45,72,36,
%U A347297 18,9,37,66,33,63,94,47,79,112,56,28,14,7,41,76,38,19,55
%N A347297 a(1) = 1; for n >= 1, if a(n) is even then a(n+1) = a(n) / 2, otherwise, say a(n) is the k-th odd term in the sequence, a(n+1) = a(n) + k.
%C A347297 This sequence is a variant of A350877; here we add positive integers, there prime numbers.
%H A347297 Rémy Sigrist, <a href="/A347297/b347297.txt">Table of n, a(n) for n = 1..10000</a>
%H A347297 Michael De Vlieger, <a href="/A347297/a347297.png">Annotated log-log scatterplot of a(n)</a>, n = 1..2^16, showing records in red, labeling the indices of 1's in blue, appearances of powers of 2 in gold, and terms instigated by even predecessors in green.
%e A347297 a(1) = 1.
%e A347297 a(2) = a(1) + 1 = 2 as a(1) is the 1st odd term in the sequence.
%e A347297 a(3) = a(2) / 2 = 1 as a(2) is even.
%e A347297 a(4) = a(3) + 2 = 3 as a(3) is the 2nd odd term in the sequence.
%e A347297 a(5) = a(4) + 3 = 6 as a(4) is the 3rd odd term in the sequence.
%t A347297 j = q = 1; {j}~Join~Reap[Do[If[EvenQ[j], k = j/2, k = j + q; q++]; Sow[k]; j = k, {i, 69}]][[-1, -1]] (* _Michael De Vlieger_, Jan 24 2022 *)
%o A347297 (PARI) print1 (v=1); for (k=1, 36, print1 (", "v+=k); while (v%2==0, print1 (", "v/=2)))
%Y A347297 Cf. A347296, A350877.
%K A347297 nonn
%O A347297 1,2
%A A347297 _Rémy Sigrist_, Jan 23 2022