A359794 Union of odd numbers and numbers with an odd 2-adic valuation.
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, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 49, 50, 51, 53, 54, 55, 56, 57, 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
Offset: 1
Keywords
Crossrefs
Programs
-
Mathematica
Select[Range[100], OddQ[#] || OddQ[IntegerExponent[#, 2]] &] (* Amiram Eldar, Jan 25 2023 *)
-
PARI
isA359794(n) = A359832(n);
-
Python
def A359794(n): def f(x): c, s = n+(x>>1), bin(x)[2:] l = len(s) for i in range(l&1,l,2): c -= int(s[i])+int('0'+s[:i],2) return c m, k = n, f(n) while m != k: m, k = k, f(k) return m # Chai Wah Wu, Jan 29 2025
Comments