[go: up one dir, main page]

login
A137604
Define a sequence b(n) by the following rule. If b(n-1) is divisible by 2 then b(n) = b(n-1)/2. If b(n-1) is not divisible by 2 then b(n) = b(0)-(b(n-1)+1)/2. When b(n)=1 it ends. Then a(m) = (Sum_{0<=k<=l} b(k)) - 1 where b(0)=m, b(l)=1 = A096259(m)/(m*2^p), 4<=m.
3
1, 2, 3, 6, 7, 15, 21, 14, 15, 45, 30, 66, 63, 61, 105, 30, 31, 102, 171, 114, 93, 63, 134, 276, 258, 88, 351, 270, 105, 435, 465, 62, 63, 561, 374, 630, 126, 374, 570, 780, 547, 861, 126, 602, 204, 246, 196, 846, 537, 361, 1275, 1326, 264, 1431, 483, 990, 315
OFFSET
1,2
EXAMPLE
a(6)=6+3+4+2+1-1=15
MATHEMATICA
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 *)
CROSSREFS
Sequence in context: A032882 A265394 A125167 * A034901 A343149 A275390
KEYWORD
nonn
AUTHOR
Yasutoshi Kohmoto, Apr 23 2008
EXTENSIONS
More terms from Robert G. Wilson v, May 15 2008
STATUS
approved