Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #19 Jul 18 2024 04:40:08
%S 1,-1,5,-1,-3,-1,21,-1,-3,-1,-11,-1,-3,-1,85,-1,-3,-1,-11,-1,-3,-1,
%T -43,-1,-3,-1,-11,-1,-3,-1,341,-1,-3,-1,-11,-1,-3,-1,-43,-1,-3,-1,-11,
%U -1,-3,-1,-171,-1,-3,-1,-11,-1,-3,-1,-43,-1,-3,-1,-11,-1,-3,-1,1365,-1,-3,-1,-11,-1,-3,-1,-43
%N A Jacobsthal-related divide-and-conquer sequence.
%C Partial sums are A115637.
%H Antti Karttunen, <a href="/A115638/b115638.txt">Table of n, a(n) for n = 0..1024</a>
%H R. Stephan, <a href="https://arxiv.org/abs/math/0307027">Divide-and-conquer generating functions. I. Elementary sequences</a>, arXiv:math/0307027 [math.CO], 2003.
%F G.f.: Sum_{k>=0} 4^k*x^(2^(k+1)-2)/(1+x^(2^k)); the g.f. G(x) satisfies G(x) - 4*x^2*G(x^2) = 1/(1+x).
%F a(0) = 1; for n >= 1, a(n) = A115637(n) - A115637(n-1). - _Antti Karttunen_, Nov 02 2018
%t A115637[n_] := FromDigits[1 - IntegerDigits[n + 2, 2], 4];
%t Differences[Array[A115637, 100, -1]] (* _Paolo Xausa_, Jul 17 2024 *)
%o (PARI) A115638(n) = if(!n,1, A115637(n)-A115637(n-1)); \\ (Needs also code from A115637) - _Antti Karttunen_, Nov 02 2018
%o (Python)
%o def A115638(n): return int(bin((~(n+2))^(-1<<(n+2).bit_length()))[2:],4)-int(bin((~(n+1))^(-1<<(n+1).bit_length()))[2:],4) # _Chai Wah Wu_, Jul 17 2024
%Y Cf. A001045, A115637.
%K easy,sign
%O 0,3
%A _Paul Barry_, Jan 27 2006