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.

Showing 1-3 of 3 results.

A143095 (1, 2, 4, 8, ...) interleaved with (4, 8, 16, 32, ...).

Original entry on oeis.org

1, 4, 2, 8, 4, 16, 8, 32, 16, 64, 32, 128, 64, 256, 128, 512, 256, 1024, 512, 2048, 1024, 4096, 2048, 8192, 4096, 16384, 8192, 32768, 16384, 65536, 32768, 131072, 65536, 262144, 131072, 524288, 262144, 1048576, 524288, 2097152, 1048576, 4194304
Offset: 0

Views

Author

Keywords

Comments

Partial sums are in A079360. a(n) = A076736(n+5). - Klaus Brockhaus, Jul 27 2009

Crossrefs

Cf. A048655.

Programs

  • Maple
    seq(coeff(series((1+4*x)/(1-2*x^2), x, n+1), x, n), n = 0..45); # G. C. Greubel, Mar 13 2020
  • Mathematica
    nn=30;With[{p=2^Range[0,nn]},Riffle[Take[p,nn-2],Drop[p,2]]] (* Harvey P. Dale, Oct 03 2011 *)
  • Maxima
    A143095(n):=(5-3*(-1)^n)*2^(1/4*(2*n-1+(-1)^n))/2$
    makelist(A143095(n),n,0,30); /* Martin Ettl, Nov 03 2012 */
    
  • PARI
    for(n=0, 41, print1((5-3*(-1)^n)*2^(1/4*(2*n-1+(-1)^n))/2, ",")) \\ Klaus Brockhaus, Jul 27 2009
    
  • Sage
    [(5 -3*(-1)^n)*2^((2*n-1+(-1)^n)/4)/2 for n in (0..45)] # G. C. Greubel, Mar 13 2020

Formula

Inverse binomial transform of A048655: (1, 5, 11, 27, 65, 157, ...).
a(n) = A135530(n+1). - R. J. Mathar, Aug 02 2008
From Klaus Brockhaus, Jul 27 2009: (Start)
a(n) = (5 - 3*(-1)^n) * 2^((2*n-1+(-1)^n)/4)/2.
a(n) = 2*a(n-2) for n > 1; a(0) = 1, a(1) = 4.
G.f.: (1+4*x)/(1-2*x^2). (End)
a(n+3) = a(n+2)*a(n+1)/a(n). - Reinhard Zumkeller, Mar 04 2011

Extensions

More terms from Klaus Brockhaus, Jul 27 2009

A079361 Primes in the sequence of sums of alternating powers of 2.

Original entry on oeis.org

5, 7, 19, 43, 379, 1531, 3067, 24571, 98299, 100663291, 6442450939, 51539607547, 844424930131963, 13510798882111483, 55340232221128654843, 1947111321950560360698936123457531, 133804471191183738849214309635890169035882491
Offset: 1

Views

Author

Cino Hilliard, Feb 15 2003

Keywords

Comments

Sum of reciprocals = 0.4224131591021966740339033736...
Primes in A079360. - R. J. Mathar, Dec 03 2014

Crossrefs

Cf. A079360.

Programs

  • PARI
    /* Primes in the sequence of sums of alternating powers of 2 */ pseq(n) = { j=a=1; p=2; sr=0; while(j<=n, a = a + 2^(p); if(isprime(a),print1(a" "); sr+=1.0/a; ); a = a+2^(p-1); if(isprime(a),print1(a" "); sr+=1.0/a; ); p+=1; j+=2; ); print(); print(sr); }

Extensions

Offset changed by Georg Fischer, Sep 02 2022
a(16)-a(17) from Amiram Eldar, Jul 06 2024

A079362 Sequence of sums of alternating powers of 3.

Original entry on oeis.org

1, 4, 5, 14, 17, 44, 53, 134, 161, 404, 485, 1214, 1457, 3644, 4373, 10934, 13121, 32804, 39365, 98414, 118097, 295244, 354293, 885734, 1062881, 2657204, 3188645, 7971614, 9565937, 23914844, 28697813, 71744534, 86093441, 215233604
Offset: 1

Views

Author

Cino Hilliard, Feb 15 2003

Keywords

Crossrefs

Cf. A079360, A079363, A028242, A048473 (bisection).

Programs

  • GAP
    a:=[1,4,5];; for n in [4..30] do a[n]:=a[n-1]+3*a[n-2]-3*a[n-3]; od; a; # G. C. Greubel, Aug 07 2019
  • Magma
    I:=[1,4,5]; [n le 3 select I[n] else Self(n-1) +3*Self(n-2) -3*Self(n-3): n in [1..40]]; // G. C. Greubel, Aug 07 2019
    
  • Maple
    a[1]:=1:a[2]:=4:for n from 3 to 100 do a[n]:=3*a[n-2]+2 od: seq(a[n], n=1..33); # Zerinvary Lajos, Mar 17 2008
  • Mathematica
    LinearRecurrence[{1,3,-3},{1,4,5},40] (* Harvey P. Dale, Oct 18 2016 *)
  • PARI
    a(n)=if(n<1,0,1+sum(k=2,n,3^((k\2)-(k%2))))
    
  • PARI
    a(n)=if(n<0,0,(5/3-3*n%2)*2^ceil(n/2)-1)
    
  • Sage
    @CachedFunction
    def a(n):
        if (n==0): return 1
        elif (1<=n<=2): return n+3
        else: return a(n-1) + 3*a(n-2) - 3*a(n-3)
    [a(n) for n in (0..40)] # G. C. Greubel, Aug 07 2019
    

Formula

G.f.: x*(1+3*x-2*x^2)/((1-x)*(1-3*x^2)). - Michael Somos, Feb 18 2003
For n >= 1, a(2n-1) = (2/3)*3^n - 1, a(2n) = (5/3)*3^n - 1. - Benoit Cloitre, Feb 16 2003
Showing 1-3 of 3 results.