A217319 Numbers with binary representation ending in 4*k+2 or 4*k+3 zeros.
4, 8, 12, 20, 24, 28, 36, 40, 44, 52, 56, 60, 64, 68, 72, 76, 84, 88, 92, 100, 104, 108, 116, 120, 124, 128, 132, 136, 140, 148, 152, 156, 164, 168, 172, 180, 184, 188, 192, 196, 200, 204, 212, 216, 220, 228, 232, 236, 244, 248, 252, 260, 264, 268, 276, 280
Offset: 1
Links
- Peter J. C. Moses, Table of n, a(n) for n = 1..10000
Programs
-
Maple
isA007814 := proc(n) if modp( A007814(n),4) in {2,3} then true ; else false ; end if; end proc: for n from 1 to 1000 do if isA007814(n) then printf("%d,",n) ; end if; end do: # R. J. Mathar, Nov 22 2023
-
Mathematica
okQ[n_] := (cnt = Count[ Split[ IntegerDigits[n, 2]] // Last, 0]; k0 = k /. ToRules@ Reduce[ (cnt == 2*k || cnt == 2*k+1), k, Integers]; OddQ[k0]); Select[ Range[312], okQ] (* Jean-François Alcover, Mar 18 2013 *) Select[Map[# Boole[IntegerQ[(1/4 (1+#))]||IntegerQ[(1/4 (2+#))]&[Length[Last[Split[IntegerDigits[#,2]]]]]]&,Range[2,500,2]],#>0&] Select[Range[280], OddQ @ IntegerExponent[#, 4] &] (* Amiram Eldar, Sep 20 2020 *)
-
Python
def A217319(n): def f(x): return n+x-sum((k:=x>>(m<<1))-(k>>2) for m in range(0,(x.bit_length()+1>>1),2)) m, k = n, f(n) while m != k: m, k = k, f(k) return m<<2 # Chai Wah Wu, May 25 2025
Formula
Conjecture. For n>=1, a(n) = A171949(n+1).
Extensions
Named edited by David A. Corneth, Sep 22 2020
Comments