login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A271473 a(1)=0; thereafter a(2k)=k+a(k), a(2k+1)=k+a(6k+4). 3

%I #18 Apr 09 2016 13:55:48

%S 0,1,23,3,17,26,141,7,166,22,127,32,58,148,344,15,105,175,256,32,73,

%T 138,314,44,325,71,50699,162,218,359,50532,31,416,122,268,193,264,275,

%U 1166,52,50645,94,664,160,246,337,50470,68,399,350,561,97,198,50726,51137,190,821,247,1088,389

%N a(1)=0; thereafter a(2k)=k+a(k), a(2k+1)=k+a(6k+4).

%C Inspired by A266569.

%H Robert Price, <a href="/A271473/b271473.txt">Table of n, a(n) for n = 1..1000</a>

%p A271473 := proc(n)

%p local a, traj ;

%p a := 0 ;

%p traj := n ;

%p while traj > 1 do

%p if type(traj, 'even') then

%p a:=a+traj/2;

%p traj := traj/2 ;

%p else

%p a:=a+(traj-1)/2;

%p traj := 3*traj+1 ;

%p end if;

%p end do:

%p return a;

%p end proc:

%p [seq(A271473(n),n=1..60)];

%t a[1]=0; a[n_] := a[n] = If[EvenQ[n], n/2 + a[n/2], (n - 1)/2 + a[3*(n - 1) + 4]]; Array[a, 60] (* _Robert Price_, Apr 08 2016 *)

%Y Cf. A266569, A270814.

%K nonn

%O 1,3

%A _N. J. A. Sloane_, Apr 08 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 20 10:35 EDT 2024. Contains 371827 sequences. (Running on oeis4.)