A280049 Canonical representation of n as a sum of distinct Jacobsthal numbers J(n) (A001045) (see Comments for details); also binary numbers that end in an even number of zeros.
1, 11, 100, 101, 111, 1001, 1011, 1100, 1101, 1111, 10000, 10001, 10011, 10100, 10101, 10111, 11001, 11011, 11100, 11101, 11111, 100001, 100011, 100100, 100101, 100111, 101001, 101011, 101100, 101101, 101111, 110000, 110001, 110011, 110100, 110101, 110111
Offset: 1
Examples
9 = 5+3+1 = J(4)+J(3)+J(1) = 1101.
Links
- Lars Blomberg, Table of n, a(n) for n = 1..10000
- L. Carlitz, R. Scoville, and V. E. Hoggatt, Jr., Representations for a special sequence, Fibonacci Quarterly 10.5 (1972), 499-518, 550.
Programs
-
Mathematica
FromDigits[IntegerDigits[#, 2]] & /@ Select[Range[100], EvenQ[IntegerExponent[#, 2]] &] (* Amiram Eldar, Jul 14 2023 *)
-
PARI
lista(kmax) = for(k = 1, kmax, if(!(valuation(k, 2)%2), print1(fromdigits(binary(k), 10), ", "))); \\ Amiram Eldar, Jul 14 2023
-
Python
from itertools import count, islice def A280049_gen(): # generator of terms return map(lambda n:int(bin(n)[2:]),filter(lambda n:(n&-n).bit_length()&1,count(1))) A280049_list = list(islice(A280049_gen(),20)) # Chai Wah Wu, Mar 19 2024
-
Python
def A280049(n): def f(x): c, s = n+x, bin(x)[2:] l = len(s) for i in range(l&1^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 int(bin(m)[2:]) # Chai Wah Wu, Jan 30 2025
Formula
Extensions
Corrected a(5), a(16) and more terms from Lars Blomberg, Jan 02 2017
Comments