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.

A171942 Forward van Eck transform of A000120.

Original entry on oeis.org

0, 1, 2, 2, 4, 1, 3, 4, 8, 1, 2, 2, 5, 1, 5, 8, 16, 1, 2, 2, 4, 1, 3, 4, 9, 1, 2, 2, 7, 1, 9, 16, 32, 1, 2, 2, 4, 1, 3, 4, 8, 1, 2, 2, 5, 1, 5, 8, 17, 1, 2, 2, 4, 1, 3, 4, 11, 1, 2, 2, 11, 1, 17, 32, 64, 1, 2, 2, 4, 1, 3, 4, 8, 1, 2, 2, 5, 1, 5, 8, 16, 1, 2, 2, 4, 1, 3, 4, 9, 1, 2, 2, 7, 1, 9, 16, 33, 1, 2, 2
Offset: 1

Views

Author

N. J. A. Sloane, Oct 25 2010

Keywords

Comments

Assumes that the offset of A000120 has been changed to 1.
Comment from Marc LeBrun, Jan 01 2014: A057168(n) - n (the difference between n and the next number with the same binary weight) matches A171942, "Forward van Eck transform of A000120" (the weight of n). Response from M. F. Hasler, Jan 01 2014: The "forward van Eck transform" is the sequence of gaps to the next term with equal value: FVE(a) = n -> min { m>0 | a(n+m)=a(n) } with the (exceptional) convention that : min {} = 0. (See A171898.) So your observation is exactly the definition.

Crossrefs

Programs

  • Haskell
    a171942 1 = 0
    a171942 n = head [m | m <- [1..], a000120 (m + n - 1) == a000120 (n - 1)]
    -- Reinhard Zumkeller, Jan 01 2014
    
  • Python
    def A171942(n): return (((n-1&~(b:=n-1+(a:=n-1&-n+1)))>>a.bit_length())^b)-n+1 # Chai Wah Wu, Mar 06 2025