cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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, 5, 4, 1, 0, 341, 340, 337, 336, 325, 324, 321, 320, 277, 276, 273, 272, 261, 260, 257, 256, 85, 84, 81, 80, 69, 68, 65, 64, 21, 20, 17, 16, 5, 4, 1, 0, 1365, 1364, 1361, 1360, 1349
Offset: 0

Views

Author

Paul Barry, Jan 27 2006

Keywords

Comments

Row sums of number triangle A115636. Partial sums of A115638.
Old name was "A divide and conquer sequence".

Crossrefs

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

Programs

  • Maple
    b:= n-> 1-(n mod 2)+`if`(n<2, 0, b(iquo(n, 2))*4):
    a:= n-> b(n+2):
    seq(a(n), n=0..66);  # Alois P. Heinz, Jul 16 2024
  • Mathematica
    A115637[n_] := FromDigits[1 - IntegerDigits[n + 2, 2], 4];
    Array[A115637, 100, 0] (* Paolo Xausa, Jul 16 2024 *)
  • PARI
    up_to = 1024;
    A115633array(n, k) = (((-1)^n)*if(n==k,1, if((k+k+2)==n, -4, if((k+1)==n, -(1+(-1)^k)/2, 0))));
    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); };
    v115637 = A115637list(up_to+1);
    A115637(n) = v115637[1+n]; \\ Antti Karttunen, Nov 02 2018
    
  • PARI
    a(n) = fromdigits([!b |b<-binary(n+2)], 4); \\ Kevin Ryde, Jul 15 2024
    
  • Python
    def A115637(n): return int(bin((~(n+2))^(-1<<(n+2).bit_length()))[2:],4) # Chai Wah Wu, Jul 17 2024

Formula

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).
a(n) = A000695(A035327(n+2)). - Kevin Ryde, Jul 15 2024

Extensions

New name from Kevin Ryde, Jul 15 2024