login
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.
7

%I #36 Mar 20 2024 04:26:16

%S 1,11,100,101,111,1001,1011,1100,1101,1111,10000,10001,10011,10100,

%T 10101,10111,11001,11011,11100,11101,11111,100001,100011,100100,

%U 100101,100111,101001,101011,101100,101101,101111,110000,110001,110011,110100,110101,110111

%N 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.

%C Every positive integer has a unique expression as a sum of distinct Jacobsthal numbers in which the index of the smallest summand is odd, with J(1) = 1 and J(2) = 1 both allowed. [Carlitz-Scoville-Hoggatt, 1972]. - Based on a comment in A001045 from _Ira M. Gessel_, Dec 31 2016.

%C The highest-order bits are on the left. Interpreting these as binary numbers we get A003159.

%H Lars Blomberg, <a href="/A280049/b280049.txt">Table of n, a(n) for n = 1..10000</a>

%H L. Carlitz, R. Scoville, and V. E. Hoggatt, Jr., <a href="http://www.fq.math.ca/Scanned/10-5/carlitz3-a.pdf">Representations for a special sequence</a>, Fibonacci Quarterly 10.5 (1972), 499-518, 550.

%F a(n) = A007088(A003159(n)). - _Amiram Eldar_, Jul 14 2023

%e 9 = 5+3+1 = J(4)+J(3)+J(1) = 1101.

%t FromDigits[IntegerDigits[#, 2]] & /@ Select[Range[100], EvenQ[IntegerExponent[#, 2]] &] (* _Amiram Eldar_, Jul 14 2023 *)

%o (PARI) lista(kmax) = for(k = 1, kmax, if(!(valuation(k, 2)%2), print1(fromdigits(binary(k), 10), ", "))); \\ _Amiram Eldar_, Jul 14 2023

%o (Python)

%o from itertools import count, islice

%o def A280049_gen(): # generator of terms

%o return map(lambda n:int(bin(n)[2:]),filter(lambda n:(n&-n).bit_length()&1,count(1)))

%o A280049_list = list(islice(A280049_gen(),20)) # _Chai Wah Wu_, Mar 19 2024

%Y Cf. A001045, A003159, A007088.

%K nonn,base

%O 1,2

%A _N. J. A. Sloane_, Dec 31 2016

%E Corrected a(5), a(16) and more terms from _Lars Blomberg_, Jan 02 2017