OFFSET
1,2
COMMENTS
This sequence is a variant of A350877; here we add positive integers, there prime numbers.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Annotated log-log scatterplot of a(n), 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.
EXAMPLE
a(1) = 1.
a(2) = a(1) + 1 = 2 as a(1) is the 1st odd term in the sequence.
a(3) = a(2) / 2 = 1 as a(2) is even.
a(4) = a(3) + 2 = 3 as a(3) is the 2nd odd term in the sequence.
a(5) = a(4) + 3 = 6 as a(4) is the 3rd odd term in the sequence.
MATHEMATICA
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 *)
PROG
(PARI) print1 (v=1); for (k=1, 36, print1 (", "v+=k); while (v%2==0, print1 (", "v/=2)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Jan 23 2022
STATUS
approved