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.

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

This page as a plain text file.
%I A271473 #18 Apr 09 2016 13:55:48
%S A271473 0,1,23,3,17,26,141,7,166,22,127,32,58,148,344,15,105,175,256,32,73,
%T A271473 138,314,44,325,71,50699,162,218,359,50532,31,416,122,268,193,264,275,
%U A271473 1166,52,50645,94,664,160,246,337,50470,68,399,350,561,97,198,50726,51137,190,821,247,1088,389
%N A271473 a(1)=0; thereafter a(2k)=k+a(k), a(2k+1)=k+a(6k+4).
%C A271473 Inspired by A266569.
%H A271473 Robert Price, <a href="/A271473/b271473.txt">Table of n, a(n) for n = 1..1000</a>
%p A271473 A271473 := proc(n)
%p A271473         local a, traj ;
%p A271473         a := 0 ;
%p A271473         traj := n ;
%p A271473         while traj > 1 do
%p A271473                 if type(traj, 'even') then
%p A271473                         a:=a+traj/2;
%p A271473                         traj := traj/2 ;
%p A271473                 else
%p A271473                         a:=a+(traj-1)/2;
%p A271473                         traj := 3*traj+1 ;
%p A271473                 end if;
%p A271473         end do:
%p A271473         return a;
%p A271473 end proc:
%p A271473 [seq(A271473(n),n=1..60)];
%t A271473 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 A271473 Cf. A266569, A270814.
%K A271473 nonn
%O A271473 1,3
%A A271473 _N. J. A. Sloane_, Apr 08 2016