[go: up one dir, main page]

login
A052940
a(0) = 1; a(n) = 3*2^n - 1, for n > 0.
15
1, 5, 11, 23, 47, 95, 191, 383, 767, 1535, 3071, 6143, 12287, 24575, 49151, 98303, 196607, 393215, 786431, 1572863, 3145727, 6291455, 12582911, 25165823, 50331647, 100663295, 201326591, 402653183, 805306367, 1610612735, 3221225471, 6442450943, 12884901887
OFFSET
0,2
COMMENTS
A simple regular expression.
Numbers k > 1 such that a(k-1)^2 + a(k) is square, e.g., 5^2 + 11 = 6^2; 11^2 + 23 = 12^2. - Vincenzo Librandi, Aug 06 2010
Numerator of the sum of terms at the n-th level of the Calkin-Wilf tree. - Carl Najafi, Jul 10 2011
FORMULA
G.f.: (1+2*x-2*x^2)/((1-x)*(1-2*x)).
a(n) = 3*a(n-1) - 2*a(n-2) for n > 2.
Binomial transform of 3 - 0^n - (-1)^n = (1, 4, 2, 4, 2, 4, 2, ...). - Paul Barry, Jun 30 2003
a(n) = A107909(A023548(n+1)) for n > 1. - Reinhard Zumkeller, May 28 2005
Row sums of triangle A134060. - Gary W. Adamson, Oct 05 2007
Equals row sums of triangle A140182. - Gary W. Adamson, May 11 2008
Equals M*Q, where M is a modified Pascal triangle (1,2) with first term "1" instead of 2; as an infinite lower triangular matrix. Q is the vector (1, 2, 2, 2, ...). - Gary W. Adamson, Nov 30 2015
From Gennady Eremin, Aug 29 2023: (Start)
a(n+1) = 2*a(n) + 1 for n > 0.
a(n) = (A000225(n+1) + A000225(n+2))/2 for n > 0. (End)
MAPLE
spec:= [S, {S=Prod(Sequence(Union(Z, Z)), Union(Sequence(Z), Z, Z))}, unlabeled ]: seq(combstruct[count ](spec, size=n), n=0..20);
seq(`if`(n=0, 1, 3*2^n -1), n=0..30); # G. C. Greubel, Oct 18 2019
MATHEMATICA
Join[{1}, Table[3*2^n-1, {n, 30}]] (* or *) Join[{1}, LinearRecurrence[{3, -2}, {5, 11}, 30]] (* Harvey P. Dale, Mar 07 2015 *)
PROG
(PARI) a(n)=if(n, 3*2^n-1, 1) \\ Charles R Greathouse IV, Oct 07 2015
(PARI) Vec((1+2*x-2*x^2)/(-1+2*x)/(-1+x) + O(x^30)) \\ Altug Alkan, Dec 01 2015
(Magma) [1] cat [3*2^n - 1: n in [1..30]]; // Vincenzo Librandi, Dec 01 2015
(Sage) [1]+[3*2^n -1 for n in (1..30)] # G. C. Greubel, Oct 18 2019
(GAP) Concatenation([1], List([1..30], n-> 3*2^n -1)); # G. C. Greubel, Oct 18 2019
(Python)
print([1] + [(3<<n)-1 for n in range(1, 30)]) # Gennady Eremin, Aug 29 2023
CROSSREFS
Apart from initial terms, same as A055010 and A083329.
Subsequence of A036991.
Sequence in context: A181669 A362082 A306662 * A191304 A102444 A132177
KEYWORD
easy,nonn
AUTHOR
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
EXTENSIONS
More terms from James A. Sellers, Jun 08 2000
a(30)-a(32) from Vincenzo Librandi, Dec 01 2015
STATUS
approved