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.

A137604 Consider the sequence: b(0) = n, and for k >= 1, b(k) = b(k-1)/2 if b(k-1) is even, otherwise b(k) = n - (b(k-1)+1)/2. Then a(n) = (Sum_{0<=k<=m} b(k)) - 1 for n > 1, where m is the smallest index such that b(m) = 1; a(1) = 1.

This page as a plain text file.
%I A137604 #12 Jan 20 2025 22:41:47
%S A137604 1,2,3,6,7,15,21,14,15,45,30,66,63,61,105,30,31,102,171,114,93,63,134,
%T A137604 276,258,88,351,270,105,435,465,62,63,561,374,630,126,374,570,780,547,
%U A137604 861,126,602,204,246,196,846,537,361,1275,1326,264,1431,483,990,315
%N A137604 Consider the sequence: b(0) = n, and for k >= 1, b(k) = b(k-1)/2 if b(k-1) is even, otherwise b(k) = n - (b(k-1)+1)/2. Then a(n) = (Sum_{0<=k<=m} b(k)) - 1 for n > 1, where m is the smallest index such that b(m) = 1; a(1) = 1.
%e A137604 a(6) = 6 + 3 + 4 + 2 + 1 - 1 = 15.
%t A137604 f[1] = 1; f[n_] := Block[{lst = {n}, a}, While[a = lst[[ -1]]; a != 1, If[EvenQ@ a, AppendTo[lst, a/2], AppendTo[lst, lst[[1]] - (a + 1)/2]]]; Plus @@ lst - 1]; Array[f, 58] (* _Robert G. Wilson v_, May 15 2008 *)
%Y A137604 Cf. A096259, A137605.
%K A137604 nonn
%O A137604 1,2
%A A137604 _Yasutoshi Kohmoto_, Apr 23 2008
%E A137604 More terms from _Robert G. Wilson v_, May 15 2008