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.

User: Stephen G Penrice

Stephen G Penrice's wiki page.

Stephen G Penrice has authored 23 sequences. Here are the ten most recent ones:

A061021 a(n) = a(n-1)*a(n-2) - a(n-3) with a(0) = a(1) = a(2) = 3.

Original entry on oeis.org

3, 3, 3, 6, 15, 87, 1299, 112998, 146784315, 16586334025071, 2434613678231239448367, 40381315689150066251526220641224742, 98312903521778500654864668915856114278134197773017871243
Offset: 0

Author

Stephen G Penrice, May 23 2001

Keywords

Comments

Any three consecutive terms are a solution to the Diophantine equation x^2 + y^2 + z^2 = xyz.

Programs

  • Haskell
    a061021 n = a061021_list !! n
    a061021_list = 3 : 3 : 3 : zipWith (-)
    (tail $ zipWith (*) (tail a061021_list) a061021_list) a061021_list
    -- Reinhard Zumkeller, Mar 25 2015
  • Mathematica
    RecurrenceTable[{a[n] == a[n - 1] a[n - 2] - a[n - 3], a[0] == a[1] == a[2] == 3}, a, {n, 0, 12}] (* Michael De Vlieger, Aug 21 2016 *)
  • PARI
    for (n=0, 17, if (n>2, a=a1*a2 - a3; a3=a2; a2=a1; a1=a, if (n==0, a=a3=3, if (n==1, a=a2=3, a=a1=3))); write("b061021.txt", n, " ", a)) \\ Harry J. Smith, Jul 16 2009
    

Formula

From Jon E. Schoenfield, May 12 2019: (Start)
It appears that, for n >= 1,
a(n) = ceiling(e^(c0*phi^n - c1/(-phi)^n))
where
phi = (1 + sqrt(5))/2,
c0 = 0.4004033011137849744572073756789830081726425559860...
c1 = 0.2798639753144007577581523025628820390768226527315...
(End)

Extensions

More terms from Erich Friedman, Jun 03 2001
Name clarified by Petros Hadjicostas, May 11 2019

A061292 a(n) = a(n-1)*a(n-2)*a(n-3) - a(n-4) for n>3 with a(0) = a(1) = a(2) = a(3) = 2.

Original entry on oeis.org

2, 2, 2, 2, 6, 22, 262, 34582, 199330642, 1806032092550706, 12449434806576800059248920402, 4481765860945171681908664776799089162954814190172722
Offset: 0

Author

Stephen G Penrice, Jun 04 2001

Keywords

Comments

Any four consecutive terms are a solution to the Diophantine equation w^2 + x^2 + y^2 + z^2 = wxyz.
a(n) = 2 * A072878(n+1).

Crossrefs

Programs

  • Haskell
    a061292 n = a061292_list !! n
    a061292_list = 2 : 2 : 2 : 2 : zipWith (-)
       (zipWith3 (((*) .) . (*)) (drop 2 xs) (tail xs) xs) a061292_list
       where xs = tail a061292_list
    -- Reinhard Zumkeller, Mar 25 2015
  • Magma
    I:=[2,2,2,2]; [n le 4 select I[n] else Self(n-1)*Self(n-2)*Self(n-3)-Self(n-4): n in [1..12]]; // Vincenzo Librandi, Sep 17 2011
    
  • Mathematica
    a[1] := 2; a[2] := 2; a[3] := 2; a[4] := 2; a[n_] := a[n - 1]*a[n - 2]*a[n - 3] - a[n - 4]; Table[a[n], {n, 1, 15}] (* Stefan Steinerberger, Mar 31 2006 *)
    RecurrenceTable[{a[0]==a[1]==a[2]==a[3]==2,a[n]==a[n-1]a[n-2]a[n-3]- a[n-4]},a[n],{n,12}] (* Harvey P. Dale, Sep 15 2011 *)

Extensions

More terms from Larry Reeves (larryr(AT)acm.org) and Jason Earls, Jun 05 2001

A055006 a(n) is the least multiple of n such that a(n) = 1 mod k for all integers k with 1 < k < n and k relatively prime to n.

Original entry on oeis.org

1, 2, 3, 4, 25, 6, 301, 736, 2241, 190, 25201, 4236, 83161, 19306, 64065, 135136, 7207201, 85086, 49008961, 49468420, 36951201, 27776386, 698377681, 855189336, 25700298625, 2445441076, 74364290001, 13624600276, 2248776129601, 6254036790, 39594522567601
Offset: 1

Author

Stephen G Penrice, May 30 2000

Keywords

Programs

  • Mathematica
    Table[Block[{m = 1, t = Select[Range[2, n - 1], CoprimeQ[#, n] &]}, While[! AllTrue[t, Mod[m n, #] == 1 &], m++]; m n], {n, 20}] (* Michael De Vlieger, Mar 08 2022 *)
  • PARI
    isok(m, n) = for (k=2, n-1, if ((gcd(k, n)==1) && ((m % k) !=1), return(0))); return(1);
    a(n) = my(m=n); while (!isok(m,n), m+=n); m; \\ Michel Marcus, Mar 08 2022

Extensions

More terms from Sean A. Irvine, Mar 07 2022

A050400 Number of independent sets of vertices in P_3 X C_n (n > 2).

Original entry on oeis.org

5, 1, 17, 43, 181, 621, 2309, 8303, 30277, 109753, 398857, 1447931, 5258725, 19095285, 69344061, 251811903, 914429445, 3320635025, 12058502657, 43789003563, 159014593621, 577442573597, 2096914206261, 7614694850543, 27651860345029, 100414447219721, 364643142303353
Offset: 0

Author

Stephen G Penrice, Dec 21 1999

Keywords

Crossrefs

Column 3 of A286513.

Programs

  • GAP
    a:=[5,1,17,43,181];; for n in [6..30] do a[n]:=a[n-1]+8*a[n-2] +6*a[n-3] -a[n-4]-a[n-5]; od; a; # G. C. Greubel, Oct 30 2019
  • Magma
    I:=[5,1,17,43,181]; [n le 5 select I[n] else Self(n-1) + 8*Self(n-2) + 6*Self(n-3) - Self(n-4) - Self(n-5): n in [1..30]]; // Vincenzo Librandi, May 11 2017
    
  • Maple
    seq(coeff(series((5-4*x-24*x^2-12*x^3+x^4)/((1+x)*(1-2*x-6*x^2+x^4)), x, n+1), x, n), n = 0..30); # G. C. Greubel, Oct 30 2019
  • Mathematica
    CoefficientList[Series[(5-4*x-24*x^2-12*x^3+x^4)/((1+x)*(1-2*x-6*x^2+ x^4)), {x, 0, 30}], x] (* Vincenzo Librandi, May 11 2017 *)
  • PARI
    my(x='x+O('x^30)); Vec((5-4*x-24*x^2-12*x^3+x^4)/((1+x)*(1-2*x-6*x^2+x^4))) \\ G. C. Greubel, Oct 30 2019
    
  • Sage
    def A077952_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P((5-4*x-24*x^2-12*x^3+x^4)/((1+x)*(1-2*x-6*x^2+x^4))).list()
    A077952_list(30) # G. C. Greubel, Oct 30 2019
    

Formula

a(n) = a(n-1) + 8*a(n-2) + 6*a(n-3) - a(n-4) - a(n-5).
G.f.: (5-4*x-24*x^2-12*x^3+x^4)/((1+x)*(1-2*x-6*x^2+x^4)). - Maksym Voznyy (voznyy(AT)mail.ru), Aug 12 2009

Extensions

More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999

A050401 Number of independent sets of nodes in P_4 X C_n (n > 2).

Original entry on oeis.org

8, 1, 41, 142, 933, 4741, 26660, 143697, 788453, 4293286, 23454801, 127953981, 698467368, 3811712633, 20803963753, 113540081302, 619672701957, 3381980484909, 18457878595412, 100737602247769, 549796303339413
Offset: 0

Author

Stephen G Penrice, Dec 21 1999

Keywords

Crossrefs

Column 4 of A286513.

Programs

  • GAP
    a:=[8,1,41,142,933,4741,26660,143697];; for n in [9..30] do a[n]:= a[n-1]+20*a[n-2]+27*a[n-3]-14*a[n-4]-25*a[n-5]+4*a[n-6]+5*a[n-7]-a[n-8]; od; a; # G. C. Greubel, Oct 30 2019
  • Magma
    I:=[8,1,41,142,933,4741,26660,143697]; [n le 8 select I[n] else Self(n-1)+20*Self(n-2)+27*Self(n-3)-14*Self(n-4)- 25*Self(n-5)+4*Self(n-6)+5*Self(n-7)-Self(n-8): n in [1..30]]; // Vincenzo Librandi, May 11 2017
    
  • Magma
    R:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (8 -7*x -120*x^2 -135*x^3 +56*x^4 +75*x^5 -8*x^6 -5*x^7)/((1+x)*(1+2*x-x^2)*( 1-4*x-9*x^2+5*x^3+4*x^4-x^5)) )); // G. C. Greubel, Oct 30 2019
    
  • Maple
    seq(coeff(series((8 -7*x -120*x^2 -135*x^3 +56*x^4 +75*x^5 -8*x^6 -5*x^7)/( (1+x)*(1+2*x-x^2)*(1-4*x-9*x^2+5*x^3+4*x^4-x^5)), x, n+1), x, n), n = 0 ..30); # G. C. Greubel, Oct 30 2019
  • Mathematica
    CoefficientList[Series[(8-7*x-120*x^2-135*x^3+56*x^4+75*x^5-8*x^6-5*x^7) /( (1+x)*(1+2*x-x^2)*(1-4*x-9*x^2+5*x^3+4*x^4-x^5)), {x, 0, 50}], x] (* Vincenzo Librandi, May 11 2017 *)
  • PARI
    my(x='x+O('x^30)); Vec((8 -7*x -120*x^2 -135*x^3 +56*x^4 +75*x^5 -8*x^6 -5*x^7)/((1+x)*(1+2*x-x^2)*(1-4*x-9*x^2+5*x^3+4*x^4-x^5))) \\ G. C. Greubel, Oct 30 2019
    
  • Sage
    def A050401_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P((8 -7*x -120*x^2 -135*x^3 +56*x^4 +75*x^5 -8*x^6 -5*x^7)/((1+x)*(1+2*x-x^2)*(1-4*x-9*x^2+5*x^3+4*x^4-x^5))).list()
    A050401_list(30) # G. C. Greubel, Oct 30 2019
    

Formula

a(n) = a(n-1) + 20*a(n-2) + 27*a(n-3) - 14*a(n-4) - 25*a(n-5) + 4*a(n-6) + 5*a(n-7) - a(n-8).
G.f.: (8 -7*x -120*x^2 -135*x^3 +56*x^4 +75*x^5 -8*x^6 -5*x^7)/((1+x)*(1+2*x-x^2)*(1-4*x-9*x^2+5*x^3+4*x^4-x^5)). - Colin Barker, Aug 31 2012

Extensions

More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999

A051928 Number of independent sets of vertices in graph K_3 X C_n (n > 2).

Original entry on oeis.org

4, 1, 13, 34, 121, 391, 1300, 4285, 14161, 46762, 154453, 510115, 1684804, 5564521, 18378373, 60699634, 200477281, 662131471, 2186871700, 7222746565, 23855111401, 78788080762, 260219353693, 859446141835, 2838557779204, 9375119479441, 30963916217533
Offset: 0

Author

Stephen G Penrice, Dec 19 1999

Keywords

Crossrefs

Row 3 of A287376.

Programs

  • Mathematica
    LinearRecurrence[{2,4,1},{4,1,13},30] (* Harvey P. Dale, Nov 20 2021 *)
  • PARI
    Vec((4-7*x-5*x^2)/((1+x)*(1-3*x-x^2)) + O(x^30)) \\ Colin Barker, May 11 2017

Formula

a(n) = 2*a(n-1) + 4*a(n-2) + a(n-3).
G.f.: (4-7*x-5*x^2)/((1+x)*(1-3*x-x^2)). - Colin Barker, May 22 2012
a(n) = 2*(-1)^n + ((3-sqrt(13))/2)^n + ((3+sqrt(13))/2)^n. - Colin Barker, May 11 2017
a(n) = A006497+2*(-1)^n. - R. J. Mathar, Oct 20 2017

A053763 a(n) = 2^(n^2 - n).

Original entry on oeis.org

1, 1, 4, 64, 4096, 1048576, 1073741824, 4398046511104, 72057594037927936, 4722366482869645213696, 1237940039285380274899124224, 1298074214633706907132624082305024, 5444517870735015415413993718908291383296, 91343852333181432387730302044767688728495783936
Offset: 0

Author

Stephen G Penrice, Mar 29 2000

Keywords

Comments

Nilpotent n X n matrices over GF(2). Also number of simple digraphs (without self-loops) on n labeled nodes (see also A002416).
For n >= 1 a(n) is the size of the Sylow 2-subgroup of the Chevalley group A_n(4) (sequence A053291). - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 30 2001
(-1)^ceiling(n/2) * resultant of the Chebyshev polynomial of first kind of degree n and Chebyshev polynomial of first kind of degree (n+1) (cf. A039991). - Benoit Cloitre, Jan 26 2003
The number of reflexive binary relations on an n-element set. - Justin Witt (justinmwitt(AT)gmail.com), Jul 12 2005
From Rick L. Shepherd, Dec 24 2008: (Start)
Number of gift exchange scenarios where, for each person k of n people,
i) k gives gifts to g(k) of the others, where 0 <= g(k) <= n-1,
ii) k gives no more than one gift to any specific person,
iii) k gives no single gift to two or more people and
iv) there is no other person j such that j and k jointly give a single gift.
(In other words -- but less precisely -- each person k either gives no gifts or gives exactly one gift per person to 1 <= g(k) <= n-1 others.) (End)
In general, sequences of the form m^((n^2 - n)/2) enumerate the graphs with n labeled nodes with m types of edge. a(n) therefore is the number of labeled graphs with n nodes with 4 types of edge. To clarify the comment from Benoit Cloitre, dated Jan 26 2003, in this context: simple digraphs (without self-loops) have four types of edge. These types of edges are as follows: the absent edge, the directed edge from A -> B, the directed edge from B -> A and the bidirectional edge, A <-> B. - Mark Stander, Apr 11 2019

Examples

			a(2)=4 because there are four 2 x 2 nilpotent matrices over GF(2):{{0,0},{0,0}},{{0,1},{0,0}},{{0,0},{1,0}},{{1,1,},{1,1}} where 1+1=0. - _Geoffrey Critzer_, Oct 05 2012
		

References

  • J. L. Gross and J. Yellen, eds., Handbook of Graph Theory, CRC Press, 2004; p. 521.
  • F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973, p. 5, Eq. (1.1.5).

Crossrefs

Programs

Formula

Sequence given by the Hankel transform (see A001906 for definition) of A059231 = {1, 1, 5, 29, 185, 1257, 8925, 65445, 491825, ...}; example: det([1, 1, 5, 29; 1, 5, 29, 185; 5, 29, 185, 1257; 29, 185, 1257, 8925]) = 4^6 = 4096. - Philippe Deléham, Aug 20 2005
a(n) = 4^binomial(n, n-2). - Zerinvary Lajos, Jun 16 2007
a(n) = Sum_{i=0..n^2-n} binomial(n^2-n, i). - Rick L. Shepherd, Dec 24 2008
G.f. A(x) satisfies: A(x) = 1 + x * A(4*x). - Ilya Gutkovskiy, Jun 04 2020
Sum_{n>=1} 1/a(n) = A319016. - Amiram Eldar, Oct 27 2020
Sum_{n>=0} a(n)*u^n/A002884(n) = Product_{r>=1} 1/(1-u/q^r). - Geoffrey Critzer, Oct 28 2021

A050402 Number of independent sets of nodes in C_4 X C_n (n > 2).

Original entry on oeis.org

7, 1, 35, 121, 743, 3561, 18995, 96433, 500871, 2573905, 13292995, 68492073, 353290343, 1821383097, 9392360019, 48428332641, 249716406791, 1287608913057, 6639354593123, 34234612471001, 176524935990503, 910219628918665, 4693389213891699, 24200638961917201
Offset: 0

Author

Stephen G Penrice, Dec 21 1999

Keywords

Programs

  • GAP
    a:=[7,1,35,121,743,3561];; for n in [7..30] do a[n]:=2*a[n-1] +15*a[n-2]+8*a[n-3]-7*a[n-4]-2*a[n-5]-a[n-6]; od; a; # G. C. Greubel, Oct 30 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (7 -13*x -72*x^2 -20*x^3 +17*x^4 +x^5)/((1+x)*(1+2*x-x^2)*(1-5*x-x^2+x^3)) )); // G. C. Greubel, Oct 30 2019
    
  • Maple
    seq(coeff(series((7-13*x-72*x^2-20*x^3+17*x^4+x^5)/((1+x)*(1+2*x-x^2) *(1-5*x-x^2+x^3)), x, n+1), x, n), n = 0 ..30); # G. C. Greubel, Oct 30 2019
  • Mathematica
    CoefficientList[Series[(7 -13*x -72*x^2 -20*x^3 +17*x^4 +x^5)/((1+x)*(1+2*x-x^2)*(1-5*x-x^2+x^3)), {x, 0, 30}], x]
  • PARI
    Vec((7-13*x-72*x^2-20*x^3+17*x^4+x^5)/((1+x)*(1+2*x-x^2)*(1-5*x- x^2+x^3)) + O(x^30)) \\ Colin Barker, May 11 2017
    
  • Sage
    def A050402_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P((7 -13*x -72*x^2 -20*x^3 +17*x^4 +x^5)/((1+x)*(1+2*x-x^2)*(1-5*x-x^2+x^3))).list()
    A050402_list(30) # G. C. Greubel, Oct 30 2019
    

Formula

a(n) = a(n-1) + 17*a(n-2) + 23*a(n-3) + a(n-4) - 9*a(n-5) - a(n-6) + a(n-7).
G.f.: (7 -13*x -72*x^2 -20*x^3 +17*x^4 +x^5)/((1+x)*(1+2*x-x^2)*(1-5*x-x^2+x^3)). - Colin Barker, Aug 31 2012

Extensions

More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999

A051927 Number of independent vertex sets in the n-prism graph Y_n = K_2 X C_n (n > 2).

Original entry on oeis.org

3, 1, 7, 13, 35, 81, 199, 477, 1155, 2785, 6727, 16237, 39203, 94641, 228487, 551613, 1331715, 3215041, 7761799, 18738637, 45239075, 109216785, 263672647, 636562077, 1536796803, 3710155681, 8957108167, 21624372013, 52205852195
Offset: 0

Author

Stephen G Penrice, Dec 19 1999

Keywords

Comments

For n>1, a(n) is also the number of ways to place k non-attacking wazirs on a 2 X n horizontal cylinder, summed over all k>=0 (wazir is a leaper [0,1]). - Vaclav Kotesovec, May 08 2012
Also the number of vertex covers for Y_n. - Eric W. Weisstein, Jan 04 2014

Crossrefs

Column 2 of A286513 and row 2 of A287376.

Programs

  • Magma
    I:=[3, 1, 7]; [n le 3 select I[n] else Self(n-1) + 3*Self(n-2) + Self(n-3): n in [1..30]]; // Vincenzo Librandi, May 04 2013
    
  • Maple
    A051927 := x -> (1+sqrt(2))^x+(-1)^x+(1-sqrt(2))^x;
    seq(simplify(A051927(i)),i=0..28); # Peter Luschny, Aug 13 2012
  • Mathematica
    CoefficientList[Series[(3 - 2 x - 3 x^2) / ((1 - 2 x - x^2) (1 + x)), {x, 0, 40}], x] (* Vincenzo Librandi, May 04 2013 *)
    Table[LucasL[n, 2] + (-1)^n, {n, 0, 20}] (* Vladimir Reshetnikov, Sep 15 2016 *)
    LinearRecurrence[{1, 3, 1}, {1, 7, 13}, {0, 20}] (* Eric W. Weisstein, Sep 27 2017 *)
  • PARI
    a(n)=polcoeff((3-2*x-3*x^2)/(1-2*x-x^2)/(1+x)+x*O(x^n),n)
    
  • PARI
    x='x+O('x^66); Vec( (3-2*x-3*x^2)/((1-2*x-x^2)*(1+x)) ) \\ Joerg Arndt, May 04 2013
  • Sage
    def A051927(x) : return (1+sqrt(2))^x+(-1)^x+(1-sqrt(2))^x
    [A051927(i).round() for i in (0..28)] # Peter Luschny, Aug 13 2012
    

Formula

a(n) = a(n-1) + 3*a(n-2) + a(n-3).
G.f.: (3-2x-3x^2)/((1-2x-x^2)(1+x)). - Michael Somos, Apr 07 2003
Let A=[0, 1, 1;1, 1, 1;1, 1, 0] be the adjacency matrix of a triangle with a loop at a vertex. Then a(n)=trace(A^n). a(n)=(-1)^n+(1-sqrt(2))^n+(1+sqrt(2))^n. - Paul Barry, Jul 22 2004
a(n) = A002203(n) + (-1)^n. - Vladimir Reshetnikov, Sep 15 2016
a(n)+a(n+1) = 4*A000129(n+1). - R. J. Mathar, Feb 13 2020
E.g.f.: cosh(x) + 2*exp(x)*cosh(sqrt(2)*x) - sinh(x). - Stefano Spezia, Mar 31 2024

A051926 Number of independent sets of nodes in graph C_4 X P_n (n>2).

Original entry on oeis.org

1, 7, 35, 181, 933, 4811, 24807, 127913, 659561, 3400911, 17536203, 90422365, 466247117, 2404121747, 12396433487, 63920042065, 329592522065, 1699486218903, 8763103574515, 45185411569413, 232990675202677, 1201375684008283, 6194683683674679, 31941803427179001
Offset: 0

Author

Stephen G Penrice, Dec 19 1999

Keywords

Comments

Number of ways zero or more black and white stones can be placed on the points of a 2 X n grid such that no white stones are adjacent to any black stones. A078057 is a related case, where the grid is 1 X n. - Wayne VanWeerthuizen, May 04 2004

Crossrefs

Row 4 of A286513.

Programs

  • Magma
    I:=[1, 7, 35]; [n le 3 select I[n] else 5*Self(n-1)+Self(n-2)-Self(n-3): n in [1..25]]; // Vincenzo Librandi, Apr 27 2012
  • Mathematica
    CoefficientList[Series[(1+2*x-x^2)/(1-5*x-x^2+x^3),{x,0,30}],x] (* Vincenzo Librandi, Apr 27 2012 *)
    LinearRecurrence[{5,1,-1},{1,7,35},40] (* Harvey P. Dale, Apr 29 2019 *)

Formula

a(n) = 5*a(n-1)+a(n-2)-a(n-3) for n>2. - Wayne VanWeerthuizen, May 04 2004
G.f.: (1+2*x-x^2)/(1-5*x-x^2+x^3). - Colin Barker, Apr 18 2012

Extensions

More terms from James Sellers, Dec 20 1999