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.

A352896 Maximum value of bigomega (A001222) computed for the terms x after the initial n, when map x -> A352892(x) is iterated starting from x=n 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, 1, 1, 3, 2, 3, 1, 3, 1, 3, 2, 4, 1, 2, 1, 4, 3, 4, 1, 4, 2, 3, 3, 4, 1, 1, 1, 8, 3, 8, 2, 8, 1, 8, 4, 5, 1, 3, 1, 4, 3, 6, 1, 8, 2, 4, 3, 4, 1, 3, 3, 8, 8, 5, 1, 3, 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, 3, 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 the terms x after the initial n, when map x -> A341515(x) is iterated starting from x=n.

Crossrefs

Programs

  • PARI
    A352896(n) = if(n<=2,n-1, my(m=0); while(n>2, n = A352892(n); m = max(m,bigomega(n))); (m)); \\ Needs also code from A352892.
    
  • PARI
    A352896(n) = if(n<=2,n-1,my(m=0); while(n>2, n = A341515(n); m = max(m,bigomega(n))); (m)); \\ Slower, but equivalent.
    
  • PARI
    \\ Faster:
    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 };
    A352895(n) = { my(mw=1); while(n>1, n = A139391(n); mw = max(hammingweight(n),mw)); (mw); };
    A352896(n) = if(1==n,0,A352895(A156552(n)));

Formula

a(n) = A352897(A341515(n)) = A352897(A352892(n)).
For n > 1, a(n) = A352895(A156552(n)).

A333860 The maximum Hamming (binary) weight of the elements of the Collatz orbit of n, or -1 if 1 is never reached.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 3, 1, 3, 2, 3, 2, 3, 3, 4, 1, 3, 3, 4, 2, 3, 3, 4, 2, 4, 3, 8, 3, 4, 4, 8, 1, 4, 3, 4, 3, 3, 4, 5, 2, 8, 3, 4, 3, 4, 4, 8, 2, 3, 4, 4, 3, 4, 8, 8, 3, 4, 4, 5, 4, 5, 8, 8, 1, 3, 4, 4, 3, 3, 4, 8, 3, 8, 3, 4, 4, 4, 5, 6, 2, 5, 8, 8, 3, 4, 4, 5
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 maximum is a(3) = 2.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Max[DigitCount[#, 2, 1] & /@ NestWhileList[If[OddQ[#], 3*# + 1, #/2] &, n, # > 1 &]]; Array[a, 100] (* 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 = max(c, hammingweight(n)));
    c;
    }

Formula

a(n) = max(A000120(n), A352895(n)) = max(A000120(n), a(A006370(n))). - Antti Karttunen, Apr 10 2022

Extensions

Escape clause added to the definition by Antti Karttunen, Apr 10 2022

A353309 The maximum sum of base-3 digits occurring among all numbers reached after n, when iterating map x -> A353313(x) starting from x=n, or -1 if no finite cycle is ever reached.

Original entry on oeis.org

0, 2, 18, 2, 2, 18, 18, 6, 18, 2, 18, 5, 2, 18, 6, 18, 6, 18, 18, 18, 5, 6, 18, 5, 18, 6, 18, 2, 5, 6, 18, 18, 18, 5, 18, 5, 2, 6, 18, 18, 5, 13, 6, 13, 6, 18, 8, 18, 6, 5, 6, 18, 6, 18, 18, 18, 8, 18, 5, 18, 5, 18, 5, 6, 6, 18, 18, 18, 8, 5, 13, 5, 18, 18, 13, 6, 13, 18, 18, 8, 18, 2, 18, 18, 5, 6, 13, 6, 13, 6
Offset: 0

Views

Author

Antti Karttunen, Apr 13 2022

Keywords

Examples

			When starting iterating A353313 from n=7, we obtain -> 14 -> 25 -> 44 -> 75 -> 25 -> 44 -> 75 -> 25 -> etc, ad infinitum. Applying A053735 to all distinct terms encountered after 7, that is [14, 25, 44, 75] gives us base-3 digit sums [4, 5, 6, 5], therefore a(7) = 6, which is the largest sum.
		

Crossrefs

Cf. also A352895.

Programs

  • PARI
    A053735(n) = sumdigits(n, 3);
    A353313(n) = { my(r=(n%3)); if(!r,n/3,((5*((n-r)/3)) + r + 3)); };
    A353309(n) = { my(visited = Map(), m=0); for(j=1, oo, n = A353313(n); m=max(m,A053735(n)); if(mapisdefined(visited, n), return(m), mapput(visited, n, j))); };
Showing 1-3 of 3 results.