login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A115637 In the binary expansion of n+2, transform 0->1 and 1->0 then interpret as base 4. 4

%I #29 Jul 18 2024 04:50:09

%S 1,0,5,4,1,0,21,20,17,16,5,4,1,0,85,84,81,80,69,68,65,64,21,20,17,16,

%T 5,4,1,0,341,340,337,336,325,324,321,320,277,276,273,272,261,260,257,

%U 256,85,84,81,80,69,68,65,64,21,20,17,16,5,4,1,0,1365,1364,1361,1360,1349

%N In the binary expansion of n+2, transform 0->1 and 1->0 then interpret as base 4.

%C Row sums of number triangle A115636. Partial sums of A115638.

%C Old name was "A divide and conquer sequence".

%H Alois P. Heinz, <a href="/A115637/b115637.txt">Table of n, a(n) for n = 0..16384</a> (first 1025 terms from Antti Karttunen)

%H Ralf Stephan, <a href="https://arxiv.org/abs/math/0307027">Divide-and-conquer generating functions. I. Elementary sequences</a>, arXiv:math/0307027 [math.CO], 2003, see equation 2.4 with a(n) = a_{n+2} for case alpha=4, c=1, d=0.

%F G.f.: (1/(1-x))*Sum_{k>=0} 4^k*x^(2^(k+1)-2)/(1+x^(2^k)); the g.f. G(x) satisfies G(x) - 4(1+x)*x^2*G(x^2) = 1/(1-x^2).

%F a(n) = A000695(A035327(n+2)). - _Kevin Ryde_, Jul 15 2024

%p b:= n-> 1-(n mod 2)+`if`(n<2, 0, b(iquo(n, 2))*4):

%p a:= n-> b(n+2):

%p seq(a(n), n=0..66); # _Alois P. Heinz_, Jul 16 2024

%t A115637[n_] := FromDigits[1 - IntegerDigits[n + 2, 2], 4];

%t Array[A115637, 100, 0] (* _Paolo Xausa_, Jul 16 2024 *)

%o (PARI)

%o up_to = 1024;

%o A115633array(n, k) = (((-1)^n)*if(n==k,1, if((k+k+2)==n, -4, if((k+1)==n, -(1+(-1)^k)/2, 0))));

%o A115637list(up_to) = { my(mA115633=matrix(up_to,up_to,n,k,A115633array(n-1,k-1)), mA115636 = matsolve(mA115633,matid(up_to)), v = vector(up_to)); for(n=1,up_to,v[n] = vecsum(mA115636[n,])); (v); };

%o v115637 = A115637list(up_to+1);

%o A115637(n) = v115637[1+n]; \\ _Antti Karttunen_, Nov 02 2018

%o (PARI) a(n) = fromdigits([!b |b<-binary(n+2)], 4); \\ _Kevin Ryde_, Jul 15 2024

%o (Python)

%o def A115637(n): return int(bin((~(n+2))^(-1<<(n+2).bit_length()))[2:],4) # _Chai Wah Wu_, Jul 17 2024

%Y Cf. A000695, A035327, A115633, A115636, A115638 (first differences), A374625.

%K easy,nonn,look

%O 0,3

%A _Paul Barry_, Jan 27 2006

%E New name from _Kevin Ryde_, Jul 15 2024

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 9 13:53 EDT 2024. Contains 375042 sequences. (Running on oeis4.)