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.
%I A171942 #20 Mar 06 2025 15:22:08 %S A171942 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, %T A171942 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, %U A171942 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 %N A171942 Forward van Eck transform of A000120. %C A171942 Assumes that the offset of A000120 has been changed to 1. %C A171942 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. %H A171942 Reinhard Zumkeller, <a href="/A171942/b171942.txt">Table of n, a(n) for n = 1..10000</a> %H A171942 N. J. A. Sloane, <a href="/transforms.txt">Transforms</a> %o A171942 (Haskell) %o A171942 a171942 1 = 0 %o A171942 a171942 n = head [m | m <- [1..], a000120 (m + n - 1) == a000120 (n - 1)] %o A171942 -- _Reinhard Zumkeller_, Jan 01 2014 %o A171942 (Python) %o A171942 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 %Y A171942 Cf. A000120, A057168, A171898. %K A171942 nonn %O A171942 1,3 %A A171942 _N. J. A. Sloane_, Oct 25 2010