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.

A087229 Exponent of p=2 in 12n+4 = 3(4n+1)+1.

This page as a plain text file.
%I A087229 #64 Aug 30 2024 06:24:52
%S A087229 2,4,2,3,2,6,2,3,2,4,2,3,2,5,2,3,2,4,2,3,2,8,2,3,2,4,2,3,2,5,2,3,2,4,
%T A087229 2,3,2,6,2,3,2,4,2,3,2,5,2,3,2,4,2,3,2,7,2,3,2,4,2,3,2,5,2,3,2,4,2,3,
%U A087229 2,6,2,3,2,4,2,3,2,5,2,3,2,4,2,3,2,10,2,3,2,4,2,3,2,5,2,3,2,4,2,3,2,6,2,3,2,4
%N A087229 Exponent of p=2 in 12n+4 = 3(4n+1)+1.
%C A087229 In the Collatz trajectory of m=4n+1, the first 3x+1 step is followed by a(n) consecutive divide-by-2 steps.
%C A087229 Large shifted overlaps with A085058.
%H A087229 Antti Karttunen, <a href="/A087229/b087229.txt">Table of n, a(n) for n = 0..21845</a>
%H A087229 Antti Karttunen, <a href="/A087229/a087229.txt">Data supplement: n, a(n) computed for n = 1..65537</a>
%F A087229 a(n) = A007814(A017569(n)). - _Antti Karttunen_, Oct 09 2018
%F A087229 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3. - _Amiram Eldar_, Aug 30 2024
%e A087229 n=85: m = 4*n + 1 = 4*85 + 1 = 341, whose Collatz trajectory begins with 341 -> 1024 followed by a(85)=10 consecutive halving steps.
%t A087229 Table[Part[Part[FactorInteger[12*w+4],1],2], {w,0,100}]
%t A087229 Table[IntegerExponent[12*n + 4, 2], {n, 0, 100}] (* _Amiram Eldar_, Feb 03 2022 *)
%o A087229 (PARI) A087229(n) = valuation((12*n)+4,2); \\ _Antti Karttunen_, Oct 09 2018
%o A087229 (Perl) # In 4*n+1 (n>0), find position of first bit that will repeat.
%o A087229 sub a {
%o A087229   my $nv= ((shift() << 2) | 1);
%o A087229   my $bp= 1;
%o A087229   while (($nv & 1) xor ($nv & 2)) {
%o A087229     $nv>>= 1;
%o A087229     $bp++;
%o A087229   }
%o A087229   return $bp;
%o A087229 }
%o A087229 # _Ruud H.G. van Tol_, Sep 27 2021
%Y A087229 Cf. A007814, A085058, A017569.
%K A087229 nonn
%O A087229 0,1
%A A087229 _Labos Elemer_, Aug 28 2003
%E A087229 Part of the name moved to comments section by _Antti Karttunen_, Oct 09 2018
%E A087229 a(0) = 2 prepended by _Ihar Senkevich_, Feb 05 2022