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.

A359794 Union of odd numbers and numbers with an odd 2-adic valuation.

This page as a plain text file.
%I A359794 #13 Jan 29 2025 14:33:28
%S A359794 1,2,3,5,6,7,8,9,10,11,13,14,15,17,18,19,21,22,23,24,25,26,27,29,30,
%T A359794 31,32,33,34,35,37,38,39,40,41,42,43,45,46,47,49,50,51,53,54,55,56,57,
%U A359794 58,59,61,62,63,65,66,67,69,70,71,72,73,74,75,77,78,79,81,82,83,85,86,87,88,89,90,91,93,94
%N A359794 Union of odd numbers and numbers with an odd 2-adic valuation.
%C A359794 Numbers not of the form (2*m - 1)*4^k where m >= 1, k >= 1.
%C A359794 Numbers k for which the parities of k and A048675(k) differ.
%C A359794 The asymptotic density of this sequence is 5/6. - _Amiram Eldar_, Jan 25 2023
%t A359794 Select[Range[100], OddQ[#] || OddQ[IntegerExponent[#, 2]] &] (* _Amiram Eldar_, Jan 25 2023 *)
%o A359794 (PARI) isA359794(n) = A359832(n);
%o A359794 (Python)
%o A359794 def A359794(n):
%o A359794     def f(x):
%o A359794         c, s = n+(x>>1), bin(x)[2:]
%o A359794         l = len(s)
%o A359794         for i in range(l&1,l,2):
%o A359794             c -= int(s[i])+int('0'+s[:i],2)
%o A359794         return c
%o A359794     m, k = n, f(n)
%o A359794     while m != k: m, k = k, f(k)
%o A359794     return m # _Chai Wah Wu_, Jan 29 2025
%Y A359794 Union of A005408 and A036554.
%Y A359794 Complement of A108269.
%Y A359794 Cf. A048675, A359832 (characteristic function).
%K A359794 nonn
%O A359794 1,2
%A A359794 _Antti Karttunen_, Jan 25 2023