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-10 of 48 results. Next

A276918 a(2n) = A060867(n+1), a(2n+1) = A092440(n+1).

Original entry on oeis.org

1, 5, 9, 25, 49, 113, 225, 481, 961, 1985, 3969, 8065, 16129, 32513, 65025, 130561, 261121, 523265, 1046529, 2095105, 4190209, 8384513, 16769025, 33546241, 67092481, 134201345, 268402689, 536838145, 1073676289, 2147418113, 4294836225, 8589803521, 17179607041
Offset: 0

Views

Author

Daniel Poveda Parrilla, Jan 26 2017

Keywords

Comments

In binary there is a pattern in how the zeros and ones appear:
a(0) = 01
a(1) = 101
a(2) = 1001
a(3) = 11001
a(4) = 110001
a(5) = 1110001
a(6) = 11100001
a(7) = 111100001
a(8) = 1111000001
a(9) = 11111000001
a(10) = 111110000001
a(11) = 1111110000001
a(12) = 11111100000001
a(13) = 111111100000001
a(14) = 1111111000000001
a(15) = 11111111000000001
Graphically, each term can be obtained by successively and alternately forming squares and centered squares as shown in the illustration.

Crossrefs

Programs

  • Mathematica
    Table[1+2^(n+2)-2^(1+n/2)+(-1)^(n+1) 2^(1+n/2)-2^((n+1)/2)+(-1)^(n+2) 2^((n+1)/2), {n,0,28}] (*or*)
    CoefficientList[Series[(-1 - 2 x + 6 x^2 - 4 x^3)/(-1 + 3 x - 6 x^3 + 4 x^4), {x,0,28}], x] (*or*)
    LinearRecurrence[{3, 0, -6, 4}, {1, 5, 9, 25}, 29]
  • PARI
    Vec((-1-2*x+6*x^2-4*x^3) / (-1+3*x-6*x^3+4*x^4) + O(x^29))

Formula

a(n) = 1 + 2^(n+2) - 2^(1 + n/2) + (-1)^(n+1)*2^(1 + n/2) - 2^((n+1)/2) + (-1)^(n+2)*2^((n+1)/2).
a(n) = 3*a(n-1) - 6*a(n-3) + 4*a(n-4) for n>3.
G.f.: (-1-2*x+6*x^2-4*x^3)/(-1+3*x-6*x^3+4*x^4).

A027383 a(2*n) = 3*2^n - 2; a(2*n+1) = 2^(n+2) - 2.

Original entry on oeis.org

1, 2, 4, 6, 10, 14, 22, 30, 46, 62, 94, 126, 190, 254, 382, 510, 766, 1022, 1534, 2046, 3070, 4094, 6142, 8190, 12286, 16382, 24574, 32766, 49150, 65534, 98302, 131070, 196606, 262142, 393214, 524286, 786430, 1048574, 1572862, 2097150, 3145726, 4194302, 6291454
Offset: 0

Views

Author

Keywords

Comments

Number of balanced strings of length n: let d(S) = #(1's) - #(0's), # == count in S, then S is balanced if every substring T of S has -2 <= d(T) <= 2.
Number of "fold lines" seen when a rectangular piece of paper is folded n+1 times along alternate orthogonal directions and then unfolded. - Quim Castellsaguer (qcastell(AT)pie.xtec.es), Dec 30 1999
Also the number of binary strings with the property that, when scanning from left to right, once the first 1 is seen in position j, there must be a 1 in positions j+2, j+4, ... until the end of the string. (Positions j+1, j+3, ... can be occupied by 0 or 1.) - Jeffrey Shallit, Sep 02 2002
a(n-1) is also the Moore lower bound on the order of a (3,n)-cage. - Eric W. Weisstein, May 20 2003 and Jason Kimberley, Oct 30 2011
Partial sums of A016116. - Hieronymus Fischer, Sep 15 2007
Equals row sums of triangle A152201. - Gary W. Adamson, Nov 29 2008
From John P. McSorley, Sep 28 2010: (Start)
a(n) = DPE(n+1) is the total number of k-double-palindromes of n up to cyclic equivalence. See sequence A180918 for the definitions of a k-double-palindrome of n and of cyclic equivalence. Sequence A180918 is the 'DPE(n,k)' triangle read by rows where DPE(n,k) is the number of k-double-palindromes of n up to cyclic equivalence. For example, we have a(4) = DPE(5) = DPE(5,1) + DPE(5,2) + DPE(5,3) + DPE(5,4) + DPE(5,5) = 0 + 2 + 2 + 1 + 1 = 6.
The 6 double-palindromes of 5 up to cyclic equivalence are 14, 23, 113, 122, 1112, 11111. They come from cyclic equivalence classes {14,41}, {23,32}, {113,311,131}, {122,212,221}, {1112,2111,1211,1121}, and {11111}. Hence a(n)=DPE(n+1) is the total number of cyclic equivalence classes of n containing at least one double-palindrome.
(End)
From Herbert Eberle, Oct 02 2015: (Start)
For n > 0, there is a red-black tree of height n with a(n-1) internal nodes and none with less.
In order a red-black tree of given height has minimal number of nodes, it has exactly 1 path with strictly alternating red and black nodes. All nodes outside this height defining path are black.
Consider:
mrbt5 R
/ \
/ \
/ \
/ B
/ / \
mrbt4 B / B
/ \ B E E
/ B E E
mrbt3 R E E
/ \
/ B
mrbt2 B E E
/ E
mrbt1 R
E E
(Red nodes shown as R, blacks as B, externals as E.)
Red-black trees mrbt1, mrbt2, mrbt3, mrbt4, mrbt5 of respective heights h = 1, 2, 3, 4, 5; all minimal in the number of internal nodes, namely 1, 2, 4, 6, 10.
Recursion (let n = h-1): a(-1) = 0, a(n) = a(n-1) + 2^floor(n/2), n >= 0.
(End)
Also the number of strings of length n with the digits 1 and 2 with the property that the sum of the digits of all substrings of uneven length is not divisible by 3. An example with length 8 is 21221121. - Herbert Kociemba, Apr 29 2017
a(n-2) is the number of achiral n-bead necklaces or bracelets using exactly two colors. For n=4, the four arrangements are AAAB, AABB, ABAB, and ABBB. - Robert A. Russell, Sep 26 2018
Partial sums of powers of 2 repeated 2 times, like A200672 where is 3 times. - Yuchun Ji, Nov 16 2018
Also the number of binary words of length n with cuts-resistance <= 2, where, for the operation of shortening all runs by one, cuts-resistance is the number of applications required to reach an empty word. Explicitly, these are words whose sequence of run-lengths, all of which are 1 or 2, has no odd-length run of 1's sandwiched between two 2's. - Gus Wiseman, Nov 28 2019
Also the number of up-down paths with n steps such that the height difference between the highest and lowest points is at most 2. - Jeremy Dover, Jun 17 2020
Also the number of non-singleton integer compositions of n + 2 with no odd part other than the first or last. Including singletons gives A052955. This is an unsorted (or ordered) version of A351003. The version without even (instead of odd) interior parts is A001911, complement A232580. Note that A000045(n-1) counts compositions without odd parts, with non-singleton case A077896, and A052952/A074331 count non-singleton compositions without even parts. Also the number of compositions y of n + 1 such that y_i = y_{i+1} for all even i. - Gus Wiseman, Feb 19 2022

Examples

			After 3 folds one sees 4 fold lines.
Example: a(3) = 6 because the strings 001, 010, 100, 011, 101, 110 have the property.
Binary: 1, 10, 100, 110, 1010, 1110, 10110, 11110, 101110, 111110, 1011110, 1111110, 10111110, 11111110, 101111110, 111111110, 1011111110, 1111111110, 10111111110, ... - _Jason Kimberley_, Nov 02 2011
Example: Partial sums of powers of 2 repeated 2 times:
a(3) = 1+1+2 = 4;
a(4) = 1+1+2+2 = 6;
a(5) = 1+1+2+2+4 = 10.
_Yuchun Ji_, Nov 16 2018
		

References

  • John P. McSorley: Counting k-compositions of n with palindromic and related structures. Preprint, 2010. [John P. McSorley, Sep 28 2010]

Crossrefs

Moore lower bound on the order of a (k,g) cage: A198300 (square); rows: A000027 (k=2), this sequence (k=3), A062318 (k=4), A061547 (k=5), A198306 (k=6), A198307 (k=7), A198308 (k=8), A198309 (k=9), A198310 (k=10), A094626 (k=11); columns: A020725 (g=3), A005843 (g=4), A002522 (g=5), A051890 (g=6), A188377 (g=7). - Jason Kimberley, Oct 30 2011
Cf. A000066 (actual order of a (3,g)-cage).
Bisections are A033484 (even) and A000918 (odd).
a(n) = A305540(n+2,2), the second column of the triangle.
Numbers whose binary expansion is a balanced word are A330029.
Binary words counted by cuts-resistance are A319421 or A329860.
The complementary compositions are counted by A274230(n-1) + 1, with bisections A060867 (even) and A134057 (odd).
Cf. A000346, A000984, A001405, A001700, A011782 (compositions).
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A029744 = {s(n), n>=1}, the numbers 2^k and 3*2^k, as the parent: A029744 (s(n)); A052955 (s(n)-1), A027383 (s(n)-2), A354788 (s(n)-3), A347789 (s(n)-4), A209721 (s(n)+1), A209722 (s(n)+2), A343177 (s(n)+3), A209723 (s(n)+4); A060482, A136252 (minor differences from A354788 at the start); A354785 (3*s(n)), A354789 (3*s(n)-7). The first differences of A029744 are 1,1,1,2,2,4,4,8,8,... which essentially matches eight sequences: A016116, A060546, A117575, A131572, A152166, A158780, A163403, A320770. The bisections of A029744 are A000079 and A007283. - N. J. A. Sloane, Jul 14 2022

Programs

  • Haskell
    import Data.List (transpose)
    a027383 n = a027383_list !! n
    a027383_list = concat $ transpose [a033484_list, drop 2 a000918_list]
    -- Reinhard Zumkeller, Jun 17 2015
    
  • Magma
    [2^Floor((n+2)/2)+2^Floor((n+1)/2)-2: n in [0..50]]; // Vincenzo Librandi, Aug 16 2011
    
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=2*a[n-2]+2 od: seq(a[n], n=1..41); # Zerinvary Lajos, Mar 16 2008
  • Mathematica
    a[n_?EvenQ] := 3*2^(n/2)-2; a[n_?OddQ] := 2^(2+(n-1)/2)-2; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Oct 21 2011, after Quim Castellsaguer *)
    LinearRecurrence[{1, 2, -2}, {1, 2, 4}, 41] (* Robert G. Wilson v, Oct 06 2014 *)
    Table[Length[Select[Tuples[{0,1},n],And[Max@@Length/@Split[#]<=2,!MatchQ[Length/@Split[#],{_,2,ins:1..,2,_}/;OddQ[Plus[ins]]]]&]],{n,0,15}] (* Gus Wiseman, Nov 28 2019 *)
  • PARI
    a(n)=2^(n\2+1)+2^((n+1)\2)-2 \\ Charles R Greathouse IV, Oct 21 2011
    
  • Python
    def a(n): return 2**((n+2)//2) + 2**((n+1)//2) - 2
    print([a(n) for n in range(43)]) # Michael S. Branicky, Feb 19 2022

Formula

a(0)=1, a(1)=2; thereafter a(n+2) = 2*a(n) + 2.
a(2n) = 3*2^n - 2 = A033484(n);
a(2n-1) = 2^(n+1) - 2 = A000918(n+1).
G.f.: (1 + x)/((1 - x)*(1 - 2*x^2)). - David Callan, Jul 22 2008
a(n) = Sum_{k=0..n} 2^min(k, n-k).
a(n) = 2^floor((n+2)/2) + 2^floor((n+1)/2) - 2. - Quim Castellsaguer (qcastell(AT)pie.xtec.es)
a(n) = 2^(n/2)*(3 + 2*sqrt(2) + (3-2*sqrt(2))*(-1)^n)/2 - 2. - Paul Barry, Apr 23 2004
a(n) = A132340(A052955(n)). - Reinhard Zumkeller, Aug 20 2007
a(n) = A052955(n+1) - 1. - Hieronymus Fischer, Sep 15 2007
a(n) = A132666(a(n+1)) - 1. - Hieronymus Fischer, Sep 15 2007
a(n) = A132666(a(n-1)+1) for n > 0. - Hieronymus Fischer, Sep 15 2007
A132666(a(n)) = a(n-1) + 1 for n > 0. - Hieronymus Fischer, Sep 15 2007
G.f.: (1 + x)/((1 - x)*(1 - 2*x^2)). - David Callan, Jul 22 2008
a(n) = 2*( (a(n-2)+1) mod (a(n-1)+1) ), n > 1. - Pierre Charland, Dec 12 2010
a(n) = A136252(n-1) + 1, for n > 0. - Jason Kimberley, Nov 01 2011
G.f.: (1+x*R(0))/(1-x), where R(k) = 1 + 2*x/( 1 - x/(x + 1/R(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 16 2013
a(n) = 2^((2*n + 3*(1-(-1)^n))/4)*3^((1+(-1)^n)/2) - 2. - Luce ETIENNE, Sep 01 2014
a(n) = a(n-1) + 2^floor((n-1)/2) for n>0, a(0)=1. - Yuchun Ji, Nov 23 2018
E.g.f.: 3*cosh(sqrt(2)*x) - 2*cosh(x) + 2*sqrt(2)*sinh(sqrt(2)*x) - 2*sinh(x). - Stefano Spezia, Apr 06 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 24 2000
Replaced definition with a simpler one. - N. J. A. Sloane, Jul 09 2022

A014551 Jacobsthal-Lucas numbers.

Original entry on oeis.org

2, 1, 5, 7, 17, 31, 65, 127, 257, 511, 1025, 2047, 4097, 8191, 16385, 32767, 65537, 131071, 262145, 524287, 1048577, 2097151, 4194305, 8388607, 16777217, 33554431, 67108865, 134217727, 268435457, 536870911, 1073741825, 2147483647, 4294967297, 8589934591
Offset: 0

Views

Author

Keywords

Comments

Also gives the number of points of period n in the subshift of finite type corresponding to the square matrix A=[1,2;1,0] (this is then given by trace(A^n)). - Thomas Ward, Mar 07 2001
Sequence is identical to its signed inverse binomial transform (autosequence of the second kind). - Paul Curtz, Jul 11 2008
a(n) can be expressed in terms of values of the Fibonacci polynomials F_n(x), computed at x=1/sqrt(2). - Tewodros Amdeberhan (tewodros(AT)math.mit.edu), Dec 15 2008
Pisano period lengths: 1, 1, 2, 2, 4, 2, 6, 2, 6, 4, 10, 2, 12, 6, 4, 2, 8, 6, 18, 4, ... - R. J. Mathar, Aug 10 2012
Let F(x) = Product_{n >= 0} (1 - x^(3*n+1))/(1 - x^(3*n+2)). This sequence is the simple continued fraction expansion of the real number 1 + F(-1/2) = 2.83717 78068 73232 99799 ... = 2 + 1/(1 + 1/(5 + 1/(7 + 1/(17 + ...)))). See A111317. - Peter Bala, Dec 26 2012
With different signs, 2, -1, 5, -7, 17, -31, 65, -127, 257, -511, 1025, -2047, ... is the Lucas V(-1,-2) sequence. - R. J. Mathar, Jan 08 2013
The identity 2 = 2/2 + 2^2/(2*1) - 2^3/(2*1*5) - 2^4/(2*1*5*7) + 2^5/(2*1*5*7*17) + 2^6/(2*1*5*7*17*31) - - + + can be viewed as a generalized Engel-type expansion of the number 2 to the base 2. Compare with A062510. - Peter Bala, Nov 13 2013
For n >= 2, a(n) is the number of ways to tile a 2 X n strip, where the first two columns have an extra cell at the top, with 1 X 2 dominoes and 2 X 2 squares. Shown here is one of the a(7)=127 ways for the n=7 case:
._.
|_|_________.
| | | |_| |
||__|_|_|_|. - Greg Dresden, Sep 26 2021
Named by Horadam (1988) after the German mathematician Ernst Jacobsthal (1882-1965) and the French mathematician Édouard Lucas (1842-1891). - Amiram Eldar, Oct 02 2023

References

  • G. Everest, A. van der Poorten, I. Shparlinski and T. Ward, Recurrence Sequences, Amer. Math. Soc., 2003; see esp. pp. 180, 255.
  • Lind and Marcus, An Introduction to Symbolic Dynamics and Coding, Cambridge University Press, 1995. (General material on subshifts of finite type)
  • Kritkhajohn Onphaeng and Prapanpong Pongsriiam. Jacobsthal and Jacobsthal-Lucas Numbers and Sums Introduced by Jacobsthal and Tverberg. Journal of Integer Sequences, Vol. 20 (2017), Article 17.3.6.
  • Abdelmoumène Zekiri, Farid Bencherif, Rachid Boumahdi, Generalization of an Identity of Apostol, J. Int. Seq., Vol. 21 (2018), Article 18.5.1.

Crossrefs

Cf. A001045 (companion "autosequence"), A019322, A066845, A111317.
Cf. A135440 (first differences), A166920 (partial sums).
Cf. A006995.

Programs

Formula

a(n+1) = 2 * a(n) - (-1)^n * 3.
From Len Smiley, Dec 07 2001: (Start)
a(n) = 2^n + (-1)^n.
G.f.: (2-x)/(1-x-2*x^2). (End)
E.g.f.: exp(x) + exp(-2*x) produces a signed version. - Paul Barry, Apr 27 2003
a(n+1) = Sum_{k=0..floor(n/2)} binomial(n-1, 2*k)*3^(2*k)/2^(n-2). - Paul Barry, Feb 21 2003
0, 1, 5, 7 ... is 2^n - 2*0^n + (-1)^n, the 2nd inverse binomial transform of (2^n-1)^2 (A060867). - Paul Barry, Sep 05 2003
a(n) = 2*T(n, i/(2*sqrt(2))) * (-i*sqrt(2))^n with i^2=-1. - Paul Barry, Nov 17 2003
a(n) = A078008(n) + A001045(n+1). - Paul Barry, Feb 12 2004
a(n) = 2*A001045(n+1) - A001045(n). - Paul Barry, Mar 22 2004
a(0)=2, a(1)=1, a(n) = a(n-1) + 2*a(n-2) for n > 1. - Philippe Deléham, Nov 07 2006
a(2*n+1) = Product_{d|(2*n+1)} cyclotomic(d,2). a(2^k*(2*n+1)) = Product_{d|(2*n+1)} cyclotomic(2*d,2^(2^k)). - Miklos Kristof, Mar 12 2007
a(n) = 2^{(n-1)/2}F_{n-1}(1/sqrt(2)) + 2^{(n+2)/2}F_{n-2}(1/sqrt(2)). - Tewodros Amdeberhan (tewodros(AT)math.mit.edu), Dec 15 2008
E.g.f.: U(0) where U(k) = 1 + (-1)^k/(2^k - 4^k*x*2/(2*x*2^k + (-1)^k*(k+1)/U(k+1))) ; (continued fraction, 3rd kind, 3-step). - Sergei N. Gladkovskii, Nov 02 2012
G.f.: U(0) where U(k) = 1 + (-1)^k/(2^k - 4^k*x*2/(2*x*2^k + (-1)^k/U(k+1))) ; (continued fraction, 3rd kind, 3-step). - Sergei N. Gladkovskii, Nov 02 2012
a(n) = sqrt(9*(A001045)^2 + (-1)^n*2^(n+2)). - Vladimir Shevelev, Mar 13 2013
G.f.: 2 + G(0)*x*(1+4*x)/(2-x), where G(k) = 1 + 1/(1 - x*(9*k-1)/( x*(9*k+8) - 2/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 13 2013
a(n) = [x^n] ( (1 + x + sqrt(1 + 2*x + 9*x^2))/2 )^n for n >= 1. - Peter Bala, Jun 23 2015
For n >= 1: a(n) = A006995(2^((n+2)/2)) when n is even, a(n) = A006995(3*2^((n-1)/2) - 1) when n is odd. - Bob Selcoe, Sep 04 2017
a(n) = J(n) + 4*J(n-1), a(0)=2, where J is A001045. - Yuchun Ji, Apr 23 2019
For n >= 0, 1/(2*a(n+1)) = Sum_{m>=n} a(m)/(a(m+1)*a(m+2)). - Kai Wang, Mar 03 2020
For 4 > h >= 0, k >= 0, a(4*k+h) mod 5 = a(h) mod 5. - Kai Wang, May 06 2020
From Kai Wang, May 30 2020: (Start)
(2 - a(n+1)/a(n))/9 = Sum_{m>=n} (-2)^m/(a(m)*a(m+1)).
a(n) = 2*A001045(n+1) - A001045(n).
a(n)^2 = a(2*n) + 2*(-2)^n.
a(n)^2 = 9*A001045(n)^2 + 4*(-2)^n.
a(2*n) = 9*A001045(n)^2 + 2*(-2)^n.
2*A001045(m+n) = A001045(m)*a(n) + a(m)*A001045(n).
2*(-2)^n*A001045(m-n) = A001045(m)*a(n) - a(m)*A001045(n).
A001045(m+n) + (-2)^n*A001045(m-n) = A001045(m)*a(n).
A001045(m+n) - (-2)^n*A001045(m-n) = a(m)*A001045(n).
2*a(m+n) = 9*A001045(m)*A001045(n) + a(m)*a(n).
2*(-2)^n*a(m-n) = a(m)*a(n) - 9*A001045(m)*A001045(n).
a(m+n) - (-2)^n*a(m-n) = 9*A001045(m)*A001045(n).
a(m+n) + (-2)^n*a(m-n) = a(m)*a(n).
a(m+n)*a(m-n) - a(m)*a(m) = 9*(-2)^(m-n)*A001045(n)^2.
a(m+1)*a(n) - a(m)*a(n+1) = 9*(-2)^n*A001045(m-n). (End)
a(n) = F(n+1) + F(n-1) + Sum_{k=0..(n-2)} a(k)*F(n-1-k) for F(n) the Fibonacci numbers and for n > 1. - Greg Dresden, Jun 03 2020

A020522 a(n) = 4^n - 2^n.

Original entry on oeis.org

0, 2, 12, 56, 240, 992, 4032, 16256, 65280, 261632, 1047552, 4192256, 16773120, 67100672, 268419072, 1073709056, 4294901760, 17179738112, 68719214592, 274877382656, 1099510579200, 4398044413952, 17592181850112, 70368735789056, 281474959933440
Offset: 0

Views

Author

Keywords

Comments

Number of walks of length 2*n+2 between any two diametrically opposite vertices of the cycle graph C_8. - Herbert Kociemba, Jul 02 2004
If we consider a(4*k+2), then 2^4 == 3^4 == 3 (mod 13); 2^(4*k+2) + 3^(4*k+2) == 3^k*(4+9) == 3*0 == 0 (mod 13). So a(4*k+2) can never be prime. - Jose Brox, Dec 27 2005
If k is odd, then a(n*k) is divisible by a(n), since: a(n*k) = (2^n)^k + (3^n)^k = (2^n + 3^n)*((2^n)^(k-1) - (2^n)^(k-2) (3^n) + - ... + (3^n)^(k-1)). So the only possible primes in the sequence are a(0) and a(2^n) for n>=1. I've checked that a(2^n) is composite for 3 <= n <= 15. As with Fermat primes, a probabilistic argument suggests that there are only finitely many primes in the sequence. - Dean Hickerson, Dec 27 2005
Let x,y,z be elements from some power set P(n), i.e., the power set of a set of n elements. Define a function f(x,y,z) in the following manner: f(x,y,z) = 1 if x is a subset of y and y is a subset of z and x does not equal z; f(x,y,z) = 0 if x is not a subset of y or y is not a subset of z or x equals z. Now sum f(x,y,z) for all x,y,z of P(n). This gives a(n). - Ross La Haye, Dec 26 2005
Number of monic (irreducible) polynomials of degree 1 over GF(2^n). - Max Alekseyev, Jan 13 2006
Let P(A) be the power set of an n-element set A and B be the Cartesian product of P(A) with itself. Then a(n) = the number of (x,y) of B for which x does not equal y. - Ross La Haye, Jan 02 2008
For n>1: central terms of the triangle in A173787. - Reinhard Zumkeller, Feb 28 2010
Pronic numbers of the form: (2^n - 1)*2^n, which is the n-th Mersenne number times 2^n, see A000225 and A002378. - Fred Daniel Kline, Nov 30 2013
Indices where records of A037870 occur. - Philippe Beaudoin, Sep 03 2014
Half the total edge length for a minimum linear arrangement of a hypercube of dimension n. (See Harper's paper below for proof). - Eitan Frachtenberg, Apr 07 2017
Number of pairs in GF(2)^{n+1} whose dot product is 1. - Christopher Purcell, Dec 11 2021

Examples

			n=5: a(5) = 4^5 - 2^5 = 1024 - 32 = 992 -> '1111100000'.
		

Crossrefs

Ratio of successive terms of A028365.

Programs

Formula

From Herbert Kociemba, Jul 02 2004: (Start)
G.f.: 2*x/((-1 + 2*x)*(-1 + 4*x)).
a(n) = 6*a(n-1) - 8*a(n-2). (End)
E.g.f.: exp(4*x) - exp(2*x). - Mohammad K. Azarian, Jan 14 2009
From Reinhard Zumkeller, Feb 07 2006, Jaroslav Krizek, Aug 02 2009: (Start)
a(n) = A099393(n)-A000225(n+1) = A083420(n)-A099393(n).
In binary representation, n>0: n 1's followed by n 0's (A138147(n)).
A000120(a(n)) = n.
A023416(a(n)) = n.
A070939(a(n)) = 2*n.
2*a(n)+1 = A030101(A099393(n)). (End)
a(n) = A085812(n) - A001700(n). - John Molokach, Sep 28 2013
a(n) = 2*A006516(n) = A000079(n)*A000225(n) = A265736(A000225(n)). - Reinhard Zumkeller, Dec 15 2015
a(n) = (4^(n/2) - 4^(n/4))*(4^(n/2) + 4^(n/4)). - Bruno Berselli, Apr 09 2018
Sum_{n>0} 1/a(n) = E - 1, where E is the Erdős-Borwein constant (A065442). - Peter McNair, Dec 19 2022
a(n) = A000302(n) - A000079(n). - John Reimer Morales, Aug 04 2025

A028243 a(n) = 3^(n-1) - 2^n + 1 (essentially Stirling numbers of second kind).

Original entry on oeis.org

0, 0, 2, 12, 50, 180, 602, 1932, 6050, 18660, 57002, 173052, 523250, 1577940, 4750202, 14283372, 42915650, 128878020, 386896202, 1161212892, 3484687250, 10456158900, 31372671002, 94126401612, 282395982050, 847221500580, 2541731610602, 7625329049532
Offset: 1

Views

Author

N. J. A. Sloane, Doug McKenzie (mckfam4(AT)aol.com)

Keywords

Comments

For n >= 3, a(n) is equal to the number of functions f: {1,2,...,n-1} -> {1,2,3} such that Im(f) contains 2 fixed elements. - Aleksandar M. Janjic and Milan Janjic, Mar 08 2007
Let P(A) be the power set of an n-element set A. Then a(n+1) = the number of pairs of elements {x,y} of P(A) for which x and y are intersecting and for which either x is a proper subset of y or y is a proper subset of x. - Ross La Haye, Jan 02 2008
Let P(A) be the power set of an n-element set A and R be a relation on P(A) such that for all x, y of P(A), xRy if x is not a subset of y and y is not a subset of x and x and y are disjoint. Then a(n+1) = |R|. - Ross La Haye, Mar 19 2009
Let P(A) be the power set of an n-element set A and R be a relation on P(A) such that for all x, y of P(A), xRy if either 0) x is a proper subset of y or y is a proper subset of x, or 1) x is not a subset of y and y is not a subset of x and x and y are disjoint. Then a(n+2) = |R|. - Ross La Haye, Mar 19 2009
In the terdragon curve, a(n) is the number of triple-visited points in expansion level n. The first differences of this sequence (A056182) are the number of enclosed unit triangles since on segment expansion each unit triangle forms a new triple-visited point, and existing triple-visited points are unchanged. - Kevin Ryde, Oct 20 2020
a(n+1) is the number of ternary strings of length n that contain at least one 0 and one 1; for example, for n=3, a(4)=12 since the strings are the 3 permutations of 100, the 3 permutations of 110, and the 6 permutations of 210. - Enrique Navarrete, Aug 13 2021
From Sanjay Ramassamy, Dec 23 2021: (Start)
a(n+1) is the number of topological configurations of n points and n lines where the points lie at the vertices of a convex cyclic n-gon and the lines are the perpendicular bisectors of its sides.
a(n+1) is the number of 2n-tuples composed of n 0's and n 1's which have an interlacing signature. The signature of a 2n-tuple (v_1,...,v_{2n}) is the n-tuple (s_1,...,s_n) defined by s_i=v_i+v_{i+n}. The signature is called interlacing if after deleting the 1's, there are letters remaining and the remaining 0's and 2's are alternating. (End)
a(n+1) is the number of pairs (A,B) where B is a nonempty subset of {1,2,...,n} and A is a nonempty proper subset of B. If either "nonempty" or "proper" is omitted then see A001047. If "nonempty" and "proper" are omitted then see A000244. - Manfred Boergens, Mar 28 2023
a(n) is the number of (n-1) X (n-1) nilpotent Boolean relation matrices with rank equal to 1. a(n) = A060867(n-1) - A005061(n-1) (since every rank 1 matrix is either idempotent or nilpotent). - Geoffrey Critzer, Jul 13 2023
For odd n > 3, a(n) is also the number of minimum vertex colorings in the (n-1)-prism graph. - Eric W. Weisstein, Mar 05 2024

Crossrefs

Cf. A000392, A008277, A163626, A056182 (first differences), A000244, A001047.

Programs

  • Magma
    [3^(n-1) - 2*2^(n-1) + 1: n in [1..30]]; // G. C. Greubel, Nov 19 2017
    
  • Mathematica
    Table[2 StirlingS2[n, 3], {n, 24}] (* or *)
    Table[3^(n - 1) - 2*2^(n - 1) + 1, {n, 24}] (* or *)
    Rest@ CoefficientList[Series[-2 x^3/(-1 + x)/(-1 + 3 x)/(-1 + 2 x), {x, 0, 24}], x] (* Michael De Vlieger, Sep 24 2016 *)
  • PARI
    a(n) = 3^(n-1) - 2*2^(n-1) + 1 \\ G. C. Greubel, Nov 19 2017
  • Sage
    [stirling_number2(i,3)*2 for i in range(1,30)] # Zerinvary Lajos, Jun 26 2008
    

Formula

a(n) = 2*S(n, 3) = 2*A000392(n). - Emeric Deutsch, May 02 2004
G.f.: -2*x^3/(-1+x)/(-1+3*x)/(-1+2*x) = -1/3 - (1/3)/(-1+3*x) + 1/(-1+2*x) - 1/(-1+x). - R. J. Mathar, Nov 22 2007
E.g.f.: (exp(3*x) - 3*exp(2*x) + 3*exp(x) - 1)/3. - Wolfdieter Lang, May 03 2017
E.g.f. with offset 0: exp(x)*(exp(x)-1)^2. - Enrique Navarrete, Aug 13 2021
a(n) = Sum_{k = 1..n-2} binomial(n-1, k) * (2^(n-k-1)-1). - Ocean Wong, Jan 03 2025

A274230 Number of holes in a sheet of paper when you fold it n times and cut off the four corners.

Original entry on oeis.org

0, 0, 1, 3, 9, 21, 49, 105, 225, 465, 961, 1953, 3969, 8001, 16129, 32385, 65025, 130305, 261121, 522753, 1046529, 2094081, 4190209, 8382465, 16769025, 33542145, 67092481, 134193153, 268402689, 536821761, 1073676289, 2147385345
Offset: 0

Views

Author

Philippe Gibone, Jun 15 2016

Keywords

Comments

The folds are always made so the longer side becomes the shorter side.
We could have counted not only the holes but also all the notches: 4, 6, 9, 15, 25, 45, 81, 153, 289, ... which has the formula a(n) = (2^ceiling(n/2) + 1) * (2^floor(n/2) + 1) and appears to match the sequence A183978. - Philippe Gibone, Jul 06 2016
The same sequence (0,0,1,3,9,21,49,...) turns up when you start with an isosceles right triangular piece of paper and repeatedly fold it in half, snipping corners as you go. Is there an easy way to see why the two questions have the same answer? - James Propp, Jul 05 2016
Reply from Tom Karzes, Jul 05 2016: (Start)
This case seems a little more complicated than the rectangular case, since with the triangle you alternate between horizontal/vertical folds vs. diagonal folds, and the resulting fold pattern is more complex, but I think the basic argument is essentially the same.
Note that with the triangle, the first hole doesn't appear until after you've made 3 folds, so if you start counting at zero folds, you have three leading zeros in the sequence: 0,0,0,1,3,9,21,... (End)
Also the number of subsets of {1,2,...,n} that contain both even and odd numbers. For example, a(3)=3 and the 3 subsets are {1,2}, {2,3}, {1,2,3}; a(4)=9 and the 9 subsets are {1,2}, {1,4}, {2,3}, {3,4}, {1,2,3}, {1,2,4}, {1,3,4}, {2,3,4}, {1,2,3,4}. (See comments in A052551 for the number of subsets of {1,2,...,n} that contain only odd and even numbers.) - Enrique Navarrete, Mar 26 2018
Also the number of integer compositions of n + 1 with an odd part other than the first or last. The complementary compositions are counted by A052955(n>0) = A027383(n) + 1. - Gus Wiseman, Feb 05 2022
Also the number of unit squares in the (n+1)-st iteration in the version of the dragon curve where the rotation directions alternate, so that any clockwise rotation is followed by a counterclockwise rotation, and vice versa (see image link below). - Talmon Silver, May 09 2023

Crossrefs

See A274626, A274627 for the three- and higher-dimensional analogs.
This is the main diagonal of A274635.
Counting fold lines instead of holes gives A027383.
Bisections are A060867 (even) and A134057 (odd).

Programs

Formula

u(0) = 0; v(0) = 0; u(n+1) = v(n); v(n+1) = 2u(n) + 1; a(n) = u(n)*v(n).
a(n) = (2^ceiling(n/2) - 1)*(2^floor(n/2) - 1).
Proof from Tom Karzes, Jul 05 2016: (Start)
Let r be the number of times you fold along one axis and s be the number of times you fold along the other axis. So r is ceiling(n/2) and s is floor(n/2), where n is the total number of folds.
When unfolded, the resulting paper has been divided into a grid of (2^r) by (2^s) rectangles. The interior grid lines will have diamond-shaped holes where they intersect (assuming diagonal cuts).
There are (2^r-1) internal grid lines along one axis and (2^s-1) along the other. The total number of internal grid line intersections is therefore (2^r-1)*(2^s-1), or (2^ceiling(n/2)-1)*(2^floor(n/2)-1) as claimed. (End)
From Colin Barker, Jun 22 2016, revised by N. J. A. Sloane, Jul 05 2016: (Start)
It follows that:
a(n) = (2^(n/2)-1)^2 for n even, a(n) = 2^n+1-3*2^((n-1)/2) for n odd.
a(n) = 3*a(n-1)-6*a(n-3)+4*a(n-4) for n>3.
G.f.: x^2 / ((1-x)*(1-2*x)*(1-2*x^2)).
a(n) = (1+2^n-2^((n-3)/2)*(3-3*(-1)^n+2*sqrt(2)+2*(-1)^n*sqrt(2))). (End)
a(n) = A000225(n) - 2*A052955(n-2) for n > 1. - Yuchun Ji, Nov 19 2018
a(n) = A079667(2^(n-1)) for n >= 1. - J. M. Bergot, Jan 18 2021
a(n) = 2^(n-1) - A052955(n) = 2^(n-1) - A027383(n) - 1. - Gus Wiseman, Jan 29 2022
E.g.f.: cosh(x) + cosh(2*x) - 2*cosh(sqrt(2)*x) + sinh(x) + sinh(2*x) - 3*sinh(sqrt(2)*x)/sqrt(2). - Stefano Spezia, Apr 06 2022

A160414 Number of "ON" cells at n-th stage in simple 2-dimensional cellular automaton (same as A160410, but a(1) = 1, not 4).

Original entry on oeis.org

0, 1, 9, 21, 49, 61, 97, 133, 225, 237, 273, 309, 417, 453, 561, 669, 961, 973, 1009, 1045, 1153, 1189, 1297, 1405, 1729, 1765, 1873, 1981, 2305, 2413, 2737, 3061, 3969, 3981, 4017, 4053, 4161, 4197, 4305, 4413, 4737, 4773, 4881, 4989, 5313, 5421, 5745
Offset: 0

Views

Author

Omar E. Pol, May 20 2009

Keywords

Comments

The structure has a fractal behavior similar to the toothpick sequence A139250.
First differences: A161415, where there is an explicit formula for the n-th term.
For the illustration of a(24) = 1729 (the Hardy-Ramanujan number) see the Links section.

Examples

			From _Omar E. Pol_, Sep 24 2015: (Start)
With the positive terms written as an irregular triangle in which the row lengths are the terms of A011782 the sequence begins:
1;
9;
21,    49;
61,    97,  133,  225;
237,  273,  309,  417,  453, 561,  669,  961;
...
Right border gives A060867.
This triangle T(n,k) shares with the triangle A256530 the terms of the column k, if k is a power of 2, for example both triangles share the following terms: 1, 9, 21, 49, 61, 97, 225, 237, 273, 417, 961, etc.
.
Illustration of initial terms, for n = 1..10:
.       _ _ _ _                       _ _ _ _
.      |  _ _  |                     |  _ _  |
.      | |  _|_|_ _ _ _ _ _ _ _ _ _ _|_|_  | |
.      | |_|  _ _     _ _   _ _     _ _  |_| |
.      |_ _| |  _|_ _|_  | |  _|_ _|_  | |_ _|
.          | |_|  _ _  |_| |_|  _ _  |_| |
.          |   | |  _|_|_ _ _|_|_  | |   |
.          |  _| |_|  _ _   _ _  |_| |_  |
.          | | |_ _| |  _|_|_  | |_ _| | |
.          | |_ _| | |_|  _  |_| | |_ _| |
.          |  _ _  |  _| |_| |_  |  _ _  |
.          | |  _|_| | |_ _ _| | |_|_  | |
.          | |_|  _| |_ _| |_ _| |_  |_| |
.          |   | | |_ _ _ _ _ _ _| | |   |
.          |  _| |_ _| |_   _| |_ _| |_  |
.       _ _| | |_ _ _ _| | | |_ _ _ _| | |_ _
.      |  _| |_ _|   |_ _| |_ _|   |_ _| |_  |
.      | | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | |
.      | |_ _| |                     | |_ _| |
.      |_ _ _ _|                     |_ _ _ _|
.
After 10 generations there are 273 ON cells, so a(10) = 273.
(End)
		

Crossrefs

Programs

  • Maple
    read("transforms") ; isA000079 := proc(n) if type(n,'even') then nops(numtheory[factorset](n)) = 1 ; else false ; fi ; end proc:
    A048883 := proc(n) 3^wt(n) ; end proc:
    A161415 := proc(n) if n = 1 then 1; elif isA000079(n) then 4*A048883(n-1)-2*n ; else 4*A048883(n-1) ; end if; end proc:
    A160414 := proc(n) add( A161415(k),k=1..n) ; end proc: seq(A160414(n),n=0..90) ; # R. J. Mathar, Oct 16 2010
  • Mathematica
    A160414list[nmax_]:=Accumulate[Table[If[n<2,n,4*3^DigitCount[n-1,2,1]-If[IntegerQ[Log2[n]],2n,0]],{n,0,nmax}]];A160414list[100] (* Paolo Xausa, Sep 01 2023, after R. J. Mathar *)
  • PARI
    my(s=-1, t(n)=3^norml2(binary(n-1))-if(n==(1<Altug Alkan, Sep 25 2015

Formula

a(n) = 1 + 4*A219954(n), n >= 1. - M. F. Hasler, Dec 02 2012
a(2^k) = (2^(k+1) - 1)^2. - Omar E. Pol, Jan 05 2013

Extensions

Edited by N. J. A. Sloane, Jun 15 2009 and Jul 13 2009
More terms from R. J. Mathar, Oct 16 2010

A090025 Number of distinct lines through the origin in 3-dimensional cube of side length n.

Original entry on oeis.org

0, 7, 19, 49, 91, 175, 253, 415, 571, 805, 1033, 1423, 1723, 2263, 2713, 3313, 3913, 4825, 5491, 6625, 7513, 8701, 9811, 11461, 12637, 14497, 16045, 18043, 19807, 22411, 24163, 27133, 29485, 32425, 35065, 38593, 41221, 45433, 48727, 52831
Offset: 0

Views

Author

Joshua Zucker, Nov 25 2003

Keywords

Comments

Equivalently, lattice points where the GCD of all coordinates = 1.

Examples

			a(2) = 19 because the 19 points with at least one coordinate=2 all make distinct lines and the remaining 7 points and the origin are on those lines.
		

Crossrefs

Cf. A000225, A001047, A060867, A090020, A090021, A090022, A090023, A090024 are for n dimensions with side length 1, 2, 3, 4, 5, 6, 7, 8, respectively. A049691, A090025, A090026, A090027, A090028, A090029 are this sequence for 2, 3, 4, 5, 6, 7 dimensions. A090030 is the table for n dimensions, side length k.
Cf. A071778.

Programs

  • Mathematica
    aux[n_, k_] := If[k == 0, 0, (k + 1)^n - k^n - Sum[aux[n, Divisors[k][[i]]], {i, 1, Length[Divisors[k]] - 1}]];lines[n_, k_] := (k + 1)^n - Sum[Floor[k/i - 1]*aux[n, i], {i, 1, Floor[k/2]}] - 1;Table[lines[3, k], {k, 0, 40}]
    a[n_] := Sum[MoebiusMu[k]*((Floor[n/k]+1)^3-1), {k, 1, n}]; Table[a[n], {n, 0, 39}] (* Jean-François Alcover, Nov 28 2013, after Vladeta Jovovic *)
  • PARI
    a(n)=(n+1)^3-sum(j=2,n+1,a(floor(n/j)))
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A090025(n):
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A090025(k1)
            j, k1 = j2, n//j2
        return (n+1)**3-c+7*(j-n-1) # Chai Wah Wu, Mar 30 2021

Formula

a(n) = A090030(3, n).
a(n) = Sum_{k=1..n} moebius(k)*((floor(n/k)+1)^3-1). - Vladeta Jovovic, Dec 03 2004
a(n) = (n+1)^3 - Sum_{j=2..n+1} a(floor(n/j)). - Seth A. Troisi, Aug 29 2013
a(n) = 6*A015631(n) + 1 for n>=1. - Hugo Pfoertner, Mar 30 2021

A090020 Number of distinct lines through the origin in the n-dimensional lattice of side length 4.

Original entry on oeis.org

0, 1, 13, 91, 529, 2851, 14833, 75811, 383809, 1932931, 9705553, 48648931, 243605089, 1219100611, 6098716273, 30503196451, 152544778369, 762810181891, 3814309582993, 19072323542371, 95363943807649, 476826695752771
Offset: 0

Views

Author

Joshua Zucker, Nov 19 2003

Keywords

Comments

Equivalently, lattice points where the gcd of all the coordinates is 1.

Examples

			a(2) = 13 because in 2D the lines have slope 0, 1/4, 1/3, 1/2, 2/3, 3/4, 1, 4/3, 3/2, 2, 3, 4 and infinity.
		

Crossrefs

a(n) = T(n,4) from A090030. Cf. A000225, A001047, A060867, A090021, A090022, A090023, A090024 are for dimension n with side lengths 1, 2, 3, 5, 6, 7, 8 respectively. A049691, A090025, A090026, A090027, A090028, A090029 are for side length k in 2, 3, 4, 5, 6, 7 dimensions.

Programs

  • Mathematica
    Table[5^n - 3^n - 2^n + 1, {n, 0, 25}]
    LinearRecurrence[{11,-41,61,-30},{0,1,13,91},30] (* Indranil Ghosh, Feb 21 2017 *)
  • Python
    def A090020(n): return 5**n-3**n-2**n+1 # Indranil Ghosh, Feb 21 2017

Formula

a(n) = 5^n - 3^n - 2^n + 1.
G.f.: -x*(11*x^2-2*x-1)/((x-1)*(2*x-1)*(3*x-1)*(5*x-1)). [Colin Barker, Sep 04 2012]

A090022 Number of distinct lines through the origin in the n-dimensional lattice of side length 6.

Original entry on oeis.org

0, 1, 25, 253, 2065, 15541, 112825, 804973, 5692705, 40071781, 281367625, 1972955293, 13823978545, 96820307221, 677949854425, 4746473419213, 33228592555585, 232613204977861, 1628344491013225, 11398619145204733
Offset: 0

Views

Author

Joshua Zucker, Nov 20 2003

Keywords

Comments

Equivalently, lattice points where the gcd of all the coordinates is 1.

Examples

			a(2) = 25 because in 2D the lines have slope 0, 1/6, 5/6, 1/5, 2/5, 3/5, 4/5, 1/4, 3/4, 1/3, 2/3, 1/2, 1 and their reciprocals.
		

Crossrefs

a(n) = T(n, 5) from A090030. Cf. A000225, A001047, A060867, A090020, A090021, A090023, A090024 are for dimension n with side lengths 1, 2, 3, 4, 5, 7, 8 respectively. A049691, A090025, A090026, A090027, A090028, A090029 are for side length k in 2, 3, 4, 5, 6, 7 dimensions.

Programs

  • Magma
    [7^n-4^n-3^n+1: n in [0..20]]; // Wesley Ivan Hurt, Mar 06 2022
  • Mathematica
    Table[7^n - 4^n - 3^n + 1, {n, 0, 25}]
  • Python
    [7**n-4**n-3**n+1 for n in range(20)] # Gennady Eremin, Mar 06 2022
    

Formula

a(n) = 7^n - 4^n - 3^n + 1.
O.g.f.: 1/(-1+3*x) + 1/(-1+4*x) - 1/(-1+x) - 1/(-1+7*x). - R. J. Mathar, Feb 26 2008
Showing 1-10 of 48 results. Next