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.
%I A271479 #36 Apr 16 2021 16:07:26 %S A271479 0,1,4,2,7,5,5,3,10,8,8,6,8,6,6,4,13,11,11,9,11,9,9,7,11,9,9,7,9,7,7, %T A271479 5,16,14,14,12,14,12,12,10,14,12,12,10,12,10,10,8,14,12,12,10,12,10, %U A271479 10,8,12,10,10,8,10,8,8,6,19,17,17,15,17,15,15,13,17,15,15,13,15,13 %N A271479 Number of steps for the trajectory of n under the map k -> A271478(k) to reach 1. %C A271479 Arises in studying A266569. %C A271479 Records are 0, 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40, ... and occur at positions 1, 2, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, ... %H A271479 N. J. A. Sloane, <a href="/A271479/b271479.txt">Table of n, a(n) for n = 1..10000</a> %H A271479 Christian Krause, <a href="https://github.com/ckrause/loda/blob/master/programs/oeis/271/A271479.asm">LODA program for A271479</a> %F A271479 a(1) = 0; a(2*n) = a(n)+1; a(2*n+1) = a(n+1)+3. - _Christian Krause_, Mar 19 2021 %F A271479 a(n) = A000120(n-1) + 3*A023416(n-1), for n>=2. - _Kevin Ryde_, Mar 21 2021 %p A271479 f:=n->if n mod 2 = 0 then n/2 else 2*n+2; fi; # A271478 %p A271479 a:=[]; B:=1000; %p A271479 for n from 1 to 100 do %p A271479 ct:=0; s:=n; %p A271479 for k from 1 to B while s>1 do %p A271479 s:=f(s); ct:=ct+1; od: %p A271479 if ct=B then lprint("error, need to increase limit B"); break; fi; %p A271479 a:=[op(a),ct]; od: %p A271479 a; %t A271479 Table[Length[NestWhileList[If[EvenQ[#],#/2,2#+2]&,n,#!=1&]]-1,{n,80}] (* _Harvey P. Dale_, May 02 2017 *) %o A271479 (PARI) a(n) = if(n--, 3*(logint(n,2)+1) - 2*hammingweight(n), 0); \\ _Kevin Ryde_, Mar 21 2021 %Y A271479 Cf. A266569, A271478, A000120, A023416. %K A271479 nonn %O A271479 1,3 %A A271479 _N. J. A. Sloane_, Apr 10 2016