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.

Previous Showing 11-16 of 16 results.

A114014 Expansion of g.f. (1 + 2*x)^4/((1 + x)*(1 - 16*x^2)).

Original entry on oeis.org

1, 7, 33, 127, 529, 2031, 8465, 32495, 135441, 519919, 2167057, 8318703, 34672913, 133099247, 554766609, 2129587951, 8876265745, 34073407215, 142020251921, 545174515439, 2272324030737, 8722792247023, 36357184491793
Offset: 0

Views

Author

Roger L. Bagula, Jan 31 2006

Keywords

Crossrefs

Cf. A112627.

Programs

  • Magma
    [1,7] cat [(1/30)*(4^(n-1)*(243 + 5*(-1)^n) - 2*(-1)^n): n in [2..40]]; // G. C. Greubel, Jul 07 2021
    
  • Mathematica
    CoefficientList[Series[(1+2*x)^4/((1+x)*(1-16*x^2)), {x, 0, 40}], x]
    a[n_]:= a[n]= If[n<2, 7^n, If[n==2, 33, 4*a[n-1] +(-1)^n*(4^(n-1) -1)/3]];
    Table[a[n], {n, 0, 40}] (* G. C. Greubel, Jul 07 2021 *)
    LinearRecurrence[{-1,16,16},{1,7,33,127,529},30] (* Harvey P. Dale, Aug 07 2023 *)
  • Sage
    [1,7]+[(1/30)*(4^(n-1)*(243 + 5*(-1)^n) - 2*(-1)^n) for n in (2..40)] # G. C. Greubel, Jul 07 2021

Formula

G.f.: (-1)*(x + 1/2)^4/((x - 1/4)*(x + 1/4)*(x + 1)).
From Colin Barker, Dec 03 2012: (Start)
a(n) = (5*(-4)^n - 8*(-1)^n + 243*4^n)/120 for n>1.
G.f.: (1 +8*x +24*x^2 +32*x^3 +16*x^4)/((1+x)*(1-4*x)*(1+4*x)). (End)
From G. C. Greubel, Jul 07 2021: (Start)
a(n) = 4*a(n-1) + (-1)^n*(4^(n-1) -1)/3, n>2, with a(0) = 1, a(1) = 7, and a(2) = 33.
E.g.f.: (1/120)(243*exp(4*x) + 5*exp(-4*x) - 8*exp(-x) - 120*(1 + x)). (End)

Extensions

New name and edited by G. C. Greubel, Jul 07 2021

A115243 G.f.: (4*x^2 + 2*x)/(4*x^3 - x^2 - 4*x + 1).

Original entry on oeis.org

0, 2, 12, 50, 204, 818, 3276, 13106, 52428, 209714, 838860, 3355442, 13421772, 53687090, 214748364, 858993458, 3435973836, 13743895346, 54975581388, 219902325554, 879609302220, 3518437208882, 14073748835532, 56294995342130, 225179981368524, 900719925474098
Offset: 0

Views

Author

Roger L. Bagula, Mar 04 2006

Keywords

Comments

Inverse Z-transform of polynomial in A112627.
a(n) is also the number of corners in the n-th approximation of the Hilbert Curve. The 1st Hilbert Curve approximation has 2 corners. To find a(n) given a(n - 1), look at how the n-th Hilbert Curve approximation is constructed: duplicate the (n-1)-th approximation 4 times and connect the duplicates with 3 line segments. a(n) will always be 4 * a(n - 1) corners from the 4 duplicates plus 4 new corners if n is even or 2 new corners if n is odd. - Mikel Mcdaniel, Jan 10 2019

Crossrefs

Cf. A112627.

Programs

  • Magma
    [(4^(n+1)+(-1)^n)/5 - 1: n in [0..25]]; // Vincenzo Librandi, Jan 10 2019
    
  • Maple
    seq((4^(n+1)+(-1)^n)/5 - 1, n=0..100); # Robert Israel, Mar 09 2016
  • Mathematica
    Table[InverseZTransform[(1 + 2*x)/(1 - x - 16*x^2 + 16*x^3), x, n]*2^( 2*n), {n, 1, 25}]
    LinearRecurrence[{4, 1, -4}, {0, 2, 12}, 50] (* G. C. Greubel, Feb 07 2016 *)
  • PARI
    a(n) = (bitneg(0,2*n+2)-1)\5; \\ Kevin Ryde, May 05 2023

Formula

a(n) = InverseZTransform[(1 + 2*x)/(1 - x - 16*x^2 + 16*x^3), x, n] * 2^(2*n).
a(n) = 5*a(n-1)-4*a(n-2) +2*(-1)^n.
a(n) = 4*a(n-1)+a(n-2)-4*a(n-3). - Gary Detlefs Dec 17 2010
a(n) = (4^(n+1)+(-1)^n)/5 - 1. - Robert Israel, Mar 09 2016
a(n) = 4*a(n-1)+3+(-1)^n. - Mikel Mcdaniel, Jan 10 2019

Extensions

Entry revised by N. J. A. Sloane, Dec 18 2010

A182460 a(n) = (3/5)*2^(4n+1) - (1/5).

Original entry on oeis.org

1, 19, 307, 4915, 78643, 1258291, 20132659, 322122547, 5153960755, 82463372083, 1319413953331, 21110623253299, 337769972052787, 5404319552844595, 86469112845513523, 1383505805528216371, 22136092888451461939, 354177486215223391027, 5666839779443574256435, 90669436471097188102963, 1450710983537555009647411
Offset: 0

Views

Author

Brad Clardy, Apr 30 2012

Keywords

Comments

Bisection of A112627.

Crossrefs

Programs

  • Magma
    [(3/5)*2^(4*n+1) - (1/5): n in [0..20]];
  • Mathematica
    (3*2^(4*Range[0,20]+1)-1)/5 (* or *) LinearRecurrence[{17,-16},{1,19},30] (* Harvey P. Dale, Jul 21 2021 *)

Formula

a(n) = (3/5)*2^(4*n+1) - (1/5).
a(n) = 16*a(n-1) + 3 for n > 0.
a(n) = (1/5)*A153893(4*n+1).
a(n) = A016029(4*n+2).
a(n) = A112627(2*n+1).
G.f.: (1+2*x)/((1-x)*(1-16*x)). - Colin Barker, May 06 2012

A273180 Numbers n such that ror(n) + rol(n) is a power of 2, where ror(n)=A038572(n) is n rotated one binary place to the right, rol(n)=A006257(n) is n rotated one binary place to the left.

Original entry on oeis.org

1, 2, 6, 19, 38, 102, 307, 614, 1638, 4915, 9830, 26214, 78643, 157286, 419430, 1258291, 2516582, 6710886, 20132659, 40265318, 107374182, 322122547, 644245094, 1717986918, 5153960755, 10307921510, 27487790694, 82463372083, 164926744166, 439804651110
Offset: 1

Views

Author

Alex Ratushnyak, May 17 2016

Keywords

Crossrefs

Programs

  • C
    #include 
    int main(int argc, char** argv)
    {
      unsigned long long x, n, BL=0;
      for (n=1; n>0; ++n) {
        if ((n & (n-1))==0)  ++BL;
        x = (n>>1) + ((n&1) << (BL-1));   // A038572(n)
        x+= (n*2) - (1ull<A006257(n)  for n>0
        if ((x & (x-1))==0)  printf("%lld, ", n);
      }
    }
    
  • Mathematica
    Select[Range[10^6], IntegerQ@ Log2[FromDigits[RotateRight@ #, 2] + FromDigits[RotateLeft@ #, 2]] &@ IntegerDigits[#, 2] &] (* or *)
    Rest@ CoefficientList[Series[x (1 + 2 x + 6 x^2 + 2 x^3 + 4 x^4)/((1 - x) (1 + x + x^2) (1 - 16 x^3)), {x, 0, 30}], x] (* Michael De Vlieger, May 19 2016 *)
  • PARI
    Vec(x*(1+2*x+6*x^2+2*x^3+4*x^4)/((1-x)*(1+x+x^2)*(1-16*x^3)) + O(x^50)) \\ Colin Barker, May 19 2016

Formula

From Colin Barker, May 19 2016: (Start)
a(n) = 17*a(n-3) - 16*a(n-6) for n>6.
G.f.: x*(1+2*x+6*x^2+2*x^3+4*x^4) / ((1-x)*(1+x+x^2)*(1-16*x^3)).
(End)

A309709 Number of binary digits that change when n is multiplied by 4.

Original entry on oeis.org

0, 2, 2, 4, 2, 2, 4, 4, 2, 4, 2, 4, 4, 4, 4, 4, 2, 4, 4, 6, 2, 2, 4, 4, 4, 6, 4, 6, 4, 4, 4, 4, 2, 4, 4, 6, 4, 4, 6, 6, 2, 4, 2, 4, 4, 4, 4, 4, 4, 6, 6, 8, 4, 4, 6, 6, 4, 6, 4, 6, 4, 4, 4, 4, 2, 4, 4, 6, 4, 4, 6, 6, 4, 6, 4, 6, 6, 6, 6, 6, 2, 4, 4, 6, 2, 2, 4, 4
Offset: 0

Views

Author

Ali Sada, Aug 14 2019

Keywords

Comments

All terms are even.

Examples

			00101_2 * 100_2 = 10100_2: 2 bits changed, so a(5) = 2.
		

Crossrefs

Programs

  • Maple
    a:= n-> add(i, i=Bits[Split](Bits[Xor](n*4,n))):
    seq(a(n), n=0..120);  # Alois P. Heinz, Aug 23 2019
  • Mathematica
    a[n_] := Total@ IntegerDigits[BitXor[n, 4 n], 2]; Array[a, 88, 0] (* Giovanni Resta, Sep 19 2019 *)
  • PARI
    A309709(n) = hammingweight(bitxor(n, n<<2)); \\ Antti Karttunen, Aug 22 2019
    
  • Python
    def A309709(n):
        s = ""
        while n > 0:
            s, n = str(n%2)+s,n//2
        s, s4, i, j = "00"+s, s+"00", 0, 0
        while i < len(s):
            if s[i] != s4[i]:
                j = j+1
            i = i+1
        return j # A.H.M. Smeets, Aug 23 2019

Formula

a(n) = A000120(A048725(n)). - Antti Karttunen, Aug 22 2019
a(A112627(n)) = 2*n and A112627(n) is the first position where 2*n occurs in this sequence. - David A. Corneth, Sep 19 2019

A113968 a(0) = 0 and a(n) = (5*(-4)^n + 16*(-1)^n + 9*4^n)/240 for n >= 1.

Original entry on oeis.org

0, 0, 1, 1, 15, 17, 239, 273, 3823, 4369, 61167, 69905, 978671, 1118481, 15658735, 17895697, 250539759, 286331153, 4008636143, 4581298449, 64138178287, 73300775185, 1026210852591, 1172812402961, 16419373641455, 18764998447377
Offset: 0

Views

Author

Roger L. Bagula, Jan 31 2006

Keywords

Crossrefs

Cf. A112627.

Programs

  • Mathematica
    a[n_] := If[n == 0, 1, (5(-4)^n + 16(-1)^n + 9*4^n) / 240];
    a /@ Range[0, 25] (* Jean-François Alcover, Mar 30 2021 *)

Formula

From Colin Barker, Dec 03 2012: (Start)
a(n) = (5*(-4)^n + 16*(-1)^n + 9*4^n)/240 for n>0.
G.f.: -x^2*(2*x+1) / ((x+1)*(4*x-1)*(4*x+1)). (End)

Extensions

New name (using Colin Barker's formula) from Joerg Arndt, Aug 30 2022
Previous Showing 11-16 of 16 results.