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

A052548 a(n) = 2^n + 2.

Original entry on oeis.org

3, 4, 6, 10, 18, 34, 66, 130, 258, 514, 1026, 2050, 4098, 8194, 16386, 32770, 65538, 131074, 262146, 524290, 1048578, 2097154, 4194306, 8388610, 16777218, 33554434, 67108866, 134217730, 268435458, 536870914, 1073741826, 2147483650
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

The most "compact" sequence that satisfies Bertrand's Postulate. Begin with a(1) = 3 = n, then 2n - 2 = 4 = n_1, 2n_1 - 2 = 6 = n_2, 2n_2 - 2 = 10, etc. = a(n), hence there is guaranteed to be at least one prime between successive members of the sequence. - Andrew S. Plewe, Dec 11 2007
Number of 2-sided prudent polygons of area n, for n>0, see Beaton, p. 5. - Jonathan Vos Post, Nov 30 2010

Crossrefs

Programs

  • Haskell
    a052548 = (+ 2) . a000079
    a052548_list = iterate ((subtract 2) . (* 2)) 3
    -- Reinhard Zumkeller, Sep 05 2015
  • Magma
    [2^n + 2: n in [0..35]]; // Vincenzo Librandi, Apr 29 2011
    
  • Maple
    spec := [S,{S=Union(Sequence(Union(Z,Z)),Sequence(Z),Sequence(Z))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..20);
  • Mathematica
    2^Range[0,40]+2 (* Harvey P. Dale, Jun 26 2012 *)
  • PARI
    a(n)=1<Charles R Greathouse IV, Nov 20 2011
    

Formula

G.f.: (3-5*x)/((1-2*x)*(1-x)) = (3-5*x)/(1 - 3*x + 2*x^2) = 2/(1-x) + 1/(1-2*x).
a(0)=3, a(1)=4, a(n) = 3*a(n-1) - 2*a(n-2).
a(n) = A058896(n)/A000918(n), for n>0. - Reinhard Zumkeller, Feb 14 2009
a(n) = A173786(n,1), for n>0. - Reinhard Zumkeller, Feb 28 2010
a(n)*A000918(n) = A028399(2*n), for n>0. - Reinhard Zumkeller, Feb 28 2010
a(0)=3, a(n) = 2*a(n-1) - 2. - Vincenzo Librandi, Aug 06 2010
E.g.f.: (2 + exp(x))*exp(x). - Ilya Gutkovskiy, Aug 16 2016

Extensions

More terms from James Sellers, Jun 06 2000

A058481 a(n) = 3^n - 2.

Original entry on oeis.org

1, 7, 25, 79, 241, 727, 2185, 6559, 19681, 59047, 177145, 531439, 1594321, 4782967, 14348905, 43046719, 129140161, 387420487, 1162261465, 3486784399, 10460353201, 31381059607, 94143178825, 282429536479, 847288609441
Offset: 1

Views

Author

Vladeta Jovovic, Nov 26 2000

Keywords

Comments

a(n) = number of 2 X n binary matrices with no zero rows or columns.
a(n)^2 + 2*a(n+1) + 1 is a square number, i.e., a(n)^2 + 2*a(n+1) + 1 = (a(n)+3)^2: for n=2, a(2)^2 + 2*a(3) + 1 = 7^2 + 2*25 + 1 = 100 = (7+3)^2; for n=3, a(3)^2 + 2*a(4) + 1 = 25^2 + 2*79 + 1 = 784 = (25+3)^2. - Bruno Berselli, Apr 23 2010
Sum of n-th row of triangle of powers of 3: 1; 3 1 3; 9 3 1 3 9; 27 9 3 1 3 9 27; ... . - Philippe Deléham, Feb 24 2014
a(n) = least k such that k*3^n + 1 is a square. Thus, the square is given by (3^n-1)^2. - Derek Orr, Mar 23 2014
Binomial transform of A058481: (1, 6, 12, 24, 48, 96, ...) and second binomial transform of (1, 5, 1, 5, 1, 5, ...). - Gary W. Adamson, Aug 24 2016
Number of ordered pairs of nonempty sets whose union is [n]. a(2) = 7: ({1,2},{1,2}), ({1,2},{1}), ({1,2},{2}), ({1},{1,2}), ({1},{2}), ({2},{1,2}), ({2},{1}). If "nonempty" is omitted we get A000244. - Manfred Boergens, Mar 29 2023

Examples

			G.f. = x + 7*x^2 + 25*x^3 + 79*x^4 + 241*x^5 + 727*x^6 + 2185*x^7 + 6559*x^8 + ...
a(1) = 1;
a(2) = 3 + 1 + 3 = 7;
a(3) = 9 + 3 + 1 + 3 + 9 = 25;
a(4) = 27 + 9 + 3 + 1 + 3 + 9 + 27 = 79; etc. - _Philippe Deléham_, Feb 24 2014
		

Crossrefs

Programs

Formula

Number of m X n binary matrices with no zero rows or columns is Sum_{j=0..m} (-1)^j*C(m, j)*(2^(m-j)-1)^n.
From Mohammad K. Azarian, Jan 14 2009: (Start)
G.f.: 1/(1-3*x)-2/(1-x)+1.
E.g.f.: e^(3*x)-2*(e^x)+1. (End)
a(n) = 3*a(n-1) + 4 (with a(1)=1). - Vincenzo Librandi, Aug 07 2010
a(n) = 4*a(n-1) - 3*a(n-2). - G. C. Greubel, Aug 25 2016

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Dec 04 2000

A060816 a(0) = 1; a(n) = (5*3^(n-1) - 1)/2 for n > 0.

Original entry on oeis.org

1, 2, 7, 22, 67, 202, 607, 1822, 5467, 16402, 49207, 147622, 442867, 1328602, 3985807, 11957422, 35872267, 107616802, 322850407, 968551222, 2905653667, 8716961002, 26150883007, 78452649022, 235357947067, 706073841202
Offset: 0

Views

Author

Jason Earls, Apr 29 2001

Keywords

Comments

From Erich Friedman's math magic page 2nd paragraph under "Answers" section.
Let A be the Hessenberg matrix of order n, defined by: A[1,j] = 1, A[i,i] = 2,(i>1), A[i,i-1] = -1, and A[i,j] = 0 otherwise. Then, for n >= 1, a(n) = (-1)^n*charpoly(A,-1). - Milan Janjic, Jan 26 2010
If n > 0 and H = hex number (A003215), then 9*H(a(n)) - 2 = H(a(n+1)), for example 9*H(2) - 2 = 9*19 - 2 = 169 = H(7). For n > 2, this is a subsequence of A017209, see formula. - Klaus Purath, Mar 31 2021
Consider the Tower of Hanoi puzzle of order n (i.e., with n rings to be moved). Label each ring with a distinct symbol from an alphabet of size n. Construct words by performing moves according to the standard rules of the puzzle, recording the corresponding symbol each time a ring is moved. To ensure finiteness, we forbid returning to any previously encountered state. Additionally, we impose the constraint that the same ring cannot be moved twice in succession. Then, a(n) is the number of distinct words that can be formed under these rules. - Thomas Baruchel, Jul 22 2025

Crossrefs

Cf. A005030 (first differences), A244762 (partial sums).

Programs

Formula

The following is a summary of formulas added over the past 18 years.
a(n) = A057198(n) - 1.
a(n) = 3*a(n-1) + 1; with a(0)=1, a(1)=2. - Jason Earls, Apr 29 2001
From Henry Bottomley, May 01 2001: (Start)
For n>0, a(n) = a(n-1)+5*3^(n-2) = a(n-1)+A005030(n-2).
For n>0, a(n) = (5*A003462(n)+1)/3. (End)
From Colin Barker, Apr 24 2012: (Start)
a(n) = 4*a(n-1) - 3*a(n-2) for n > 2.
G.f.: (1-2*x+2*x^2)/((1-x)*(1-3*x)). (End)
a(n+1) = A134931(n) + 1. - Philippe Deléham, Apr 14 2013
For n > 0, A008343(a(n)) = 0. - Dmitry Kamenetsky, Feb 14 2017
For n > 0, a(n) = floor(3^n*5/6). - M. F. Hasler, Apr 06 2019
From Klaus Purath, Mar 31 2021: (Start)
a(n) = A017209(a(n-2)), n > 2.
a(n) = 2 + Sum_{i = 0..n-2} A005030(i).
a(n+1)*a(n+2) = a(n)*a(n+3) + 20*3^n, n > 1.
a(n) = 3^n - A007051(n-1). (End)
E.g.f.: (5*exp(3*x) - 3*exp(x) + 4)/6. - Stefano Spezia, Aug 28 2023

Extensions

Edited by M. F. Hasler, Apr 06 2019 and by N. J. A. Sloane, Apr 09 2019

A046901 a(n) = a(n-1) - n if a(n-1) > n, else a(n) = a(n-1) + n.

Original entry on oeis.org

1, 3, 6, 2, 7, 1, 8, 16, 7, 17, 6, 18, 5, 19, 4, 20, 3, 21, 2, 22, 1, 23, 46, 22, 47, 21, 48, 20, 49, 19, 50, 18, 51, 17, 52, 16, 53, 15, 54, 14, 55, 13, 56, 12, 57, 11, 58, 10, 59, 9, 60, 8, 61, 7, 62, 6, 63, 5, 64, 4, 65, 3, 66, 2, 67, 1, 68, 136, 67, 137
Offset: 1

Views

Author

Keywords

Comments

Variation (1) on Recamán's sequence A005132.
a(A134931(n-1)) = 1. - Reinhard Zumkeller, Jan 31 2013

Crossrefs

Programs

  • Haskell
    a046901 n = a046901_list !! (n-1)
    a046901_list = scanl1 (\u v -> if u > v then u - v else u + v) [1..]
    -- Reinhard Zumkeller, Dec 07 2015, Jan 31 2013
  • Maple
    A046901 := proc(n) option remember; if n = 1 then 1 else if A046901(n-1)>n then A046901(n-1)-n else A046901(n-1)+n; fi; fi; end;
  • Mathematica
    a[1]=1;a[n_]:=a[n]=If[a[n-1]>n,a[n-1]-n,a[n-1]+n]; Table[a[i],{i,70}]  (* Harvey P. Dale, Apr 01 2011 *)
    nxt[{n_,a_}]:={n+1,If[a>n+1,a-n-1,a+n+1]}; NestList[nxt,{1,1},70][[All,2]] (* Harvey P. Dale, Jun 01 2019 *)
  • PARI
    a(n)=if(n<2,1,a(n-1)-if(sign(n-a(n-1))+1,-1,1)*n);
    

Formula

This is a concatenation S_0, S_1, S_2, ... where S_i = [b_0, b_1, ..., b_{k-1}], k=5*3^i, with b_0 = 1, b_{2j} = k+j, b_{2j+1} = (k+1)/2-j. E.g., S_0 = [1, 3, 6, 2, 7].
For any m>=1, for k such that 5*3^k+3>12m, a((5*3^k+3-12*m)/6)= m. For example, for k>=1, a((5*3^k-9)/6) = 1. - Benoit Cloitre, Oct 31 2002
a(n) = A008343(n+1) + 1. - Jon Maiga, Jul 09 2021

A100774 a(n) = 2*(3^n - 1).

Original entry on oeis.org

0, 4, 16, 52, 160, 484, 1456, 4372, 13120, 39364, 118096, 354292, 1062880, 3188644, 9565936, 28697812, 86093440, 258280324, 774840976, 2324522932, 6973568800, 20920706404, 62762119216, 188286357652, 564859072960, 1694577218884
Offset: 0

Views

Author

Pawel P. Mazur (Pawel.Mazur(AT)pwr.wroc.pl), Apr 06 2005

Keywords

Comments

a(n) is the number of steps which are made when generating all n-step nonreversing random walks that begin in a fixed point P on a two-dimensional square lattice. To make one step means to move along one edge on the lattice.
These are also the first local maxima reached in the Collatz trajectories of 2^n - 1. - David Rabahy, Oct 30 2017
Also the graph diameter of the n-Sierpinski carpet graph. - Eric W. Weisstein, Mar 13 2018
a(n) is the number of edge covers of F_{n,2}, which has adjacent vertices u and w, and n vertices each adjacent to both u and w. An edge cover is a subset of the edges where each vertex is adjacent to at least one vertex. To cover each of the n vertices v_i, we need to have at least the edge uv_i or wv_i or both, giving us three choices for each. We can then add the edge uw or not, which is 2*3^n choices. But we need to remove the case where all uv_i's were chosen and uw not chosen, and all ww_i's were chosen and uw not chosen. - Feryal Alayont, Jun 17 2024

Crossrefs

Programs

Formula

a(n) = 2*(3^n - 1).
a(n) = 4*Sum_{i=0..n-1} 3^i.
a(n) = 4*A003462(n).
a(n) = A048473(n) - 1. - Paul Curtz, Jan 19 2009
G.f.: 4*x/((1-x)*(1-3*x)). - Eric W. Weisstein, Mar 13 2018
a(n) = 4*a(n-1) - 3*a(n-2). - Eric W. Weisstein, Mar 13 2018
From Elmo R. Oliveira, Dec 06 2023: (Start)
a(n) = 2*A024023(n).
a(n) = 3*a(n-1) + 4 for n>0.
E.g.f.: 2*(exp(3*x) - exp(x)). (End)

A115099 a(0)=4, a(n) = 3*a(n-1) - 4.

Original entry on oeis.org

4, 8, 20, 56, 164, 488, 1460, 4376, 13124, 39368, 118100, 354296, 1062884, 3188648, 9565940, 28697816, 86093444, 258280328, 774840980, 2324522936, 6973568804, 20920706408, 62762119220, 188286357656, 564859072964, 1694577218888, 5083731656660, 15251194969976
Offset: 0

Views

Author

Miklos Kristof, Mar 02 2006

Keywords

Comments

A tetrahedron has 4 faces. Cut every corner so that we get triangular faces; the resulting polyhedron has 8 faces. Repeating this procedure gives polyhedra with 4, 8, 20, 56, etc. faces.

Crossrefs

Programs

Formula

a(n) = 2*3^n + 2.
From Colin Barker, May 31 2016: (Start)
a(n) = 4*a(n-1)-3*a(n-2) for n>1.
G.f.: 4*(1-2*x) / ((1-x)*(1-3*x)).
(End)
E.g.f.: 2*(1 + exp(2*x))*exp(x). - Ilya Gutkovskiy, May 31 2016
a(n) = 4 * A007051(n). - Alois P. Heinz, Jun 26 2023

A225918 a(n) is the least k such that f(a(n-1)+1) + ... + f(k) > f(a(n-2)+1) + ... + f(a(n-1)) for n > 1, where f(n) = 1/(n+3) and a(1) = 1.

Original entry on oeis.org

1, 9, 32, 98, 287, 828, 2377, 6812, 19510, 55866, 159958, 457987, 1311283, 3754381, 10749290, 30776629, 88117519, 252291984, 722344942, 2068168017, 5921435438, 16953843853, 48541071558, 138979434294, 397916291012, 1139286366040, 3261925819973, 9339320097349, 26739694491713
Offset: 1

Views

Author

Clark Kimberling, May 21 2013

Keywords

Comments

Suppose that f(n) is a sequence of positive real numbers for which the series f(1) + f(2) + ... diverges. Put a(1) = 1 and a(n) = least k such that f(a(n-1)+1) + ... + f(k) > f(a(n-2)+1) + ... + f(a(n-1)) for n > 1. Conjecture: a(n) is linearly recurrent for the choices of f(n) shown here:
f(n) ...... a(n)................ recurrence coefficients
1/n ....... A003462: 1,4,13,.... (4,-3)
1/(n+1) ... A134931: 1,6,21,.... (4,-3)
1/(n+2) ... A116952: 1,8,29,.... (4,-3)
1/(n+3) ... A225918: 1,9,32,.... (3,0,-1,0,-1)
1/(n+4) ... A225919: 1,11,40,... (4,-4,3,-2)
1/(n+5) ... A225920: 1,13,48,... ?
1/(n+6) ... A225921: 1,14,50,... ?
1/(n+7) ... A225922: 1,16,48,... ?
Assuming linear recurrence, it appears that lim_{n->infinity} a(n+1)/a(n) is the greatest root, R, of the characteristic polynomial of the recurrence, and that lim_{n->infinity} (1/(a(n-1)+1) + ... + 1/a(n)) = log R.
For sequences A225920-A225922, linear recurrence is unlikely to exist. - Max Alekseyev, Jan 27 2022

Examples

			a(1) = 1 by decree; a(2) = 9 because 1/5 + ... + 1/11 < 1 < 1/5 + ... + 1/(9+3), so that a(3) = 32 because 1/13 + ... + 1/34 < 1/5 + ... + 1/12 < 1/13 + ... + 1/(32+3).
Successive values of a(n) yield a chain: 1 < 1/(1+4) + ... + 1/(9+3) < 1/(9+4) + ... + 1/(32+3) < 1/(32+4) + ... + 1/(98+3) < ...
Abbreviating this chain as b(1) = 1 < b(2) < b(3) < b(4) < ... < R = 2.8631..., it appears that lim_{n->infinity} b(n) = log R = 1.0519... .
		

Crossrefs

Programs

  • Mathematica
    nn = 11; f[n_] := 1/(n + 3); a[1] = 1; g[n_] := g[n] = Sum[f[k], {k, 1, n}]; s = 0; a[2] = NestWhile[# + 1 &, 2, ! (s += f[#]) >= a[1] &]; s = 0; a[3] = NestWhile[# + 1 &, a[2] + 1, ! (s += f[#]) >= g[a[2]] - f[1] &]; Do[s = 0; a[z] = NestWhile[# + 1 &, a[z - 1] + 1, ! (s += f[#]) >= g[a[z - 1]] - g[a[z - 2]] &], {z, 4, nn}]; m = Map[a, Range[nn]] (* Peter J. C. Moses, May 13 2013 *)
  • PARI
    lista(nn) = {default(realprecision, 100); my(k=5, r=1, s); print1(1); for(n=2, nn, s=0; while((s+=1./k)Jinyuan Wang, Jun 14 2020

Formula

For n>=3, a(n) = ceiling( (a(n-1)+3.5)^2 / (a(n-2)+3.5) - 3.5 ) unless the fractional part of the number inside ceiling() is very small (~ 1/a(n-2)). - Max Alekseyev, Jan 27 2022

Extensions

a(12)-a(18) from Robert G. Wilson v, May 22 2013
a(19) from Jinyuan Wang, Jun 14 2020
Terms a(20) on from Max Alekseyev, Jan 27 2022

A079004 Least x>=3 such that F(x)==1 (mod 3^n) where F(x) denotes the x-th Fibonacci number (A000045).

Original entry on oeis.org

7, 10, 10, 34, 106, 322, 970, 2914, 8746, 26242, 78730, 236194, 708586, 2125762, 6377290, 19131874, 57395626, 172186882, 516560650, 1549681954, 4649045866, 13947137602, 41841412810, 125524238434, 376572715306, 1129718145922
Offset: 1

Views

Author

Benoit Cloitre, Feb 01 2003

Keywords

References

  • R. L. Graham, D. E. Knuth and O. Patashnick, "Concrete Mathematics", second edition, Addison Wesley, ex. 6.59.

Crossrefs

Programs

  • Maple
    7, 10, seq(4*3^(n-2)-2,n=3..50); # Robert Israel, Jan 15 2015
  • Mathematica
    a=2;lst={7,10};Do[a=a*3+4;AppendTo[lst,a],{n,0,5!}];lst (* Vladimir Joseph Stephan Orlovsky, Dec 25 2008 *)
    LinearRecurrence[{4,-3},{7,10,10,34},40] (* Harvey P. Dale, Aug 16 2024 *)
  • PARI
    a(n)=if(n<0,0,x=3; while((fibonacci(x)-1)%(3^n)>0,x++); x)

Formula

a(1)=7, a(2)=10, a(3)=10; for n>3, a(n) = 3*a(n-1) + 4.
a(n) = 4*3^(n-2)-2 for n >= 3.
G.f.: 8*x^2+(23/3)*x+14/9+2/(x-1)-4/(9*(3*x-1)). - Robert Israel, Jan 15 2015

Extensions

Formula corrected by Robert Israel, Jan 15 2015

A132753 a(n) = 2^(n+1) - n + 1.

Original entry on oeis.org

3, 4, 7, 14, 29, 60, 123, 250, 505, 1016, 2039, 4086, 8181, 16372, 32755, 65522, 131057, 262128, 524271, 1048558, 2097133, 4194284, 8388587, 16777194, 33554409, 67108840, 134217703, 268435430, 536870885, 1073741796, 2147483619
Offset: 0

Views

Author

Gary W. Adamson, Aug 28 2007

Keywords

Comments

Apart from a(0): Row sums of triangle A132752 (old name).
Apart from a(0): Binomial transform of [1, 3, 0, 4, 0, 4, 0, 4, ...].

Examples

			a(3) = 14 = sum of row 3 terms of triangle A132752: (3 + 5 + 5 + 1).
a(3) = 14 = (1, 3, 3, 1) dot (1, 3, 0, 4) = (1 + 9 + 0 + 4).
		

Crossrefs

Programs

  • Magma
    [2^(n+1) -n+1: n in [0..40]]; // G. C. Greubel, Feb 16 2021
  • Maple
    A132753:= n-> 2^(n+1) -n+1; seq(A132753(n), n=0..40) # G. C. Greubel, Feb 16 2021
  • Mathematica
    Table[2^(n+1) -n+1, {n, 0, 30}] (* Bruno Berselli, Aug 31 2013 *)
  • PARI
    a(n)=2^(n+1)-n+1
    
  • PARI
    Vec( (3-8*x+6*x^2)/((1-x)^2*(1-2*x)) + O(x^40)) \\ Colin Barker, Mar 14 2014
    
  • Sage
    [2^(n+1) -n+1 for n in (0..40)] # G. C. Greubel, Feb 16 2021
    

Formula

From Colin Barker, Mar 14 2014: (Start)
a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3).
G.f.: (3 - 8*x + 6*x^2)/((1-x)^2 * (1-2*x)). (End)
E.g.f.: (1-x)*exp(x) + 2*exp(2*x). - G. C. Greubel, Feb 16 2021

Extensions

More terms Vladimir Joseph Stephan Orlovsky, Dec 25 2008
Changed first member, and better name from Ralf Stephan, Aug 31 2013

A137215 a(n) = 3*(10^n) + (n^2 + 1)*(10^n - 1)/9.

Original entry on oeis.org

3, 32, 355, 4110, 48887, 588886, 7111107, 85555550, 1022222215, 12111111102, 142222222211, 1655555555542, 19111111111095, 218888888888870, 2488888888888867, 28111111111111086, 315555555555555527, 3522222222222222190, 39111111111111111075, 432222222222222222182
Offset: 0

Views

Author

Ctibor O. Zizka, Mar 06 2008

Keywords

Comments

Sequence generalized: a(n) = a(0)*(B^n) + F(n)* ((B^n)-1)/(B-1); a(0), B integers, F(n) arithmetic function.
Examples:
a(0) = 1, B = 10, F(n) = 1 gives A002275, F(n) = 2 gives A090843, F(n) = 3 gives A097166, F(n) = 4 gives A099914, F(n) = 5 gives A099915.
a(0) = 1, B = 2, F(n) = 1 gives A000225, F(n) = 2 gives A033484, F(n) = 3 gives A036563, F(n) = 4 gives A048487, F(n) = 5 gives A048488, F(n) = 6 gives A048489.
a(0) = 1, B = 3, F(n) = 1 gives A003462, F(n) = 2 gives A048473, F(n) = 3 gives A134931, F(n) = 4 gives A058481, F(n) = 5 gives A116952.
a(0) = 1, B = 4, F(n) = 1 gives A002450, F(n) = 2 gives A020989, F(n) = 3 gives A083420, F(n) = 4 gives A083597, F(n) = 5 gives A083584.
a(0) = 1, B = 5, F(n) = 1 gives A003463, F(n) = 2 gives A057651, F(n) = 3 gives A117617, F(n) = 4 gives A081655.
a(0) = 2, B = 10, F(n) = 1 gives A037559, F(n) = 2 gives A002276.

Examples

			a(3) = 3*10^3 + (3*3 + 1)*(10^3 - 1)/9 = 4110.
		

Crossrefs

Programs

  • Mathematica
    Table[3*10^n +(n^2 +1)*(10^n -1)/9, {n,0,30}] (* G. C. Greubel, Jan 05 2022 *)
  • PARI
    a(n) = 3*(10^n) + (n*n+1)*((10^n)-1)/9; \\ Jinyuan Wang, Feb 27 2020
    
  • Sage
    [3*10^n +(1+n^2)*(10^n -1)/9 for n in (0..30)] # G. C. Greubel, Jan 05 2022

Formula

a(n) = 3*(10^n) + (n^2 + 1)*(10^n - 1)/9.
O.g.f.: (3 - 67*x + 478*x^2 - 1002*x^3 + 850*x^4 - 100*x^5)/((1-x)^3 * (1-10*x)^3). - R. J. Mathar, Mar 16 2008

Extensions

More terms from R. J. Mathar, Mar 16 2008
More terms from Jinyuan Wang, Feb 27 2020
Showing 1-10 of 14 results. Next