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.

Showing 1-1 of 1 results.

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.

Original entry on oeis.org

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, 34, 17, 33, 50, 25, 43, 62, 31, 51, 72, 36, 18, 9, 31, 54, 27, 51, 76, 38, 19, 45, 72, 36, 18, 9, 37, 66, 33, 63, 94, 47, 79, 112, 56, 28, 14, 7, 41, 76, 38, 19, 55
Offset: 1

Views

Author

Rémy Sigrist, Jan 23 2022

Keywords

Comments

This sequence is a variant of A350877; here we add positive integers, there prime numbers.

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • PARI
    print1 (v=1); for (k=1, 36, print1 (", "v+=k); while (v%2==0, print1 (", "v/=2)))
Showing 1-1 of 1 results.