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.

A004119 a(0) = 1; thereafter a(n) = 3*2^(n-1) + 1.

Original entry on oeis.org

1, 4, 7, 13, 25, 49, 97, 193, 385, 769, 1537, 3073, 6145, 12289, 24577, 49153, 98305, 196609, 393217, 786433, 1572865, 3145729, 6291457, 12582913, 25165825, 50331649, 100663297, 201326593, 402653185, 805306369, 1610612737, 3221225473, 6442450945, 12884901889
Offset: 0

Views

Author

Keywords

Comments

Also Pisot sequence L(4,7) (cf. A008776).
Alternatively, define the sequence S(a(1),a(2)) by: a(n+2) is the least integer such that a(n+2)/a(n+1) > a(n+1)/a(n) for n > 0. This is S(4,7).
a(n) = number of terms of the arithmetic progression with first term 2^(2n-1) and last term 2^(2n+1). So common difference is 2^n. E.g., a(2)=7 corresponds to (8,12,16,20,24,28,32). - Augustine O. Munagi, Feb 21 2007
Equals binomial transform of [1, 3, 0, 3, 0, 3, 0, 3, ...]. - Gary W. Adamson, Aug 27 2010

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A181565 is an essentially identical sequence.
For primes see A002253 and A039687.

Programs

  • Magma
    [1] cat [n le 1 select 4 else 2*Self(n-1)-1: n in [1..40]]; // Vincenzo Librandi, Dec 16 2015
  • Maple
    A004119:=-(-1-z+3*z**2)/(2*z-1)/(z-1); # Simon Plouffe in his 1992 dissertation
  • Mathematica
    s=4;lst={1,s};Do[s=s+(s-1);AppendTo[lst,s],{n,5!}];lst (* Vladimir Joseph Stephan Orlovsky, Nov 30 2009 *)
    Prepend[Table[3*2^n + 1, {n, 0, 32}], 1] (* or *)
    {1}~Join~LinearRecurrence[{3, -2}, {4, 7}, 33] (* Michael De Vlieger, Dec 16 2015 *)
  • PARI
    a(n)=3<Charles R Greathouse IV, Sep 28 2015
    

Formula

a(n) = 3a(n-1) - 2a(n-2).
For n>3, a(3)=13, a(n)= a(n-1)+2*floor(a(n-1)/2). - Benoit Cloitre, Aug 14 2002
For n>=1, a(n) = A049775(n+1)/2^(n-2). For n>=2, a(n) = 2a(n-1)-1; see also A000051. - Philippe Deléham, Feb 20 2004
O.g.f.: -(-1-x+3*x^2)/((2*x-1)*(x-1)). - R. J. Mathar, Nov 23 2007
For n>0, a(n) = 2*a(n-1)-1. - Vincenzo Librandi, Dec 16 2015
E.g.f.: exp(x)*(1 + 3*sinh(x)). - Stefano Spezia, May 06 2023

Extensions

Edited by N. J. A. Sloane, Dec 16 2015 at the suggestion of Bruno Berselli