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.

Showing 1-3 of 3 results.

A352897 Maximum value of bigomega (A001222) computed for all the terms x (including the starting term x=n), when map x -> A352892(x) is iterated down to the first x <= 2, or -1 if such number is never reached. Here A352892 is the next odd term in the Collatz or 3x+1 map (A139391) conjugated by unary-binary-encoding (A156552).

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 3, 2, 3, 1, 3, 1, 3, 2, 4, 1, 3, 1, 4, 3, 4, 1, 4, 2, 3, 3, 4, 1, 3, 1, 8, 3, 8, 2, 8, 1, 8, 4, 5, 1, 3, 1, 4, 3, 6, 1, 8, 2, 4, 3, 4, 1, 4, 3, 8, 8, 5, 1, 4, 1, 8, 4, 8, 3, 3, 1, 8, 8, 8, 1, 8, 1, 8, 3, 8, 2, 4, 1, 6, 4, 7, 1, 4, 4, 7, 6, 5, 1, 4, 3, 6, 5, 8, 3, 8, 1, 3, 4, 4, 1, 3, 1, 8, 3
Offset: 1

Views

Author

Antti Karttunen, Apr 08 2022

Keywords

Comments

Equally, maximum value of bigomega (A001222) computed for all the terms x (including the starting term x=n), when map x -> A341515(x) is iterated starting from x=n.

Crossrefs

Programs

  • PARI
    A352897(n) = { my(m=bigomega(n)); while(n>2, m = max(m,bigomega(n)); n = A352892(n)); (m); }; \\ Uses the code from A352892.
    
  • PARI
    A352897(n) = { my(m=bigomega(n)); while(n>2, m = max(m,bigomega(n)); n = A341515(n)); (m); }; \\ Slightly slower.
    
  • PARI
    A139391(n) = my(x = if(n%2, 3*n+1, n/2)); x/2^valuation(x, 2); \\ From A139391
    A156552(n) = { my(f = factor(n), p, p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res };
    A333860(n) = { my(mw=1); while(n>1, mw = max(hammingweight(n),mw); n = A139391(n)); (mw); };
    A352897(n) = if(1==n,0,A333860(A156552(n)));

Formula

a(n) = max(A001222(n), A352896(n)).
For n > 1, a(n) = A333860(A156552(n)).

A352895 The maximum binary weight of those elements of the Collatz orbit of n that follow after the term n itself, when iterated down to 1, or -1 if 1 is never reached.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 3, 1, 3, 2, 3, 2, 2, 3, 4, 1, 3, 3, 4, 2, 1, 3, 4, 2, 4, 3, 8, 3, 3, 4, 8, 1, 4, 3, 4, 3, 3, 4, 5, 2, 8, 3, 3, 3, 3, 4, 8, 2, 3, 4, 4, 3, 2, 8, 8, 3, 4, 4, 4, 4, 4, 8, 8, 1, 3, 4, 4, 3, 3, 4, 8, 3, 8, 3, 4, 4, 4, 5, 6, 2, 5, 8, 8, 3, 1, 4, 4, 3, 4, 4, 8, 4, 4, 8, 8, 2, 8, 3, 4, 4, 4, 4, 8, 3, 6
Offset: 1

Views

Author

Antti Karttunen, Apr 08 2022

Keywords

Examples

			Iterates of A006370 (down to 1) when starting from n = 29 are 29 -> 88 -> 44 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 4 -> 2 -> 1. Because A000120(2*n) = A000120(n), we can consider only the odd terms in the trajectory (iterates of A139391), and these are 29 -> 11 -> 17 -> 13 -> 5 -> 1. Their hamming weights are 4, 3, 2, 3, 2, 1. However, in this sequence (in contrast to A333860), we discard the binary weight of the starting value (which here is A000120(29)=4), and take the maximum of the rest, therefore a(29) = 3.
		

Crossrefs

Programs

  • PARI
    A139391(n) = my(x = if(n%2, 3*n+1, n/2)); x/2^valuation(x, 2); \\ From A139391
    A352895(n) = { my(mw=1); while(n>1, n = A139391(n); mw = max(hammingweight(n),mw)); (mw); };

Formula

a(n) = A333860(A006370(n)) = A333860(A014682(n)) = A333860(A139391(n)).

A333861 The sum of the Hamming weights of the elements of the Collatz orbit of n.

Original entry on oeis.org

1, 2, 11, 3, 7, 13, 35, 4, 43, 9, 29, 15, 16, 38, 43, 5, 24, 45, 49, 11, 10, 32, 35, 17, 58, 19, 527, 41, 42, 47, 507, 6, 66, 26, 28, 47, 50, 52, 100, 13, 520, 13, 73, 35, 34, 39, 497, 19, 59, 61, 66, 22, 21, 531, 537, 44, 85, 46, 91, 51, 52, 512, 523, 7, 67
Offset: 1

Views

Author

Markus Sigg, Apr 08 2020

Keywords

Examples

			The Collatz orbit of 3 is 3,10,5,16,8,4,2,1. The Hamming weights are 2,2,2,1,1,1,1,1. The sum is a(3) = 11.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Total[DigitCount[#, 2, 1] & /@ NestWhileList[If[OddQ[#], 3*# + 1, #/2] &, n, # > 1 &]]; Array[a, 65] (* Amiram Eldar, Jul 29 2023 *)
  • PARI
    a(n) = my(c = hammingweight(n)); while(n>1, n = if(n%2 == 0, n/2, 3*n+1); c += hammingweight(n)); c;

Formula

a(n) = Sum_{k=1..A008908(n)} A000120(A070165(n,k)). - Alois P. Heinz, Apr 10 2020
a(n) = a(A006370(n)) + A000120(n), with a(1) = 1. - Alan Michael Gómez Calderón, Jul 15 2025
Showing 1-3 of 3 results.