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 18 results. Next

A179070 a(1)=a(2)=a(3)=1, a(4)=3; thereafter a(n) = a(n-1) + a(n-3).

Original entry on oeis.org

1, 1, 1, 3, 4, 5, 8, 12, 17, 25, 37, 54, 79, 116, 170, 249, 365, 535, 784, 1149, 1684, 2468, 3617, 5301, 7769, 11386, 16687, 24456, 35842, 52529, 76985, 112827, 165356, 242341, 355168, 520524, 762865, 1118033, 1638557, 2401422, 3519455, 5158012, 7559434
Offset: 1

Views

Author

Mark Dols, Jun 27 2010

Keywords

Comments

Also (essentially), coordination sequence for (2,4,infinity) tiling of hyperbolic plane. - N. J. A. Sloane, Dec 29 2015
Column sums of shifted (1,2) Pascal array:
1 1 1 1 1 1 1 1 1
......2 3 4 5 6 7
............2 5 9
.................
----------------- +
1 1 1 3 4 5 8 ...
a(n+1) is the number of multus bitstrings of length n with no runs of 2 0's. - Steven Finch, Mar 25 2020
From Areebah Mahdia and Greg Dresden, Jun 13 2020: (Start)
For n >= 5, a(n) gives the number of ways to tile the following board of length n-3 with squares and trominos:
.
|||
|||_ _ _
|||_|||_|_| ... . (End)

Crossrefs

Programs

Formula

a(n) = A000930(n-1) + A000930(n-4).
G.f.: x - x^2*(1+2*x^2) / ( -1+x+x^3 ). - R. J. Mathar, Oct 30 2011
a(n) = A000930(n-2)+2*A000930(n-4) for n>3. - R. J. Mathar, May 19 2024

Extensions

Simpler definition from N. J. A. Sloane, Aug 29 2013

A171861 Expansion of x*(1+x+x^2) / ( (x-1)*(x^3+x^2-1) ).

Original entry on oeis.org

1, 2, 4, 6, 9, 13, 18, 25, 34, 46, 62, 83, 111, 148, 197, 262, 348, 462, 613, 813, 1078, 1429, 1894, 2510, 3326, 4407, 5839, 7736, 10249, 13578, 17988, 23830, 31569, 41821, 55402, 73393, 97226, 128798, 170622, 226027, 299423, 396652, 525453, 696078, 922108
Offset: 1

Views

Author

Ed Pegg Jr, Oct 16 2010

Keywords

Comments

Number of wins in Penney's game if the two players start HHT and TTT and HHT beats TTT.
HHT beats TTT 70% of the time. - Geoffrey Critzer, Mar 01 2014

Examples

			a(n) enumerates length n+2 sequences on {H,T} that end in HHT but do not contain the contiguous subsequence TTT.
a(3)=4 because we have: TTHHT, THHHT, HTHHT, HHHHT.
a(4)=6 because we have: TTHHHT, THTHHT, THHHHT, HTTHHT, HTHHHT, HHHHHT. - _Geoffrey Critzer_, Mar 01 2014
		

Crossrefs

Related sequences are A000045 (HHH beats HHT, HTT beats TTH), A006498 (HHH beats HTH), A023434 (HHH beats HTT), A000930 (HHH beats THT, HTH beats HHT), A000931 (HHH beats TTH), A077868 (HHT beats HTH), A002620 (HHT beats HTT), A000012 (HHT beats THH), A004277 (HHT beats THT), A070550 (HTH beats HHH), A000027 (HTH beats HTT), A097333 (HTH beats THH), A040000 (HTH beats TTH), A068921 (HTH beats TTT), A054405 (HTT beats HHH), A008619 (HTT beats HHT), A038718 (HTT beats THT), A128588 (HTT beats TTT).
Cf. A164315 (essentially the same sequence).

Programs

  • Maple
    A171861 := proc(n) option remember; if n <=4 then op(n,[1,2,4,6]); else procname(n-1)+procname(n-2)-procname(n-4) ; end if; end proc:
  • Mathematica
    nn=44;CoefficientList[Series[x(1+x+x^2)/(1-x-x^2+x^4),{x,0,nn}],x] (* Geoffrey Critzer, Mar 01 2014 *)
  • PARI
    a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; -1,0,1,1]^(n-1)*[1;2;4;6])[1,1] \\ Charles R Greathouse IV, Oct 03 2016

Formula

a(n) = a(n-1) +a(n-2) -a(n-4) = A000931(n+10)-3 = A134816(n+6)-3 = A078027(n+12)-3.
a(n) = A164315(n-1). - Alois P. Heinz, Oct 12 2017

A038718 Number of permutations P of {1,2,...,n} such that P(1)=1 and |P^-1(i+1)-P^-1(i)| equals 1 or 2 for i=1,2,...,n-1.

Original entry on oeis.org

1, 1, 2, 4, 6, 9, 14, 21, 31, 46, 68, 100, 147, 216, 317, 465, 682, 1000, 1466, 2149, 3150, 4617, 6767, 9918, 14536, 21304, 31223, 45760, 67065, 98289, 144050, 211116, 309406, 453457, 664574, 973981, 1427439, 2092014, 3065996, 4493436, 6585451
Offset: 1

Views

Author

John W. Layman, May 02 2000

Keywords

Comments

This sequence is the number of digits of each term of A061583. - Dmitry Kamenetsky, Jan 17 2009

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{2,-1,1,-1},{1,1,2,4},50] (* or *) CoefficientList[ Series[(x^2-x+1)/(x^4-x^3+x^2-2x+1),{x,0,50}],x] (* Harvey P. Dale, Apr 24 2011 *)
  • PARI
    a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; -1,1,-1,2]^(n-1)*[1;1;2;4])[1,1] \\ Charles R Greathouse IV, Apr 07 2016

Formula

From Joseph Myers, Feb 03 2004: (Start)
G.f.: (1 -x +x^2)/(1-2*x+x^2-x^3+x^4).
a(n) = a(n-1) + a(n-3) + 1. (End)
a(n) = Sum_{i=1..n} A058278(i) = A097333(n) - 1. - R. J. Mathar, Oct 16 2010

Extensions

More terms from Joseph Myers, Feb 03 2004

A003410 Expansion of (1+x)(1+x^2)/(1-x-x^3).

Original entry on oeis.org

1, 2, 3, 5, 7, 10, 15, 22, 32, 47, 69, 101, 148, 217, 318, 466, 683, 1001, 1467, 2150, 3151, 4618, 6768, 9919, 14537, 21305, 31224, 45761, 67066, 98290, 144051, 211117, 309407, 453458, 664575, 973982, 1427440, 2092015, 3065997, 4493437, 6585452, 9651449
Offset: 0

Views

Author

Keywords

Comments

From Emeric Deutsch, Feb 15 2010: (Start)
a(n) is the number of binary words of length n that have no pair of adjacent 1's and have no 0000 subwords. Example: a(4)=7 because we have 0101, 1010, 0010, 1001, 0100, 0001, and 1000.
a(n) = A171855(n,0). (End)
a(n) is the number of solus bitstrings of length n with no runs of 4 zeros. - Steven Finch, Mar 25 2020

References

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

Crossrefs

Essentially the same as A058278 and A097333, partial sums and first differences of A058278, first and second differences of itself and A038718. Equals A038718(n+1) + 1, n>0.
Cf. A171855. - Emeric Deutsch, Feb 15 2010

Programs

  • Maple
    G:=series((1+x)*(1+x^2)/(1-x-x^3),x=0,42): 1,seq(coeff(G,x^n),n=1..38);
    A003410:=-(1+z)*(1+z**2)/(-1+z+z**3); # Simon Plouffe in his 1992 dissertation
  • Mathematica
    Join[{1}, LinearRecurrence[{1, 0, 1}, {2, 3, 5}, 80]] (* Vladimir Joseph Stephan Orlovsky, Feb 11 2012 *)
    CoefficientList[Series[((1+x)(1+x^2))/(1-x-x^3),{x,0,50}],x] (* Harvey P. Dale, Jul 07 2025 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; 1,0,1]^n*[1;2;3])[1,1] \\ Charles R Greathouse IV, Mar 25 2020

Formula

a(n) = a(n-1) + a(n-3) for n>3, see also A000930. - Reinhard Zumkeller, Oct 26 2005
For n>1, a(n) = 2*A000930(n) + A000930(n-2). - Gerald McGarvey, Sep 10 2008
a(n) = A058278(n+4) = A097333(n+1) for n >= 1. - Jianing Song, Aug 11 2023

Extensions

More terms from Emeric Deutsch, Dec 11 2004

A013979 Expansion of 1/(1 - x^2 - x^3 - x^4) = 1/((1 + x)*(1 - x - x^3)).

Original entry on oeis.org

1, 0, 1, 1, 2, 2, 4, 5, 8, 11, 17, 24, 36, 52, 77, 112, 165, 241, 354, 518, 760, 1113, 1632, 2391, 3505, 5136, 7528, 11032, 16169, 23696, 34729, 50897, 74594, 109322, 160220, 234813, 344136, 504355, 739169, 1083304, 1587660, 2326828, 3410133, 4997792, 7324621
Offset: 0

Views

Author

Keywords

Comments

For n>0, number of compositions (ordered partitions) of n into 2's, 3's and 4's. - Len Smiley, May 08 2001
Diagonal sums of trinomial triangle A071675 (Riordan array (1, x*(1+x+x^2))). - Paul Barry, Feb 15 2005
For n>1, a(n) is number of compositions of n-2 into parts 1 and 2 with no 3 consecutive 1's. For example: a(7) = 5 because we have: 2+2+1, 2+1+2, 1+2+2, 1+2+1+1, 1+1+2+1. - Geoffrey Critzer, Mar 15 2014
In the same way [per 2nd comment for A006498, by Sreyas Srinivasan] that the sum of any two alternating terms (terms separated by one term) of A006498 produces a term from A000045 (the Fibonacci sequence), so it could therefore be thought of as a "metaFibonacci," the sum of any two (nonalternating) terms of this sequence produces a term from A000930 (Narayana’s cows), so this sequence could analogously be called "meta-Narayana’s cows" (e.g. 4+5=9, 5+8=13, 8+11=19, 11+17=28). - Michael Cohen and Yasuyuki Kachi, Jun 13 2024

Examples

			G.f. = 1 + x^2 + x^3 + 2*x^4 + 2*x^5 + 4*x^6 + 5*x^7 + 8*x^8 + 11*x^9 + ...
		

Crossrefs

Cf. A060945 (Ordered partitions into 1's, 2's and 4's).
First differences of A023435.

Programs

  • Haskell
    a013979 n = a013979_list !! n
    a013979_list = 1 : 0 : 1 : 1 : zipWith (+) a013979_list
       (zipWith (+) (tail a013979_list) (drop 2 a013979_list))
    -- Reinhard Zumkeller, Mar 23 2012
    
  • Magma
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!( 1/((1+x)*(1-x-x^3)) )); // G. C. Greubel, Jul 17 2023
    
  • Mathematica
    a[n_]:= If[n<0, SeriesCoefficient[x^4/(1 +x +x^2 -x^4), {x, 0, -n}], SeriesCoefficient[1/(1 -x^2 -x^3 -x^4), {x,0,n}]]; (* Michael Somos, Jun 20 2015 *)
    LinearRecurrence[{0,1,1,1}, {1,0,1,1}, 50] (* G. C. Greubel, Jul 17 2023 *)
  • SageMath
    @CachedFunction
    def b(n): return 1 if (n<3) else b(n-1) + b(n-3) # b = A000930
    def A013979(n): return ((-1)^n +2*b(n) -b(n-1) +b(n-2) -int(n==1))/3
    [A013979(n) for n in (0..50)] # G. C. Greubel, Jul 17 2023

Formula

a(n) = Sum_{k=0..floor(n/2)} Sum_{i=0..floor(n/2)} C(k, 2i+3k-n)*C(2i+3k-n, i). - Paul Barry, Feb 15 2005
a(n) = a(n-4) + a(n-3) + a(n-2). - Jon E. Schoenfield, Aug 07 2006
a(n) + a(n+1) = A000930(n+1). - R. J. Mathar, Mar 14 2011
a(n) = (1/3)*(A000930(n) + A097333(n-2) + (-1)^n), n>1. - Ralf Stephan, Aug 15 2013
a(n) = (-1)^n * A077889(-4-n) = A107458(n+4) for all n in Z. - Michael Somos, Jun 20 2015
a(n) = Sum_{i=0..floor(n/2)} A078012(n-2*i). - Paul Curtz, Aug 18 2021
a(n) = (1/3)*((-1)^n + 2*b(n) - b(n-1) + b(n-2) - [n=1]), where b(n) = A000930(n). - G. C. Greubel, Jul 17 2023

A058278 Expansion of (1 - x^2)/(1 - x - x^3).

Original entry on oeis.org

1, 1, 0, 1, 2, 2, 3, 5, 7, 10, 15, 22, 32, 47, 69, 101, 148, 217, 318, 466, 683, 1001, 1467, 2150, 3151, 4618, 6768, 9919, 14537, 21305, 31224, 45761, 67066, 98290, 144051, 211117, 309407, 453458, 664575, 973982, 1427440, 2092015, 3065997, 4493437
Offset: 0

Views

Author

Robert G. Wilson v, Dec 06 2000

Keywords

Crossrefs

Essentially the same as A003410 and A097333.
Cf. A000930.

Programs

Formula

G.f.: (1 - x^2)/(1 - x - x^3).
a(n+3) = Sum_{k=0..n} binomial(n-k, floor(k/2)). - Paul Barry, Jul 06 2004
a(n) = a(n-3) + a(n-1). - Graeme McRae, Apr 26 2010
From Wolfdieter Lang, Apr 21 2015 : (Start)
a(n) = A097333(n-3), n >= 3.
a(n) = A000930(n) - A000930(n-2), n >= 2. (End)
a(n) = A003410(n-4) for n >= 5. - Jianing Song, Aug 11 2023

Extensions

Edited: Offset corrected to 0. The formula by P. Barry corrected. Old formulas adapted to new offset. - Wolfdieter Lang, Apr 21 2015

A213274 Irregular array T(n,k) of numbers/2 of non-extendable (complete) non-self-adjacent simple paths of each length within a square lattice bounded by rectangles with nodal dimensions n and 2, n >= 2.

Original entry on oeis.org

4, 4, 4, 2, 4, 4, 6, 6, 4, 4, 6, 10, 10, 2, 4, 4, 6, 10, 14, 16, 8, 4, 4, 6, 10, 14, 20, 26, 18, 2, 4, 4, 6, 10, 14, 20, 30, 40, 34, 10, 4, 4, 6, 10, 14, 20, 30, 44, 60, 60, 28, 2, 4, 4, 6, 10, 14, 20, 30, 44, 64, 90, 100, 62, 12, 4, 4, 6, 10, 14, 20, 30, 44, 64, 94, 134, 160, 122, 40, 2
Offset: 2

Views

Author

Keywords

Comments

The irregular array of numbers is:
....k..3...4...5...6...7...8...9..10..11..12..13..14..15..16..17
..n
..2....4
..3....4...4...2
..4....4...4...6...6
..5....4...4...6..10..10...2
..6....4...4...6..10..14..16...8
..7....4...4...6..10..14..20..26..18...2
..8....4...4...6..10..14..20..30..40..34..10
..9....4...4...6..10..14..20..30..44..60..60..28...2
.10....4...4...6..10..14..20..30..44..64..90.100..62..12
.11....4...4...6..10..14..20..30..44..64..94.134.160.122..40...2
where k is the path length in nodes.
In an attempt to define the irregularity of the array, it appears that the maximum value of k is (3n + n mod 2)/2 for n >= 2.
Reading this array by rows gives the sequence.
One half of the numbers of paths constitute the sequence to remove the effect of the bilateral symmetry of a rectangle.

Examples

			T(2,3) = One half of the number of complete non-self-adjacent simple paths of length 3 nodes within a square lattice bounded by a 2 X 2 node rectangle.
		

Crossrefs

Formula

The asymptotic sequence for the number of paths of each nodal length k for n >> 0 appears to be 2*A097333(1:), that is, 2*(Sum(j=0..k-2, C(k-2-j, floor(j/2)))), for k >= 3.

A226247 Let S be the set of numbers defined by these rules: 0 is in S; if x is in S, then x+1 is in S, and if nonzero x is in S, then -1/x are in S. (See Comments.)

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 3, 2, 1, 4, 3, 2, 1, 1, 5, 4, 3, 2, 2, 3, 1, 6, 5, 4, 3, 3, 5, 2, 5, 3, 1, 7, 6, 5, 4, 4, 7, 3, 8, 5, 2, 7, 5, 3, 1, 1, 8, 7, 6, 5, 5, 9, 4, 11, 7, 3, 11, 8, 5, 2, 2, 9, 7, 5, 3, 3, 4, 1, 9, 8, 7, 6, 6, 11, 5, 14, 9, 4, 15, 11, 7, 3, 3
Offset: 1

Views

Author

Clark Kimberling, Jun 01 2013

Keywords

Comments

Let S be the set of numbers defined by these rules: 0 is in S; if x is in S, then x+1 is in S, and if nonzero x is in S, then -1/x are in S. Then S is the set of all rational numbers, produced in generations as follows:
g(1) = (0), g(2) = (1), g(3) = (2, -1), g(4) = (3, -1/2), g(5) = (4, -1/3, 1/2), ... For n > 2, once g(n-1) = (c(1), ..., c(z)) is defined, g(n) is formed from the vector (c(1)+1, -1/c(1), c(2)+1, -1/c(2), ..., c(z)+1, -1/c(z)) by deleting previously generated elements.
Let S'' denote the sequence formed by concatenating the generations.
A226247: Denominators of terms of S''
A226248: Numerators of terms of S''
A226249: Positions of nonnegative numbers in S''
A226250: Positions of positive numbers in S''
A closely related sequence S' (for which the rules of generation are shorter but the resulting sequence is slightly less natural) is discussed at A226130. For both S' and S'', the number of numbers in g(n) is given by A097333.

Examples

			The denominators and numerators are read from S'':
  0/1, 1/1, 2/1, -1/1, 3, -1/2, 4/1, -1/3, 1/2, 5, -1/4, 2/3, 3/2, -2, ...
Table begins:
  n |
  --+-----------------------------------------------
  1 | 1;
  2 | 1;
  3 | 1, 1;
  4 | 1, 2;
  5 | 1, 3, 2;
  6 | 1, 4, 3, 2, 1;
  7 | 1, 5, 4, 3, 2, 2, 3;
  8 | 1, 6, 5, 4, 3, 3, 5, 2, 5, 3;
  9 | 1, 7, 6, 5, 4, 4, 7, 3, 8, 5, 2, 7, 5, 3, 1;
		

Crossrefs

Cf. A226080 (rabbit ordering of positive rationals), A226130.

Programs

  • Mathematica
    z = 12; g[1] := {0}; g[2] := {1}; g[n_] :=  g[n] = DeleteCases[Flatten[Transpose[{# + 1, -1/#}]] &[g[n - 1]], Apply[Alternatives, Flatten[Map[g, Range[n - 1]]]]]; f = Flatten[Map[g, Range[z]]]; Take[Denominator[f], 100]  (*A226247*)
    t = Take[Numerator[f], 100]  (*A226248*)
    s[n_] := If[t[[n]] > 0, 1, 0]; u = Table[s[n], {n, 1, Length[t]}]
    Flatten[Position[u, 1]] (*A226249*)
    p = Flatten[Position[u, 0]] (*A226250*) (* Peter J. C. Moses, May 30 2013 *)
  • Python
    from fractions import Fraction
    from itertools import count, islice
    def agen():
        rats = [Fraction(0, 1)]
        seen = {Fraction(0, 1)}
        for n in count(1):
            yield from [r.denominator for r in rats]
            newrats = []
            for r in rats:
                f = 1+r
                if f not in seen:
                    newrats.append(1+r)
                    seen.add(f)
                if r != 0:
                    g = -1/r
                    if g not in seen:
                        newrats.append(-1/r)
                        seen.add(g)
            rats = newrats
    print(list(islice(agen(), 84))) # Michael S. Branicky, Jan 17 2022

A213431 Irregular array T(n,k) of the numbers of distinct shapes under rotation of the non-extendable (complete) non-self-adjacent simple paths of each length within a square lattice bounded by rectangles with nodal dimensions n and 2, n >= 2.

Original entry on oeis.org

2, 2, 4, 2, 2, 4, 6, 6, 2, 4, 6, 10, 10, 2, 2, 4, 6, 10, 14, 16, 8, 2, 4, 6, 10, 14, 20, 26, 18, 2, 2, 4, 6, 10, 14, 20, 30, 40, 34, 10, 2, 4, 6, 10, 14, 20, 30, 44, 60, 60, 28, 2, 2, 4, 6, 10, 14, 20, 30, 44, 64, 90, 100, 62, 12
Offset: 2

Views

Author

Keywords

Comments

The irregular array of numbers is:
....k..3...4...5...6...7...8...9..10..11..12..13..14..15
..n
..2....2
..3....2...4...2
..4....2...4...6...6
..5....2...4...6..10..10...2
..6....2...4...6..10..14..16...8
..7....2...4...6..10..14..20..26..18...2
..8....2...4...6..10..14..20..30..40..34..10
..9....2...4...6..10..14..20..30..44..60..60..28...2
.10....2...4...6..10..14..20..30..44..64..90.100..62..12
where k is the path length in nodes. In an attempt to define the irregularity of the array, it appears that the maximum value of k is n + floor((n+1)/2) for n >= 2. Reading this array by rows gives the sequence.

Examples

			T(2,3) = The number of distinct shapes under rotation of the complete non-self-adjacent simple paths of length 3 nodes within a square lattice bounded by a 2 X 2 node rectangle.
		

Crossrefs

Formula

The asymptotic sequence for the number of distinct shapes under rotation of the complete non-self-adjacent simple paths of each nodal length k for n >> 0 appears to be 2*A097333(2:), that is, 2*(Sum(j=0..k-2, C(k-2-j, floor(j/2)))), for k >= 4.

A097334 a(n) = Sum_{k=0..n} C(n-k, floor(k/2))*2^k.

Original entry on oeis.org

1, 3, 3, 7, 19, 31, 59, 135, 259, 495, 1035, 2071, 4051, 8191, 16475, 32679, 65443, 131343, 262059, 523831, 1049203, 2097439, 4192763, 8389575, 16779331, 33550383, 67108683, 134226007, 268427539, 536862271, 1073766299, 2147476455
Offset: 0

Views

Author

Paul Barry, Aug 05 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[Binomial[n-k,Floor[k/2]]2^k,{k,0,n}],{n,0,40}] (* or *) LinearRecurrence[{1,0,4},{1,3,3},40] (* Harvey P. Dale, May 17 2021 *)

Formula

G.f. : (1+2x)/((1-2*x)*(1+x+2*x^2)); a(n)=a(n-1)+4a(n-3).
Showing 1-10 of 18 results. Next