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

A347901 Decimal expansion of a constant related to the asymptotics of A005169.

Original entry on oeis.org

5, 7, 6, 1, 4, 8, 7, 6, 9, 1, 4, 2, 7, 5, 6, 6, 0, 2, 2, 9, 7, 8, 6, 8, 5, 7, 3, 7, 1, 9, 9, 3, 8, 7, 8, 2, 3, 5, 4, 7, 2, 4, 6, 6, 3, 1, 1, 8, 9, 7, 4, 4, 6, 8, 6, 8, 5, 1, 5, 6, 5, 3, 4, 3, 1, 9, 4, 6, 8, 2, 2, 9, 3, 7, 4, 9, 9, 2, 4, 0, 2, 0, 0, 3, 9, 0, 7, 4, 2, 2, 0, 9, 9, 3, 2, 9, 5, 5, 0, 8, 5, 0, 0, 9, 6, 6
Offset: 0

Views

Author

Vaclav Kotesovec, Sep 18 2021

Keywords

Examples

			0.576148769142756602297868573719938782354724663118974468685156534319...
		

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, p. 381.

Crossrefs

Programs

  • Mathematica
    FindRoot[Sum[(-1)^k*r^(k^2)/QPochhammer[r, r, k], {k, 0, 1000}] == 0, {r, 1/2}, WorkingPrecision -> 120]

Formula

Lowest root of the equation Sum_{k>=0} (-1)^k * r^(k^2) / QPochhammer(r, r, k) = 0.

A226999 Inverse Euler transform of A005169 (fountains of coins).

Original entry on oeis.org

1, 0, 1, 1, 2, 3, 5, 8, 13, 21, 35, 55, 93, 149, 248, 403, 671, 1098, 1827, 3013, 5013, 8313, 13859, 23063, 38534, 64341, 107715, 180355, 302565, 507784, 853507, 1435415, 2416941, 4072272, 6868062, 11590807, 19577555, 33088481, 55964327, 94712212
Offset: 1

Views

Author

R. J. Mathar, Jun 26 2013

Keywords

Comments

If G005169(x) = Sum_{i>=0} A005169(n)*x^n is the generating function of A005169, the a(n) are defined through G005169(x) = Product_{n>=1} 1/(1-x^n)^a(n), the inverse Euler transform of A005169.

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, p. 381.

Crossrefs

Programs

  • Mathematica
    max = 100;
    A005169 = Series[1 - Fold[Function[1 - x^#2/#1], 1, Range[max, 0, -1]], {x, 0, max}] // CoefficientList[#, x]&;
    mob[m_, n_] := If[Mod[m, n] == 0, MoebiusMu[m/n], 0];
    EULERi[b_] := Module[{a, c, i, d}, c = {}; For[i = 1, i <= Length[b], i++, c = Append[c, i*b[[i]] - Sum[c[[d]]*b[[i - d]], {d, 1, i - 1}]]]; a = {}; For[i = 1, i <= Length[b], i++, a = Append[a, (1/i)*Sum[mob[i, d]*c[[d]], {d, 1, i}]]]; Return[a]];
    EULERi[A005169 // Rest] (* Jean-François Alcover, Jan 06 2020 *)

Formula

a(n) ~ 1 / (n * r^n), where r = A347901 = 0.57614876914275660229786857371993878235472466311897446868515653431946822937499... - Vaclav Kotesovec, Oct 09 2019

A289080 a(0) = 1 and a(n) = A005169(n) - A005169(n-1).

Original entry on oeis.org

1, 0, 0, 1, 1, 2, 4, 6, 11, 19, 33, 57, 99, 172, 298, 518, 898, 1559, 2706, 4696, 8151, 14147, 24554, 42617, 73969, 128384, 222831, 386759, 671282, 1165118, 2022251, 3509944, 6092077, 10573790, 18352530, 31853801, 55287454, 95960372, 166554844, 289083043
Offset: 0

Views

Author

Seiichi Manyama, Sep 02 2017

Keywords

Crossrefs

Column 2 of A288267 (except a(0)).
Cf. A005169.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1,
          add(b(n-j, j), j=1..min(i+1, n)))
        end:
    a:= n-> b(n, 0) -b(n-1, 0):
    seq(a(n), n=0..50);  # Alois P. Heinz, Sep 02 2017
  • Mathematica
    b[n_, i_] := b[n, i] = If[n==0, 1, Sum[b[n-j, j], {j, 1, Min[i+1, n]}]];
    a[n_] := b[n, 0] - b[n-1, 0];
    a /@ Range[0, 50] (* Jean-François Alcover, Nov 14 2020, after Alois P. Heinz *)

Formula

G.f.: (1-x)/(1-x/(1-x^2/(1-x^3/(1-x^4/(1-x^5/(...)))))).

A167749 Riordan array (1,xf(x)) where f(x) is the g.f. of A005169 (fountains of coins).

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 2, 3, 3, 1, 0, 3, 6, 6, 4, 1, 0, 5, 11, 13, 10, 5, 1, 0, 9, 20, 27, 24, 15, 6, 1, 0, 15, 38, 54, 55, 40, 21, 7, 1, 0, 26, 70, 109, 120, 100, 62, 28, 8, 1, 0, 45, 129, 216, 258, 236, 168, 91, 36, 9, 1, 0, 78, 238, 423, 544, 540, 426, 266, 128, 45, 10, 1
Offset: 0

Views

Author

Paul Barry, Nov 10 2009

Keywords

Comments

Row sums are A167750. Diagonal sums are A167751.

Examples

			Triangle begins
1,
0, 1,
0, 1, 1,
0, 1, 2, 1,
0, 2, 3, 3, 1,
0, 3, 6, 6, 4, 1,
0, 5, 11, 13, 10, 5, 1,
0, 9, 20, 27, 24, 15, 6, 1,
0, 15, 38, 54, 55, 40, 21, 7, 1,
0, 26, 70, 109, 120, 100, 62, 28, 8, 1,
0, 45, 129, 216, 258, 236, 168, 91, 36, 9, 1,
0, 78, 238, 423, 544, 540, 426, 266, 128, 45, 10, 1,
0, 135, 437, 824, 1127, 1205, 1035, 721, 402, 174, 55, 11, 1
		

Formula

G.f.: 1/(1-xy/(1-x/(1-x^2/(1-x^3/(1-x^4/(1-... (continued fraction).

A305840 Product_{n>=1} (1 + x^n)^a(n) = g.f. of A005169 (fountains of coins).

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 5, 10, 13, 23, 35, 59, 93, 154, 248, 413, 671, 1111, 1827, 3036, 5013, 8348, 13859, 23122, 38534, 64434, 107715, 180509, 302565, 508032, 853507, 1435828, 2416941, 4072943, 6868062, 11591918, 19577555, 33090308, 55964327, 94715248, 160391045
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 11 2018

Keywords

Comments

Inverse weigh transform of A005169.

Examples

			(1 + x) * (1 + x^2) * (1 + x^3) * (1 + x^4)^2 * (1 + x^5)^2 * ... * (1 + x^n)^a(n) * ... = 1/(1 - x/(1 - x^2/(1 - x^3/(1 - x^4/(1 - x^5/(1 - ...)))))).
		

Crossrefs

Programs

  • Mathematica
    nn = 39; f[x_] := Product[(1 + x^n)^a[n], {n, 1, nn}]; sol = SolveAlways[0 == Series[f[x] - 1/(1 + ContinuedFractionK[-x^k, 1, {k, 1, nn}]), {x, 0, nn}], x]; Table[a[n], {n, 1, nn}] /. sol // Flatten

Formula

Product_{n>=1} (1 + x^n)^a(n) = 1/(1 - x/(1 - x^2/(1 - x^3/(1 - x^4/(1 - x^5/(1 - ...)))))).
a(n) ~ 1 / (n * A347901^n). - Vaclav Kotesovec, Sep 18 2021

A227620 Logarithmic derivative of A005169, the number of fountains of n coins.

Original entry on oeis.org

1, 1, 4, 5, 11, 22, 36, 69, 121, 221, 386, 686, 1210, 2122, 3734, 6517, 11408, 19903, 34714, 60485, 105312, 183272, 318758, 554262, 963361, 1674076, 2908426, 5052066, 8774386, 15237482, 26458718, 45939797, 79759442, 138468656, 240382216, 417289619, 724369536, 1257396992
Offset: 1

Views

Author

Paul D. Hanna, Jul 17 2013

Keywords

Examples

			L.g.f.: L(x) = x + x^2/2 + 4*x^3/3 + 5*x^4/4 + 11*x^5/5 + 22*x^6/6 +...
such L(x) = log(P(x)) - log(Q(x)) where
P(x) = 1 - x^2 - x^3 - x^4 - x^5 + x^8 + x^9 + 2*x^10 + 2*x^11 + 2*x^12 + 2*x^13 + 2*x^14 + x^15 + x^16 - x^18 +...+ A224898(n)*x^n +...
Q(x) = 1 - x - x^2 - x^3 + x^6 + x^7 + 2*x^8 + x^9 + 2*x^10 + x^11 + x^12 - 2*x^15 - x^16 - 3*x^17 - 3*x^18 +...+ A039924(n)*x^n +...
log(P(x)) = -2*x^2/2 - 3*x^3/3 - 6*x^4/4 - 10*x^5/5 - 11*x^6/6 - 21*x^7/7 - 22*x^8/8 - 39*x^9/9 - 42*x^10/10 +...
log(Q(x)) = -x - 3*x^2/2 - 7*x^3/3 - 11*x^4/4 - 21*x^5/5 - 33*x^6/6 - 57*x^7/7 - 91*x^8/8 - 160*x^9/9 - 263*x^10/10 +...
		

Crossrefs

Programs

  • PARI
    /* As the log of a continued fraction: */
    {a(n)=local(A=x, CF=1+x); for(k=0, n, CF=1/(1-x^(n-k+1)*CF+x*O(x^n)); A=log(CF)); n*polcoeff(A, n)}
    for(n=1,40,print1(a(n),", "))
    
  • PARI
    /* By the Rogers-Ramanujan continued fraction identity: */
    {a(n)=local(A=x, P=1+x, Q=1);
    P=sum(m=0, sqrtint(n), (-1)^m*x^(m*(m+1))/prod(k=1, m, 1-x^k));
    Q=sum(m=0, sqrtint(n), (-1)^m*x^(m^2)/prod(k=1, m, 1-x^k));
    A=log(P/(Q+x*O(x^n))); n*polcoeff(A, n)}
    for(n=1,40,print1(a(n),", "))

Formula

L.g.f.: log( 1/(1-x/(1-x^2/(1-x^3/(1-x^4/(1-x^5/(1-...)))))) ), the logarithm of a continued fraction.
L.g.f.: log( P(x) / Q(x) ) where
P(x) = Sum_{n>=0} (-1)^n* x^(n*(n+1)) / Product_{k=1..n} (1-x^k),
Q(x) = Sum_{n>=0} (-1)^n* x^(n^2) / Product_{k=1..n} (1-x^k),
due to the Rogers-Ramanujan continued fraction identity.

A005185 Hofstadter Q-sequence: a(1) = a(2) = 1; a(n) = a(n-a(n-1)) + a(n-a(n-2)) for n > 2.

Original entry on oeis.org

1, 1, 2, 3, 3, 4, 5, 5, 6, 6, 6, 8, 8, 8, 10, 9, 10, 11, 11, 12, 12, 12, 12, 16, 14, 14, 16, 16, 16, 16, 20, 17, 17, 20, 21, 19, 20, 22, 21, 22, 23, 23, 24, 24, 24, 24, 24, 32, 24, 25, 30, 28, 26, 30, 30, 28, 32, 30, 32, 32, 32, 32, 40, 33, 31, 38, 35, 33, 39, 40, 37, 38, 40, 39
Offset: 1

Views

Author

Simon Plouffe and N. J. A. Sloane, May 20 1991

Keywords

Comments

Rate of growth is not known. In fact it is not even known if this sequence is defined for all positive n.
Roman Pearce, Aug 29 2014, has computed that a(n) exists for n <= 10^10. - N. J. A. Sloane
a(n) exists for n <= 3*10^10. - M. Eric Carr, Jul 02 2023

Examples

			a(18) = 11 because a(17) is 10 and a(16) is 9, so we take a(18 - 10) + a(18 - 9) = a(8) + a(9) = 5 + 6 = 11.
		

References

  • B. W. Conolly, "Meta-Fibonacci sequences," in S. Vajda, editor, Fibonacci and Lucas Numbers and the Golden Section. Halstead Press, NY, 1989, pp. 127-138.
  • R. K. Guy, Unsolved Problems in Number Theory, Sect. E31.
  • D. R. Hofstadter, Goedel, Escher, Bach: an Eternal Golden Braid, Random House, 1980, p. 138.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • S. Vajda, Fibonacci and Lucas Numbers and the Golden Section, Wiley, 1989, see p. 129.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.

Crossrefs

Cf. A081827 (first differences).
Cf. A226244, A226245 (record values and where they occur).
See A244477 for a different start.

Programs

  • C
    #include 
    #define LIM 20
    int Qa[LIM];
    int Q(int n){if (n==1 || n==2){return 1;} else{return Qa[n-Qa[n-1]]+Qa[n-Qa[n-2]];}}
    int main(){int i;printf("n\tQ\n");for(i=1; iGonzalo Ciruelos, Aug 01 2013
    
  • Haskell
    a005185 n = a005185_list !! (n-1)
    a005185_list = 1 : 1 : zipWith (+)
       (map a005185 $ zipWith (-) [3..] a005185_list)
       (map a005185 $ zipWith (-) [3..] $ tail a005185_list)
    -- Reinhard Zumkeller, Jun 02 2013, Sep 15 2011
    
  • Magma
    I:=[1,1]; [n le 2 select I[n] else Self(n-Self(n-1))+Self(n-Self(n-2)): n in [1..90]]; // Vincenzo Librandi, Aug 08 2014
    
  • Maple
    A005185 := proc(n) option remember;
        if n<=2 then 1
        elif n > procname(n-1) and n > procname(n-2) then
            RETURN(procname(n-procname(n-1))+procname(n-procname(n-2)));
        else
            ERROR(" died at n= ", n);
        fi; end proc;
    # More generally, the following defines the Hofstadter-Huber sequence Q(r,s) - N. J. A. Sloane, Apr 15 2014
    r:=1; s:=2;
    a:=proc(n) option remember; global r,s;
    if n <= s then  1
    else
        if (a(n-r) <= n) and (a(n-s) <= n) then
        a(n-a(n-r))+a(n-a(n-s));
        else lprint("died with n =",n); return (-1);
        fi; fi; end;
    [seq(a(n), n=1..100)];
  • Mathematica
    a[1]=a[2]=1; a[n_]:= a[n]= a[n -a[n-1]] + a[n -a[n-2]]; Table[ a[n], {n,70}]
  • MuPAD
    q:=proc(n) option remember; begin if n<=2 then 1 else q(n-q(n-1))+q(n-q(n-2)) end_if; end_proc: q(i)$i=1..100; // Zerinvary Lajos, Apr 03 2007
    
  • PARI
    {a(n)= local(A); if(n<1, 0, A=vector(n,k,1); for(k=3, n, A[k]= A[k-A[k-1]]+ A[k-A[k-2]]); A[n])} /* Michael Somos, Jul 16 2007 */
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def a(n):
        if n < 3: return 1
        return a(n - a(n-1)) + a(n - a(n-2))
    print([a(n) for n in range(1, 75)]) # Michael S. Branicky, Jul 26 2021
  • Sage
    @CachedFunction
    def a(n):
        if (n<3): return 1
        else: return a(n -a(n-1)) + a(n -a(n-2))
    [a(n) for n in (1..70)] # G. C. Greubel, Feb 13 2020
    
  • Scheme
    (define q (lambda (n) (cond ( (eqv? n 0) 1) ( (eqv? n 1) 1) ( #t (+ (q (- n (q (- n 1)))) (q (- n (q (- n 2)))))))))
    
  • Scheme
    ;; An implementation of memoization-macro definec can be found for example in: http://oeis.org/wiki/Memoization
    (definec (A005185 n) (if (<= n 2) 1 (+ (A005185 (- n (A005185 (- n 1)))) (A005185 (- n (A005185 (- n 2)))))))
    ;; Antti Karttunen, Mar 22 2017
    

A004001 Hofstadter-Conway $10000 sequence: a(n) = a(a(n-1)) + a(n-a(n-1)) with a(1) = a(2) = 1.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 4, 4, 5, 6, 7, 7, 8, 8, 8, 8, 9, 10, 11, 12, 12, 13, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 24, 25, 26, 26, 27, 27, 27, 28, 29, 29, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42
Offset: 1

Views

Author

Keywords

Comments

On Jul 15 1988 during a colloquium talk at Bell Labs, John Conway stated that he could prove that a(n)/n -> 1/2 as n approached infinity, but that the proof was extremely difficult. He therefore offered $100 to someone who could find an n_0 such that for all n >= n_0, we have |a(n)/n - 1/2| < 0.05, and he offered $10,000 for the least such n_0. I took notes (a scan of my notebook pages appears below), plus the talk - like all Bell Labs Colloquia at that time - was recorded on video. John said afterwards that he meant to say $1000, but in fact he said $10,000. I was in the front row. The prize was claimed by Colin Mallows, who agreed not to cash the check. - N. J. A. Sloane, Oct 21 2015
a(n) - a(n-1) = 0 or 1 (see the D. Newman reference). - Emeric Deutsch, Jun 06 2005
a(A188163(n)) = n and a(m) < n for m < A188163(n). - Reinhard Zumkeller, Jun 03 2011
From Daniel Forgues, Oct 04 2019: (Start)
Conjectures:
a(n) = n/2 iff n = 2^k, k >= 1.
a(n) = 2^(k-1): k times, for n = 2^k - (k-1) to 2^k, k >= 1. (End)

Examples

			If n=4, 2^4=16, a(16-i) = 2^(4-1) = 8 for 0 <= i <= 4-1 = 3, hence a(16)=a(15)=a(14)=a(13)=8.
		

References

  • J. Arkin, D. C. Arney, L. S. Dewald and W. E. Ebel, Jr., Families of recursive sequences, J. Rec. Math., 22 (No. 22, 1990), 85-94.
  • B. W. Conolly, Meta-Fibonacci sequences, in S. Vajda, editor, "Fibonacci and Lucas Numbers and the Golden Section", Halstead Press, NY, 1989, pp. 127-138.
  • R. K. Guy, Unsolved Problems Number Theory, Sect. E31.
  • D. R. Hofstadter, personal communication.
  • C. A. Pickover, Wonders of Numbers, "Cards, Frogs and Fractal sequences", Chapter 96, pp. 217-221, Oxford Univ. Press, NY, 2000.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • S. Vajda, Fibonacci and Lucas Numbers and the Golden Section, Wiley, 1989, see p. 129.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.

Crossrefs

Cf. A005229, A005185, A080677, A088359, A087686, A093879 (first differences), A265332, A266341, A055748 (a chaotic cousin), A188163 (greedy inverse).
Cf. A004074 (A249071), A005350, A005707, A093878. Different from A086841. Run lengths give A051135.
Cf. also permutations A267111-A267112 and arrays A265901, A265903.

Programs

  • Haskell
    a004001 n = a004001_list !! (n-1)
    a004001_list = 1 : 1 : h 3 1  {- memoization -}
      where h n x = x' : h (n + 1) x'
              where x' = a004001 x + a004001 (n - x)
    -- Reinhard Zumkeller, Jun 03 2011
    
  • Magma
    [n le 2 select 1 else Self(Self(n-1))+ Self(n-Self(n-1)):n in [1..75]]; // Marius A. Burtea, Aug 16 2019
    
  • Maple
    A004001 := proc(n) option remember; if n<=2 then 1 else procname(procname(n-1)) +procname(n-procname(n-1)); fi; end;
  • Mathematica
    a[1] = 1; a[2] = 1; a[n_] := a[n] = a[a[n - 1]] + a[n - a[n - 1]]; Table[ a[n], {n, 1, 75}] (* Robert G. Wilson v *)
  • PARI
    a=vector(100);a[1]=a[2]=1;for(n=3,#a,a[n]=a[a[n-1]]+a[n-a[n-1]]);a \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    first(n)=my(v=vector(n)); v[1]=v[2]=1; for(k=3, n, v[k]=v[v[k-1]]+v[k-v[k-1]]); v \\ Charles R Greathouse IV, Feb 26 2017
    
  • Python
    def a004001(n):
        A = {1: 1, 2: 1}
        c = 1 #counter
        while n not in A.keys():
            if c not in A.keys():
                A[c] = A[A[c-1]] + A[c-A[c-1]]
            c += 1
        return A[n]
    # Edward Minnix III, Nov 02 2015
    
  • SageMath
    @CachedFunction
    def a(n): # a = A004001
        if n<3: return 1
        else: return a(a(n-1)) + a(n-a(n-1))
    [a(n) for n in range(1,101)] # G. C. Greubel, Apr 25 2024
  • Scheme
    ;; An implementation of memoization-macro definec can be found for example from: http://oeis.org/wiki/Memoization
    (definec (A004001 n) (if (<= n 2) 1 (+ (A004001 (A004001 (- n 1))) (A004001 (- n (A004001 (- n 1)))))))
    ;; Antti Karttunen, Oct 22 2014
    

Formula

Limit_{n->infinity} a(n)/n = 1/2 and as special cases, if n > 0, a(2^n-i) = 2^(n-1) for 0 <= i < = n-1; a(2^n+1) = 2^(n-1) + 1. - Benoit Cloitre, Aug 04 2002 [Corrected by Altug Alkan, Apr 03 2017]

A003114 Number of partitions of n into parts 5k+1 or 5k+4.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 9, 10, 12, 14, 17, 19, 23, 26, 31, 35, 41, 46, 54, 61, 70, 79, 91, 102, 117, 131, 149, 167, 189, 211, 239, 266, 299, 333, 374, 415, 465, 515, 575, 637, 709, 783, 871, 961, 1065, 1174, 1299, 1429, 1579, 1735, 1913, 2100, 2311, 2533, 2785
Offset: 0

Views

Author

Keywords

Comments

Expansion of Rogers-Ramanujan function G(x) in powers of x.
Same as number of partitions into distinct parts where the difference between successive parts is >= 2.
As a formal power series, the limit of polynomials S(n,x): S(n,x)=sum(T(i,x),0<=i<=n); T(i,x)=S(i-2,x).x^i; T(0,x)=1,T(1,x)=x; S(n,1)=A000045(n+1), the Fibonacci sequence. - Claude Lenormand (claude.lenormand(AT)free.fr), Feb 04 2001
The Rogers-Ramanujan identity is 1 + Sum_{n >= 1} t^(n^2)/((1-t)*(1-t^2)*...*(1-t^n)) = Product_{n >= 1} 1/((1-t^(5*n-1))*(1-t^(5*n-4))).
Coefficients in expansion of permanent of infinite tridiagonal matrix:
1 1 0 0 0 0 0 0 ...
x 1 1 0 0 0 0 0 ...
0 x^2 1 1 0 0 0 ...
0 0 x^3 1 1 0 0 ...
0 0 0 x^4 1 1 0 ...
................... - Vladeta Jovovic, Jul 17 2004
Also number of partitions of n such that the smallest part is greater than or equal to number of parts. - Vladeta Jovovic, Jul 17 2004
Also number of partitions of n such that if k is the largest part, then each of {1, 2, ..., k-1} occur at least twice. Example: a(9)=5 because we have [3, 2, 2, 1, 1], [2, 2, 2, 1, 1, 1], [2, 2, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1] and [1, 1, 1, 1, 1, 1, 1, 1, 1]. - Emeric Deutsch, Feb 27 2006
Also number of partitions of n such that if k is the largest part, then k occurs at least k times. Example: a(9)=5 because we have [3, 3, 3], [2, 2, 2, 2, 1], [2, 2, 2, 1, 1, 1], [2, 2, 1, 1, 1, 1, 1] and [1, 1, 1, 1, 1, 1, 1, 1, 1]. - Emeric Deutsch, Apr 16 2006
a(n) = number of NW partitions of n, for n >= 1; see A237981.
For more about the generalized Rogers-Ramanujan series G[i](x) see the Andrews-Baxter and Lepowsky-Zhu papers. The present series is G[1](x). - N. J. A. Sloane, Nov 22 2015
Convolution of A109700 and A109697. - Vaclav Kotesovec, Jan 21 2017

Examples

			G.f. = 1 + x + x^2 + x^3 + 2*x^4 + 2*x^5 + 3*x^6 + 3*x^7 + 4*x^8 + 5*x^9 + ...
G.f. = 1/q + q^59 + q^119 + q^179 + 2*q^239 + 2*q^299 + 3*q^359 + 3*q^419 + ...
From _Joerg Arndt_, Dec 27 2012: (Start)
The a(16)=17 partitions of 16 where all parts are 1 or 4 (mod 5) are
  [ 1]  [ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ]
  [ 2]  [ 4 1 1 1 1 1 1 1 1 1 1 1 1 ]
  [ 3]  [ 4 4 1 1 1 1 1 1 1 1 ]
  [ 4]  [ 4 4 4 1 1 1 1 ]
  [ 5]  [ 4 4 4 4 ]
  [ 6]  [ 6 1 1 1 1 1 1 1 1 1 1 ]
  [ 7]  [ 6 4 1 1 1 1 1 1 ]
  [ 8]  [ 6 4 4 1 1 ]
  [ 9]  [ 6 6 1 1 1 1 ]
  [10]  [ 6 6 4 ]
  [11]  [ 9 1 1 1 1 1 1 1 ]
  [12]  [ 9 4 1 1 1 ]
  [13]  [ 9 6 1 ]
  [14]  [ 11 1 1 1 1 1 ]
  [15]  [ 11 4 1 ]
  [16]  [ 14 1 1 ]
  [17]  [ 16 ]
The a(16)=17 partitions of 16 where successive parts differ by at least 2 are
  [ 1]  [ 7 5 3 1 ]
  [ 2]  [ 8 5 3 ]
  [ 3]  [ 8 6 2 ]
  [ 4]  [ 9 5 2 ]
  [ 5]  [ 9 6 1 ]
  [ 6]  [ 9 7 ]
  [ 7]  [ 10 4 2 ]
  [ 8]  [ 10 5 1 ]
  [ 9]  [ 10 6 ]
  [10]  [ 11 4 1 ]
  [11]  [ 11 5 ]
  [12]  [ 12 3 1 ]
  [13]  [ 12 4 ]
  [14]  [ 13 3 ]
  [15]  [ 14 2 ]
  [16]  [ 15 1 ]
  [17]  [ 16 ]
(End)
		

References

  • G. E. Andrews, The Theory of Partitions, Addison-Wesley, 1976, p. 109, 238.
  • G. E. Andrews, R. Askey and R. Roy, Special Functions, Cambridge University Press, 1999; Exercise 6(e), p. 591.
  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 669.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 107.
  • G. H. Hardy, Ramanujan, AMS Chelsea Publ., Providence, RI, 2002, pp. 90-92.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Fifth ed., Clarendon Press, Oxford, 2003, pp. 290-291.
  • H. P. Robinson, Letter to N. J. A. Sloane, Jan 04 1974.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A188216 (least part k occurs at least k times).
For the generalized Rogers-Ramanujan series G[1], G[2], G[3], G[4], G[5], G[6], G[7], G[8] see A003114, A003106, A006141, A264591, A264592, A264593, A264594, A264595. G[0] = G[1]+G[2] is given by A003113.
Row sums of A268187.

Programs

  • Haskell
    a003114 = p a047209_list where
       p _      0 = 1
       p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Jan 05 2011
    
  • Haskell
    a003114 = p 1 where
       p _ 0 = 1
       p k m = if k > m then 0 else p (k + 2) (m - k) + p (k + 1) m
    -- Reinhard Zumkeller, Feb 19 2013
  • Maple
    g:=sum(x^(k^2)/product(1-x^j,j=1..k),k=0..10): gser:=series(g,x=0,65): seq(coeff(gser,x,n),n=0..60); # Emeric Deutsch, Feb 27 2006
  • Mathematica
    CoefficientList[ Series[Sum[x^k^2/Product[1 - x^j, {j, 1, k}], {k, 0, 10}], {x, 0, 65}], x][[1 ;; 61]] (* Jean-François Alcover, Apr 08 2011, after Emeric Deutsch *)
    Table[Count[IntegerPartitions[n], p_ /; Min[p] >= Length[p]], {n, 0, 24}] (* Clark Kimberling, Feb 13 2014 *)
    a[ n_] := SeriesCoefficient[ 1 / (QPochhammer[ x^1, x^5] QPochhammer[ x^4, x^5]), {x, 0, n}]; (* Michael Somos, May 17 2015 *)
    a[ n_] := SeriesCoefficient[ Product[ (1 - x^k)^{-1, 0, 0, -1, 0}[[Mod[k, 5, 1]]], {k, n}], {x, 0, n}]; (* Michael Somos, May 17 2015 *)
    nmax = 60; kmax = nmax/5;
    s = Flatten[{Range[0, kmax]*5 + 1}~Join~{Range[0, kmax]*5 + 4}];
    Table[Count[IntegerPartitions@n, x_ /; SubsetQ[s, x]], {n, 0, nmax}] (* Robert Price, Aug 02 2020 *)
  • PARI
    {a(n) = my(t); if( n<0, 0, t = 1 + x * O(x^n); polcoeff( sum(k=1, sqrtint(n), t *= x^(2*k - 1) / (1 - x^k) * (1 + x * O(x^(n - k^2))), 1), n))}; /* Michael Somos, Oct 15 2008 */
    

Formula

G.f.: Sum_{k>=0} x^(k^2)/(Product_{i=1..k} 1-x^i).
The g.f. above is the special case D=2 of sum(n>=0, x^(D*n*(n+1)/2 - (D-1)*n) / prod(k=1..n, 1-x^k) ), the g.f. for partitions into distinct part where the difference between successive parts is >= D. - Joerg Arndt, Mar 31 2014
G.f.: 1 + sum(i=1, oo, x^(5i+1)/prod(j=1 or 4 mod 5 and j<=5i+1, 1-x^j) + x^(5i+4)/prod(j=1 or 4 mod 5 and j<=5i+4, 1-x^j)). - Jon Perry, Jul 06 2004
G.f.: (Product_{k>0} 1 + x^(2*k)) * (Sum_{k>=0} x^(k^2) / (Product_{i=1..k} 1 - x^(4*i))). - Michael Somos, Oct 19 2006
Euler transform of period 5 sequence [ 1, 0, 0, 1, 0, ...]. - Michael Somos, Oct 15 2008
Expansion of f(-x^5) / f(-x^1, -x^4) in powers of x where f(,) is the Ramanujan general theta function. - Michael Somos, May 17 2015
Expansion of f(-x^2, -x^3) / f(-x) in powers of x where f(,) is the Ramanujan general theta function. - Michael Somos, Jun 13 2015
a(n) ~ phi^(1/2) * exp(2*Pi*sqrt(n/15)) / (2 * 3^(1/4) * 5^(1/2) * n^(3/4)) * (1 - (3*sqrt(15)/(16*Pi) + Pi/(60*sqrt(15))) / sqrt(n)), where phi = A001622 = (1+sqrt(5))/2 is the golden ratio. - Vaclav Kotesovec, Aug 23 2015, extended Jan 24 2017
a(n) = (1/n)*Sum_{k=1..n} A284150(k)*a(n-k), a(0) = 1. - Seiichi Manyama, Mar 21 2017

A005165 Alternating factorials: n! - (n-1)! + (n-2)! - ... 1!.

Original entry on oeis.org

0, 1, 1, 5, 19, 101, 619, 4421, 35899, 326981, 3301819, 36614981, 442386619, 5784634181, 81393657019, 1226280710981, 19696509177019, 335990918918981, 6066382786809019, 115578717622022981, 2317323290554617019, 48773618881154822981
Offset: 0

Views

Author

Keywords

Comments

Conjecture: for n > 2, smallest prime divisor of a(n) > n. - Gerald McGarvey, Jun 19 2004
Rebuttal: This is not true; see Zivkovic link (Math. Comp. 68 (1999), pp. 403-409) has demonstrated that 3612703 divides a(n) for all n >= 3612702. - Paul Jobling, Oct 18 2004
Conjecture: For n>1, a(n) is the number of lattice paths from (0,0) to (n+1,0) that do not cross above y=x or below the x-axis using up-steps +(1,a) and down-steps +(1,-b) where a and b are positive integers. For example, a(3) = 5: [(1,1)(1,1)(1,1)(1,-3)], [(1,1)(1,-1)(1,3)(1,-3)], [(1,1)(1,-1)(1,2)(1,-2)], [(1,1)(1,-1)(1,1)(1,-1)] and [(1,1)(1,1)(1,-1)(1,-1)]. - Nicholas Ham, Aug 23 2015
Ham's claim is true for n=2. We proceed with a proof for n>2 by induction. On the j-th step, from (j-1,y) to (j,y'), there are j options for y': 0, 1, ..., y-1, y+1, ..., j. Thus there are n! possible paths from (0,0) to x=n that stay between y=0 and y=x. (Then the final step is determined.) However, because +(1,0) is not an allowable step, we cannot land on (n,0) on the n-th step. Therefore, the number of acceptable lattice paths is n! - a(n-1). - Danny Rorabaugh, Nov 30 2015

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section B10, pp. 152-153.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • GAP
    List([0..30],n->Sum([1..n],i->(-1)^(n-i)*Factorial(i))); # Muniru A Asiru, Jun 01 2018
  • Haskell
    a005165 n = a005165_list !! n
    a005165_list = 0 : zipWith (-) (tail a000142_list) a005165_list
    -- Reinhard Zumkeller, Jul 21 2013
    
  • Maple
    A005165 := proc(n) local i; add((-1)^(n-i)*i!,i=1..n); end;
  • Mathematica
    nn=25;With[{fctrls=Range[nn]!},Table[Abs[Total[Times@@@Partition[ Riffle[ Take[ fctrls,n],{1,-1}],2]]],{n,nn}]] (* Harvey P. Dale, Dec 10 2011 *)
    a[0] = 0; a[n_] := n! - a[n - 1]; Array[a, 26, 0] (* Robert G. Wilson v, Aug 06 2012 *)
    RecurrenceTable[{a[n] == n! - a[n - 1], a[0] == 0}, a, {n, 0, 20}] (* Eric W. Weisstein, Jul 27 2017 *)
    AlternatingFactorial[Range[0, 20]] (* Eric W. Weisstein, Jul 27 2017 *)
    a[n_] = (-1)^n (Exp[1]((-1)^n Gamma[-1-n,1] Gamma[2+n] - ExpIntegralEi[-1]) - 1)
    Table[a[n] // FullSimplify, {n, 0, 20}] (* Gerry Martens, May 22 2018 *)
  • PARI
    a(n)=if(n<0,0,sum(k=0,n-1,(-1)^k*(n-k)!))
    
  • PARI
    first(m)=vector(m,j,sum(i=0,j-1,((-1)^i)*(j-i)!)) \\ Anders Hellström, Aug 23 2015
    
  • PARI
    a(n)=round((-1)^n*(exp(1)*(gamma(n+2)*incgam(-1-n,1)*(-1)^n +eint1(1))-1)) \\ Gerry Martens, May 22 2018
    
  • Python
    a = 0
    f = 1
    for n in range(1, 33):
        print(a, end=",")
        f *= n
        a = f - a
    # Alex Ratushnyak, Aug 05 2012
    

Formula

a(0) = 0, a(n) = n! - a(n-1) for n > 0; also a(n) = n*a(n-2) + (n-1)*a(n-1) for n > 1. Sum_{n>=1} Pi^n/a(n) ~ 30.00005. - Gerald McGarvey, Jun 19 2004
E.g.f.: 1/(1-x) + exp(-x)*(e*(Ei(1,1)-Ei(1,1-x)) - 1). - Robert Israel, Dec 01 2015
a(n) = (-1)^n*(exp(1)*(gamma(n+2)*gamma(-1-n,1)*(-1)^n +Ei(1))-1). - Gerry Martens, May 22 2018
Sum_{n>=1} 1/a(n) = A343187. - Amiram Eldar, Jun 01 2023
Showing 1-10 of 79 results. Next