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.

User: Barak Manos

Barak Manos's wiki page.

Barak Manos has authored 2 sequences.

A381754 Numbers k such that k and 3*k have the same number of zeros in their binary expansions.

Original entry on oeis.org

0, 1, 2, 4, 8, 16, 19, 32, 35, 38, 39, 53, 64, 67, 70, 71, 76, 78, 79, 101, 105, 106, 117, 128, 131, 134, 135, 140, 142, 143, 152, 156, 158, 159, 197, 201, 202, 209, 210, 212, 229, 233, 234, 245, 256, 259, 262, 263, 268, 270, 271, 280, 284, 286, 287, 301, 304
Offset: 1

Author

Barak Manos, Mar 06 2025

Keywords

Comments

If n is in the sequence, so is 2n, hence the sequence is infinite. - Charles R Greathouse IV, Mar 06 2025
This sequence corresponds to the numbers m such that A381934(m) <= 3. - Rémy Sigrist, Mar 12 2025

Crossrefs

Programs

  • Maple
    filter:= proc(n) numboccur(0,convert(n,base,2)) = numboccur(0,convert(3*n,base,2)) end proc:
    select(filter, [$0..400]); # Robert Israel, Apr 07 2025
  • Mathematica
    Select[Range[0, 320], Equal @@ DigitCount[{#, 3*#}, 2, 0] &] (* Amiram Eldar, Mar 06 2025 *)
  • PARI
    nz(n) = if(n == 0, 1, 1+logint(n, 2) - hammingweight(n))
    is(n)=nz(n)==nz(3*n) \\ Charles R Greathouse IV, Mar 06 2025
  • Python
    def ok(n): return bin(n).count('0') == bin(n * 3).count('0')
    

A381762 Numbers k such that S(k) sets a new record, where S(k) denotes the sum of the reciprocals of odd elements in the Collatz sequence which starts at k.

Original entry on oeis.org

1, 3, 7, 9, 559, 745, 993
Offset: 1

Author

Barak Manos, Mar 06 2025

Keywords

Comments

This sequence is conjectured to be finite.

Crossrefs

Cf. A304174.
Cf. A127789.

Programs

  • Mathematica
    f[n_] := Total[1/Select[NestWhileList[If[OddQ[#], 3*# + 1, #/2] &, n, # > 1 &], OddQ]]; seq[lim_] := Module[{s = {}, fm = 0, f1}, Do[f1 = f[n]; If[f1 > fm, fm = f1; AppendTo[s, n]], {n, 1, lim}]; s]; seq[1000] (* Amiram Eldar, Mar 06 2025 *)
  • Python
    from fractions import Fraction
    def S(n):
        arr = []
        while True:
            n //= (n - (n & (n - 1)))
            arr.append(n)
            if n == 1:
                break
            n = 3 * n + 1
        return sum(Fraction(1, x) for x in arr)
    m = 0
    for n in range(1, 1000):
        k = S(n)
        if m < k:
            m = k
            print(n)