A097927 If a(n-1) is divisible by 2 then a(n) = a(n-1)/2. If a(n-1) is not divisible by 2 then a(n) = 47-(a(n-1)+1)/2; a(0)=1.
1, 46, 23, 35, 29, 32, 16, 8, 4, 2, 1, 46, 23, 35, 29, 32, 16, 8, 4, 2, 1, 46, 23, 35, 29, 32, 16, 8, 4, 2, 1, 46, 23, 35, 29, 32, 16, 8, 4, 2, 1, 46, 23, 35, 29, 32, 16, 8, 4, 2, 1, 46, 23, 35, 29, 32, 16, 8, 4, 2, 1, 46, 23, 35, 29, 32, 16, 8, 4, 2, 1, 46, 23, 35, 29, 32, 16, 8, 4, 2, 1, 46, 23
Offset: 0
Keywords
Programs
-
Maple
a:=proc(n) option remember; local k; k:=47; if n=0 then RETURN(1); fi; if a(n-1) mod 2 = 0 then RETURN(a(n-1)/2); fi; RETURN(k-(a(n-1)+1)/2); end;
-
Mathematica
NestList[If[EvenQ[#],#/2,47-(#+1)/2]&,1,90] (* or *) PadRight[{},90,{1,46,23,35,29,32,16,8,4,2}] (* Harvey P. Dale, Sep 30 2016 *)
Formula
Periodic with period of length 10.
Extensions
Definition corrected by Harvey P. Dale, Sep 30 2016
Comments