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.

Previous Showing 21-28 of 28 results.

A001011 Number of ways to fold a strip of n blank stamps.

Original entry on oeis.org

1, 1, 2, 5, 14, 38, 120, 353, 1148, 3527, 11622, 36627, 121622, 389560, 1301140, 4215748, 14146335, 46235800, 155741571, 512559195, 1732007938, 5732533570, 19423092113, 64590165281, 219349187968, 732358098471, 2492051377341, 8349072895553, 28459491475593
Offset: 1

Views

Author

Keywords

References

  • M. Gardner, Mathematical Games, Sci. Amer. Vol. 209 (No. 3, Mar. 1963), p. 262.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence - see entry 576, Fig. 17, and the front cover).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

Formula

a(n) = (A001010(n) + A000136(n)) / 4 for n >= 2. - Andrew Howroyd, Dec 07 2015

Extensions

a(17) and a(20) corrected by Sean A. Irvine, Mar 17 2013

A005579 a(n) = smallest number k such that Product_{i=1..k} prime(i)/(prime(i)-1) > n.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 9, 14, 22, 35, 55, 89, 142, 230, 373, 609, 996, 1637, 2698, 4461, 7398, 12301, 20503, 34253, 57348, 96198, 161659, 272124, 458789, 774616, 1309627, 2216968, 3757384, 6375166, 10828012, 18409028, 31326514, 53354259, 90945529, 155142139
Offset: 0

Views

Author

Keywords

Comments

Laatsch (1986) proved that for n >= 2, a(n) gives the smallest number of distinct prime factors in even numbers having an abundancy index > n.
The abundancy index of a number k is sigma(k)/k. - T. D. Noe, May 08 2006
The first differences of this sequence, A005347, begin the same as the Fibonacci sequence A000045. - T. D. Noe, May 08 2006
Equal to A256968 except for n = 2 and n = 3. See comment in A256968. - Chai Wah Wu, Apr 17 2015

Examples

			The products Product_{i=1..k} prime(i)/(prime(i)-1) for k >= 0 start with 1, 2, 3, 15/4, 35/8, 77/16, 1001/192, 17017/3072, 323323/55296, 676039/110592, 2800733/442368, 86822723/13271040, 3212440751/477757440, 131710070791/19110297600, 5663533044013/802632499200, ... = A060753/A038110. So a(3) = 3.
		

References

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

Crossrefs

A001611 is similar but strictly different.

Programs

  • Mathematica
    (* For speed and accuracy, the second Mathematica program uses 30-digit real numbers and interval arithmetic. *)
    prod=1; k=0; Table[While[prod<=n, k++; prod=prod*Prime[k]/(Prime[k]-1)]; k, {n,0,25}] (* T. D. Noe, May 08 2006 *)
    prod=Interval[1]; k=0; Table[While[Max[prod]<=n, k++; p=Prime[k]; prod=N[prod*p/(p-1),30]]; If[Min[prod]>n, k, "too few digits"], {n,0,38}]
  • PARI
    a(n)=my(s=1,k); forprime(p=2,, s*=p/(p-1); k++; if(s>n, return(k))) \\ Charles R Greathouse IV, Aug 20 2015
    
  • Python
    from sympy import nextprime
    def a_list(upto: int) -> list[int]:
        L: list[int] = [0]
        count = 1; bn = 1; bd = 1; p = 2
        for k in range(1, upto + 1):
            bn *= p
            bd *= p - 1
            while bn > count * bd:
                L.append(k)
                count += 1
            p = nextprime(p)
        return L
    print(a_list(1000))  # Chai Wah Wu, Apr 17 2015, adapted by Peter Luschny, Jan 25 2025

Formula

a(n) = smallest k such that A002110(k)/A005867(k) > n. - Artur Jasinski, Nov 06 2008
a(n) = PrimePi(A091440(n)) = A000720(A091440(n)) for n >= 4. - Amiram Eldar, Apr 18 2025

Extensions

Edited by T. D. Noe, May 08 2006
a(26) added by T. D. Noe, Sep 18 2008
Typo corrected by Vincent E. Yu (yu.vincent.e(AT)gmail.com), Aug 14 2009
a(27)-a(36) from Vincent E. Yu (yu.vincent.e(AT)gmail.com), Aug 14 2009
Comment corrected by T. D. Noe, Apr 04 2010
a(37)-a(39) from T. D. Noe, Nov 16 2010
Edited and terms a(0)-a(1) prepended by Max Alekseyev, Jan 25 2025

A001475 a(n) = a(n-1) + n * a(n-2), where a(1) = 1, a(2) = 2.

Original entry on oeis.org

1, 2, 5, 13, 38, 116, 382, 1310, 4748, 17848, 70076, 284252, 1195240, 5174768, 23103368, 105899656, 498656912, 2404850720, 11879332048, 59976346448, 309442319456, 1628921941312, 8746095288800, 47840221880288, 266492604100288, 1510338372987776
Offset: 1

Views

Author

Keywords

Comments

a(n) is the number of set partitions of [n] in which the block containing 1 is of length <= 3 and all other blocks are of length <= 2. Example: a(4)=13 counts all 15 partitions of [4] except 1234 and 1/234. - David Callan, Jul 22 2008
Empirical: a(n) is the sum of the entries in the second-last row of the lower-triangular matrix of coefficients giving the expansion of degree-(n+1) complete homogeneous symmetric functions in the Schur basis of the algebra of symmetric functions. - John M. Campbell, Mar 18 2018

Examples

			G.f. = x + 2*x + 5*x^2 + 13*x^3 + 38*x^4 + 116*x^5 + 382*x^6 + 1310*x^7 + ... - _Michael Somos_, Jan 23 2018
		

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 86 (divided by 2).
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • GAP
    a:=[1, 2];; for n in [3..10^2] do a[n] := a[n-1] + n*a[n-2]; od; a;  # Muniru A Asiru, Jan 25 2018
    
  • Magma
    I:=[1,2]; [n le 2 select I[n] else Self(n-1)+n*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Mar 31 2018
    
  • Maple
    a := proc(n) option remember: if n = 1 then 1 elif n = 2 then 2 elif  n >= 3 then procname(n-1) +n*procname(n-2) fi; end:
    seq(a(n), n = 1..100); # Muniru A Asiru, Jan 25 2018
  • Mathematica
    RecurrenceTable[{a[1]==1,a[2]==2,a[n]==a[n-1]+n a[n-2]},a,{n,30}] (* Harvey P. Dale, Apr 21 2012 *)
    (* Programs from Michael Somos, Jan 23 2018 *)
    a[n_]:= With[{m=n+1}, If[m<2, 0, Sum[(2 k-1)!! Binomial[m, 2 k], {k, 0, m/2}]/2]];
    a[n_]:= With[{m=n+1}, If[m<2, 0, HypergeometricU[-m/2, 1/2, -1/2] / (-1/2)^(m/2)/2]];
    a[n_]:= With[{m=n+1}, If[m<2, 0, HypergeometricPFQ[{-m/2, (1-m)/2}, {}, 2]/2]];
    a[n_]:= If[ n<1, 0, n! SeriesCoefficient[Exp[x+x^2/2]*(1+x)/2, {x, 0, n}]]; (* End *)
    Fold[Append[#1, #1[[-1]] + #2 #1[[-2]]] &, {1, 2}, Range[3, 26]] (* Michael De Vlieger, Jan 23 2018 *)
  • PARI
    {a(n) = if( n<1, 0, n! * polcoeff( exp( x + x^2/2 + x * O(x^n)) * (1 + x) / 2, n))}; /* Michael Somos, Jan 23 2018 */
    
  • PARI
    my(N=30,x='x+O('x^N)); Vec(serlaplace((1/2)*( (1+x)*exp(x + x^2/2) - 1))) \\ Joerg Arndt, Sep 04 2023
    
  • SageMath
    def A001475_list(prec):
        P. = PowerSeriesRing(QQ, prec)
        return P( ((1+x)*exp(x+x^2/2) -1)/2 ).egf_to_ogf().list()
    a=A001475_list(40); a[1:] # G. C. Greubel, Sep 03 2023

Formula

a(n) = (1/2)*A000085(n+1).
E.g.f.: (1/2)*( (1+x)*exp(x + x^2/2) - 1). - Vladeta Jovovic, Nov 04 2003
Given e.g.f. y(x), then 0 = y'(x) * (1+x) - (y(x)+1/2) * (2+2*x+x^2) = 1 - y''(x) + y'(x)*(1 + x) + 2*y(x). - Michael Somos, Jan 23 2018
0 = +a(n)*(+a(n+1) +a(n+2) -a(n+3)) +a(n+1)*(-a(n+1) +a(n+2)) for all n>0. - Michael Somos, Jan 23 2018
a(n) ~ n^((n+1)/2) / (2^(3/2) * exp(n/2 - sqrt(n) + 1/4)) * (1 + 19/(24*sqrt(n))). - Vaclav Kotesovec, Apr 01 2018

Extensions

More terms from Harvey P. Dale, Apr 21 2012

A005350 a(1) = a(2) = a(3) = 1, a(n) = a(a(n-1)) + a(n-a(n-1)) for n >= 4.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 3, 4, 5, 5, 5, 5, 6, 7, 7, 8, 8, 8, 8, 8, 9, 10, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 15, 16, 16, 17, 18, 18, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 22, 23, 24, 25, 25, 26, 27, 27, 28
Offset: 1

Views

Author

Keywords

Comments

a(n) - a(n-1) = 0 or 1 (see the 1991 Monthly reference). - Emeric Deutsch, Jun 06 2005

References

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

Crossrefs

Programs

  • Haskell
    a005350 n = a005350_list !! (n-1)
    a005350_list = 1 : 1 : 1 : h 4 1 where
       h x y = z : h (x + 1) z where z = a005350 y + a005350 (x - y)
    -- Reinhard Zumkeller, Jul 20 2012
    
  • Maple
    A005350 := proc(n) option remember; if n<=3 then 1 else procname(procname(n-1)) + procname(n-procname(n-1)); end if; end proc:
    seq(A005350(n),n=1..64) ;
  • Mathematica
    a[1] = a[2] = a[3] = 1; a[n_] := a[n] = a[a[n-1]] + a[n-a[n-1]]; Table[a[n], {n, 1, 64}] (* Jean-François Alcover, Feb 11 2014 *)
  • SageMath
    @CachedFunction
    def a(n): return 1 if (n<4) else a(a(n-1)) + a(n-a(n-1))
    [a(n) for n in range(1,100)]  # G. C. Greubel, Nov 14 2022

A005181 a(n) = ceiling(exp((n-1)/2)).

Original entry on oeis.org

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 91, 149, 245, 404, 666, 1097, 1809, 2981, 4915, 8104, 13360, 22027, 36316, 59875, 98716, 162755, 268338, 442414, 729417, 1202605, 1982760, 3269018, 5389699, 8886111, 14650720, 24154953, 39824785, 65659970, 108254988, 178482301
Offset: 0

Views

Author

Keywords

Comments

This sequence illustrates the second law of small numbers because it is a coincidence that its first ten terms are the same as the first ten Fibonacci numbers (A000045). - Alonso del Arte, Mar 18 2013

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • I. Stewart, L'univers des nombres, pp. 27 Belin-Pour La Science, Paris 2000.

Crossrefs

Programs

  • Maple
    seq(round(ceil(exp((n-1)/2))), n=0..50); # Vladimir Pletser, Sep 15 2013
  • Mathematica
    Table[Ceiling[E^((n - 1)/2)], {n, 0, 39}] (* Alonso del Arte, Mar 18 2013 *)
  • Python
    import math
    for n in range(99):
        print(str(int(math.ceil(math.e**((n-1)*0.5)))), end=', ')
    # Alex Ratushnyak, Mar 18 2013

Formula

Limit_{n->oo} a(n+1)/a(n) = sqrt(e) = 1.64872127... = A019774. - Alois P. Heinz, Feb 19 2019

Extensions

A few more terms from Alonso del Arte, Mar 18 2013

A001856 A self-generating sequence: every positive integer occurs as a(i)-a(j) for a unique pair i,j.

Original entry on oeis.org

1, 2, 4, 8, 16, 21, 42, 51, 102, 112, 224, 235, 470, 486, 972, 990, 1980, 2002, 4004, 4027, 8054, 8078, 16156, 16181, 32362, 32389, 64778, 64806, 129612, 129641, 259282, 259313, 518626, 518658, 1037316, 1037349, 2074698, 2074734, 4149468
Offset: 1

Views

Author

Keywords

Comments

This is a B_2 sequence. More economical recursion: a(1)=1, a(2n)=2a(2n-1), a(2n+1)=a(2n)+r(n), where r(n) is the smallest positive integer not of the form a(j)-a(i) with 1<=iA247556. - Thomas Ordowski, Sep 28 2014

References

  • R. K. Guy, Unsolved Problems in Number Theory, E25.
  • W. Sierpiński, Elementary Theory of Numbers. Państ. Wydaw. Nauk., Warsaw, 1964, p. 444.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[2] = 2; a[n_?OddQ] := a[n] = 2*a[n-1]; a[n_?EvenQ] := a[n] = a[n-1] + r[(n-2)/2]; r[n_] := ( diff = Table[a[j] - a[i], {i, 1, 2*n+1}, {j, i+1, 2*n+1}] // Flatten // Union; max = diff // Last; notDiff = Complement[Range[max], diff]; If[notDiff == {}, max+1, notDiff // First]); Table[a[n], {n, 1, 39}] (* Jean-François Alcover, Dec 31 2012 *)

Formula

a(1)=1, a(2)=2, a(2n+1) = 2a(2n), a(2n+2) = a(2n+1) + r(n), where r(n) = smallest positive number not of form a(j) - a(i) with 1 <= i < j <= 2n+1.

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Sep 14 2000

A005348 Number of ways to add n ordinals.

Original entry on oeis.org

1, 2, 5, 13, 33, 81, 193, 449, 1089, 2673, 6561, 15633, 37249, 88209, 216513, 531441, 1266273, 3017169, 7189057, 17537553, 43046721, 102568113, 244390689, 582313617, 1420541793, 3486784401, 8308017153, 19795645809, 47167402977, 115063885233, 282429536481
Offset: 1

Views

Author

N. J. A. Sloane, R. K. Guy, Bill Sands and Tommy Kucera

Keywords

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 270-271.
  • W. Sierpiński, Cardinal and Ordinal Numbers, 2nd ed. p 275.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Programs

  • Magma
    I:=[1,2,5,13,33,81,193,449,1089,2673,6561,15633,37249, 88209,216513,531441,1266273,3017169,7189057,17537553, 43046721]; [n le 21 select I[n] else 81*Self(n-5): n in [1..50]]; // Vincenzo Librandi, Dec 17 2015
  • Mathematica
    Join[{1, 2, 5, 13, 33, 81, 193, 449, 1089, 2673, 6561, 15633, 37249, 88209}, LinearRecurrence[ {0, 0, 0, 0, 81}, {216513, 531441, 1266273, 3017169, 7189057}, 20]] (* Harvey P. Dale, Dec 15 2014 *)

Formula

a(n) = 81*a(n-5) for n >= 21.

A005675 Deficit in peeling rinds.

Original entry on oeis.org

1, 2, 8, 18, 55, 138, 470, 1164, 4055, 10140, 35609, 89782, 316513, 803040
Offset: 1

Views

Author

Keywords

References

  • R. K. Guy, Monthly unsolved problems 1969-1985, Amer. Math. Monthly, 92:10 (1985), 717-725. See p. 720.
  • Allen J. Schwenk, How many rinds can a finite sequence of pairs have?, pp. 713-739 of Y. Alavi et al., eds., Graph Theory, Combinatorics and Applications. Wiley, NY, 2 vols., 1991.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Previous Showing 21-28 of 28 results.