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

A096765 Number of partitions of n into distinct parts, the least being 1.

Original entry on oeis.org

0, 1, 0, 1, 1, 1, 2, 2, 3, 3, 5, 5, 7, 8, 10, 12, 15, 17, 21, 25, 29, 35, 41, 48, 56, 66, 76, 89, 103, 119, 137, 159, 181, 209, 239, 273, 312, 356, 404, 460, 522, 591, 669, 757, 853, 963, 1085, 1219, 1371, 1539, 1725, 1933, 2164, 2418, 2702, 3016, 3362, 3746, 4171, 4637
Offset: 0

Views

Author

N. J. A. Sloane, Sep 28 2008

Keywords

Comments

The old entry with this sequence number was a duplicate of A071569.
a(n) is also the total number of 1's in all partitions of n into distinct parts. For n=6 there are partitions [6], [5,1], [4,2], [3,2,1] and only two contain a 1, hence a(6) = 2. - T. Amdeberhan, May 13 2012
a(n), n > 1 is the Euler transform of [0,1,1] joined with period [0,1]. - Georg Fischer, Aug 15 2020

Examples

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

Crossrefs

Cf. A096749 (least=2), A022824 (3), A022825 (4), A022826 (5), A022827 (6), A022828 (7), A022829 (8), A022830 (9), A022831 (10).

Programs

  • Maple
    b:= proc(n, i) option remember;
          `if`(n=0, 1, `if`((i-1)*(i+2)/2 `if`(n<1, 0, b(n-1$2)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Feb 07 2014
    # Using the function EULER from Transforms (see link at the bottom of the page).
    [0,1,op(EULER([0,1,seq(irem(n,2),n=1..56)]))]; # Peter Luschny, Aug 19 2020
  • Mathematica
    p[, 0] = 1; p[k, n_] := p[k, n] = If[n < k, 0, p[k+1, n-k] + p[k+1, n]]; a[n_] := p[2, n-1]; Table[a[n], {n, 0, 59}] (* Jean-François Alcover, Apr 17 2014, after Reinhard Zumkeller *)
    a[ n_] := SeriesCoefficient[ x / ((1 + x) Product[ 1 - x^j, {j, 1, n, 2}]), {x, 0, n}]; (* Michael Somos, Sep 10 2016 *)
    a[ n_] := If[ n < 0, 0, SeriesCoefficient[  Sum[ x^(k (k + 1)/2) / Product[ 1 - x^j, {j, 1, k - 1}], {k, 1, Quotient[-1 + Sqrt[8 n + 1], 2]}], {x, 0, n}]]; (* Michael Somos, Sep 10 2016 *)
    Join[{0}, Table[Count[Last /@ Select[IntegerPartitions@n, DeleteDuplicates[#] == # &], 1], {n, 66}]] (* Robert Price, Jun 13 2020 *)
  • PARI
    {a(n) = if( n<1, 0, polcoeff( x / ((1 + x) * prod(k=1, (n+1)\2, 1 - x^(2*k-1), 1 + O(x^n))), n))}; /* Michael Somos, Sep 10 2016 */

Formula

a(n) = A025147(n-1), n>1. - R. J. Mathar, Jul 31 2008
G.f.: x*Product_{j=2..infinity} (1+x^j). - R. J. Mathar, Jul 31 2008
G.f.: x / ((1 + x) * Product_{k>0} (1 - x^(2*k-1))). - Michael Somos, Sep 10 2016
G.f.: Sum_{k>0} x^(k*(k+1)/2) / Product_{j=1..k-1} (1 - x^j). - Michael Somos, Sep 10 2016

A072376 a(n) = a(floor(n/2)) + a(floor(n/4)) + a(floor(n/8)) + ... starting with a(0)=0 and a(1)=1.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32
Offset: 0

Views

Author

Henry Bottomley, Jul 19 2002

Keywords

Crossrefs

Programs

  • Mathematica
    lim = 100; CoefficientList[Series[1/(2 - 2 x) (2 x - x^2 + Sum[ 2^(k - 1) x^2^k, {k, Floor@ Log2@ lim}]), {x, 0, lim}], x] (* Michael De Vlieger, Jan 26 2016 *)
  • PARI
    a(n)=if(n<2, return(n)); 2^logint(n\2,2) \\ Charles R Greathouse IV, Jan 26 2016
    
  • Python
    def A072376(n): return n if n < 2 else 1 << n.bit_length()-2 # Chai Wah Wu, Jun 30 2022

Formula

For n > 1: a(n) = msb(n)/2 = 2^floor(log_2(n)-1) = 2*a(floor(n/2)).
G.f.: 1/(2-2x) * (2x-x^2 + Sum_{k>=1} 2^(k-1)*x^2^k). - Ralf Stephan, Apr 18 2003

A025523 a(n) = 1 + Sum_{ k < n and k | n} a(k).

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 10, 14, 16, 19, 20, 28, 29, 32, 35, 43, 44, 52, 53, 61, 64, 67, 68, 88, 90, 93, 97, 105, 106, 119, 120, 136, 139, 142, 145, 171, 172, 175, 178, 198, 199, 212, 213, 221, 229, 232, 233, 281, 283, 291, 294, 302, 303, 323, 326, 346, 349, 352, 353, 397, 398, 401
Offset: 1

Views

Author

Keywords

Comments

Permanent of n X n (0,1) matrix defined by A(i,j)=1 iff j=1 or i divides j. - Vladeta Jovovic, Jul 05 2003
Partial sums of A074206, ordered factorizations. - Augustine O. Munagi, Jul 10 2007
The subsequence of primes begins: 2, 3, 5, 19, 29, 43, 53, 61, 67, 97, 139, 199, 229, 233, 281, 283, 349, 353, 397, 401. - Jonathan Vos Post

Crossrefs

A173382 is an essentially identical sequence.

Programs

  • Mathematica
    f[1] = 1; f[n_] := f[n] = DivisorSum[n, f[#] &, # < n &]; Accumulate[Array[f, 100]] (* Amiram Eldar, May 02 2025 *)
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A025523(n):
        if n == 0:
            return 1
        c, j = 2, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A025523(k1)
            j, k1 = j2, n//j2
        return n+c-j # Chai Wah Wu, Mar 30 2021

Formula

Running sum of A002033.
a(n) = 1 + Sum_{k = 2 to n} a([n/k]). - Mitchell Lee (worthawholephan(AT)gmail.com), Jul 26 2010
G.f. A(x) satisfies: A(x) = (1/(1 - x)) * (x + Sum_{k>=2} (1 - x^k) * A(x^k)). - Ilya Gutkovskiy, Aug 11 2021

A309288 a(0) = 0, a(1) = 1, and for any n > 1, a(n) = Sum_{k > 1} (-1)^k * a(floor(n/k)).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jul 21 2019

Keywords

Comments

This sequence is a signed variant of A022825.

Examples

			a(3) = a(floor(3/2)) - a(floor(3/3)) = a(1) - a(1) = 0.
		

Crossrefs

Cf. A022825.

Programs

  • Mathematica
    Join[{0}, Clear[a]; a[0]=0; a[1]=1; a[n_]:=a[n]=Sum[a[Floor[n/k]](-1)^k, {k, 2, n}]; Table[a[n], {n, 1, 100}]] (* Vincenzo Librandi, Jul 22 2019 *)
    f[p_, e_] := If[e == 1, -1, 0]; f[2, e_] := If[e == 1, 0, 2^(e-2)]; s[1] = 1; s[n_] := Times @@ f @@@ FactorInteger[n]; Join[{0}, Accumulate[Array[s, 100]]] (* Amiram Eldar, May 09 2023 *)
  • PARI
    a(n) = if (n<=1, n, sum (k=2, n, (-1)^k * a(n\k)))
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A309288(n):
        if n <= 1:
            return n
        c, j = 0, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += ((j2-j)%2)*(1-2*(j%2))*A309288(k1)
            j, k1 = j2, n//j2
        return c+((n+1-j)%2)*(1-2*(j%2)) # Chai Wah Wu, Mar 31 2021

Formula

G.f. A(x) satisfies -x * (1 - x) = Sum_{k>=1} (-1)^k * (1 - x^k) * A(x^k). - Seiichi Manyama, Mar 31 2023

A092149 Partial sums of A092673.

Original entry on oeis.org

1, -1, -2, -1, -2, 0, -1, -1, -1, 1, 0, -1, -2, 0, 1, 1, 0, 0, -1, -2, -1, 1, 0, 0, 0, 2, 2, 1, 0, -2, -3, -3, -2, 0, 1, 1, 0, 2, 3, 3, 2, 0, -1, -2, -2, 0, -1, -1, -1, -1, 0, -1, -2, -2, -1, -1, 0, 2, 1, 2, 1, 3, 3, 3, 4, 2, 1, 0, 1, -1, -2, -2, -3, -1, -1, -2, -1, -3, -4, -4, -4, -2, -3, -2, -1, 1, 2, 2, 1, 1, 2, 1, 2, 4, 5, 5, 4, 4, 4, 4, 3, 1, 0, 0, -1, 1
Offset: 1

Views

Author

Jon Perry, Mar 31 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Accumulate@ Array[MoebiusMu[#] - If[OddQ@ #, 0, MoebiusMu[#/2]] &, 106] (* Michael De Vlieger, Mar 31 2021 *)
  • PARI
    a(n)=my(s);forstep(k=bitor(n\4+1,1),n\2,2,s-=moebius(k));forstep(k=bitor(n\2+1,1),n,2,s+=moebius(k)); s \\ Charles R Greathouse IV, Feb 07 2013
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A092149(n):
        if n == 1:
            return 1
        c, j = n+1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A092149(k1)
            j, k1 = j2, n//j2
        return j-c # Chai Wah Wu, Mar 31 2021

Formula

G.f. Sum_{n >= 1} a(n)*(x^n)/((1-x^n)*(x^(n+1)-1))*x = -(x^2) and -1/x. [Mats Granvik, Oct 11 2010]
On the Riemann hypothesis, |a(n)| = O(n^(1/2+e)) for any e > 0. - Charles R Greathouse IV, Feb 07 2013
a(1)=1, then for n>=2, Sum_{k=1..n} a(floor(n/k)) = 0. - Benoit Cloitre, Feb 21 2013
G.f. A(x) satisfies x * (1 - x) = Sum_{k>=1} (1 - x^k) * A(x^k). - Seiichi Manyama, Mar 31 2023

A096749 Number of partitions of n into distinct parts, the least being 2.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 9, 10, 12, 15, 17, 20, 24, 28, 32, 38, 44, 51, 59, 68, 78, 91, 103, 118, 136, 155, 176, 201, 228, 259, 294, 332, 375, 425, 478, 538, 607, 681, 764, 858, 961, 1075, 1203, 1343, 1499, 1673, 1863, 2073, 2308, 2564, 2847, 3161, 3504
Offset: 0

Views

Author

N. J. A. Sloane, Sep 28 2008

Keywords

Comments

The old entry with this sequence number was a duplicate of A071569.
a(n), n>2 is the Euler transform of [0,0,1,1,1] joined with period [0,1]. - Georg Fischer, Aug 15 2020

Crossrefs

Cf. A096765 (least=1), A022824 (3), A022825 (4), A022826 (5), A022827 (6), A022828 (7), A022829 (8), A022830 (9), A022831 (10).

Programs

  • Maple
    b:= proc(n, i) option remember;
          `if`(n=0, 1, `if`((i-2)*(i+3)/2 `if`(n<2, 0, b(n-2$2)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Feb 07 2014
    # Using the function EULER from Transforms (see link at the bottom of the page).
    [0,0,1,op(EULER([0,0,1,1,seq(irem(n,2),n=1..57)]))]; # Peter Luschny, Aug 19 2020
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[(i-2)*(i+3)/2Jean-François Alcover, Oct 13 2014, after Alois P. Heinz *)
    Join[{0}, Table[Count[Last /@ Select[IntegerPartitions@n, DeleteDuplicates[#] == # &], 2], {n, 66}]] (* Robert Price, Jun 13 2020 *)

Formula

G.f.: x^2*Product_{j>=3} (1+x^j). - R. J. Mathar, Jul 31 2008
a(n) = A025148(n-2), n>1. - R. J. Mathar, Sep 30 2008
G.f.: Sum_{k>=1} x^(k*(k + 3)/2) / Product_{j=1..k-1} (1 - x^j). - Ilya Gutkovskiy, Nov 24 2020

A345182 a(1) = 1, a(2) = 0; a(n) = Sum_{d|n, d < n} a(d).

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 1, 2, 2, 2, 1, 5, 1, 2, 3, 4, 1, 6, 1, 5, 3, 2, 1, 12, 2, 2, 4, 5, 1, 10, 1, 8, 3, 2, 3, 18, 1, 2, 3, 12, 1, 10, 1, 5, 8, 2, 1, 28, 2, 6, 3, 5, 1, 16, 3, 12, 3, 2, 1, 31, 1, 2, 8, 16, 3, 10, 1, 5, 3, 10, 1, 50, 1, 2, 8, 5, 3, 10, 1, 28, 8, 2, 1, 31, 3, 2, 3, 12, 1, 36
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 10 2021

Keywords

Comments

From Antti Karttunen, Nov 25 2024: (Start)
a(n) is the number of strict chains of divisors from n to 1 that do not end with 2/1. For example, the a(n) such chains for n = 1, 2, 4, 6, 8, 12, 30 are:
1 (none) 4/1 6/1 8/1 12/1 30/1
6/3/1 8/4/1 12/3/1 30/3/1
12/4/1 30/5/1
12/6/1 30/6/1
12/6/3/1 30/10/1
30/15/1
30/6/3/1
30/10/5/1
30/15/3/1
30/15/5/1
leaving 1, 0, 1, 2, 2, 5, 10 chains out of the 1, 1, 2, 3, 4, 8, 13 chains depicted in the illustration of A074206.
Equally, a(n) is the number of strict chains of divisors from n to 1 where n is not followed by n/2 as the second divisor in the chain, which explains nicely the formula a(n) = A074206(n) - A074206(n/2) when n is even.
(End)

Crossrefs

Cf. A022825 (partial sums), A074206, A167865, A320224, A345138, A345141, A378218 (Dirichlet inverse), A378223 (inverse Möbius transform).

Programs

  • Mathematica
    a[1] = 1; a[2] = 0; a[n_] := a[n] = Sum[If[d < n, a[d], 0], {d, Divisors[n]}]; Table[a[n], {n, 1, 90}]
    nmax = 90; A[] = 0; Do[A[x] = x - x^2 + Sum[A[x^k], {k, 2, nmax}] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x] // Rest
  • PARI
    memoA345182 = Map();
    A345182(n) = if(n<=2, n%2, my(v); if(mapisdefined(memoA345182,n,&v), v, v = sumdiv(n,d,if(dA345182(d),0)); mapput(memoA345182,n,v); (v))); \\ Antti Karttunen, Nov 22 2024
    
  • PARI
    up_to = 20000;
    A345182list(up_to_n) = { my(v=vector(up_to_n)); v[1] = 1; v[2] = 0; for(n=3,up_to_n,v[n] = sumdiv(n,d,(dA345182list(up_to);
    A345182(n) = v345182[n]; \\ Antti Karttunen, Nov 25 2024

Formula

G.f. A(x) satisfies: A(x) = x - x^2 + A(x^2) + A(x^3) + A(x^4) + ...
a(n) = A074206(n) if n is odd, otherwise a(n) = A074206(n) - A074206(n/2).

A026824 Number of partitions of n into distinct parts, the least being 3.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 6, 6, 8, 9, 11, 12, 15, 17, 20, 23, 27, 31, 36, 41, 47, 55, 62, 71, 81, 93, 105, 120, 135, 154, 174, 197, 221, 251, 281, 317, 356, 400, 447, 502, 561, 628, 701, 782, 871, 972, 1081, 1202, 1336, 1483, 1645, 1825, 2021, 2237, 2476
Offset: 0

Views

Author

Keywords

Comments

Also, number of partitions of n such that if k is the largest part, then k occurs exactly 3 times and each of the numbers 1,2,...,k-1 occur at least once (these are the conjugates of the partitions described in the definition). Example: a(14)=3 because we have [3,3,3,2,2,1],[3,3,3,2,1,1,1] and [2,2,2,1,1,1,1,1,1,1,1]. - Emeric Deutsch, Apr 17 2006
For n > 3, a(n) is the Euler transform of [0,0,0,1,1,1,1] joined with the period 2 sequence [0,1, ...]. - Georg Fischer, Aug 18 2020

Examples

			a(14) = 3 because we have [11,3], [7,4,3] and [6,5,3].
		

Crossrefs

Cf. A096765 (least=1), A096749 (2), A022825 (4), A022826 (5), A022827 (6), A022828 (7), A022829 (8), A022830 (9), A022831 (10).

Programs

  • Maple
    g:=x^3*product(1+x^j,j=4..80): gser:=series(g,x=0,70): seq(coeff(gser,x,n),n=1..59); # Emeric Deutsch, Apr 17 2006
    # second Maple program:
    b:= proc(n, i) option remember;
          `if`(n=0, 1, `if`((i-3)*(i+4)/2 `if`(n<3, 0, b(n-3$2)):
    seq(a(n), n=0..60); # Alois P. Heinz, Feb 07 2014
  • Mathematica
    b[n_, i_] :=  b[n, i] = If[n == 0, 1, If[(i-3)(i+4)/2 < n, 0, Sum[b[n-i*j, i-1], {j, 0, Min[1, n/i]}]]]; a[n_] := If[n<3, 0, b[n-3, n-3]]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, May 13 2015, after Alois P. Heinz *)
    nmax = 100; CoefficientList[Series[x^3/((1+x)*(1+x^2)*(1+x^3)) * Product[1+x^k, {k, 1, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Oct 30 2015 *)
    Join[{0}, Table[Count[Last /@ Select[IntegerPartitions@n, DeleteDuplicates[#] == # &], 3], {n, 1, 66}]] (* Robert Price, Jun 13 2020 *)

Formula

From Emeric Deutsch, Apr 17 2006: (Start)
G.f.: (x^3)*Product_{j=4..infinity} (1+x^j).
G.f.: Sum_{k=1..infinity} x^(k*(k+5)/2)/(Product_{j=1..k-1} (1-x^j)). (End)
a(n) = A025149(n-3), n>3. - R. J. Mathar, Jul 31 2008
a(n) ~ exp(Pi*sqrt(n/3)) / (32*3^(1/4)*n^(3/4)). - Vaclav Kotesovec, Oct 30 2015

Extensions

More terms from Emeric Deutsch, Apr 17 2006

A309262 a(0) = 0, a(1) = 1, and for any n > 1, a(n) = Sum_{k > 1} a(floor(n/k^2)).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jul 19 2019

Keywords

Comments

For any n > 1 and k > A000196(n), a(floor(n/k^2)) = a(0) = 0, hence the series in the name is well defined.
This sequence is a variant of A022825; here we sum terms of the form a(floor(n/k^2)), there terms of the form a(floor(n/k)).

Examples

			a(5) = a(floor(5/2^2)) = a(1) = 1.
		

Crossrefs

Programs

  • Mathematica
    Join[{0}, Clear[a]; a[0]=0; a[1]=1; a[n_]:=a[n]=Sum[a[Floor[n/k^2]], {k, 2, n}]; Table[a[n], {n, 1, 100}]] (* Vincenzo Librandi, Jul 22 2019 *)
  • PARI
    a(n) = if (n<=1, n, sum (k=2, sqrtint(n), a(n\k^2)))

A351620 a(1) = 1; a(n) = a(n-1) + Sum_{k=2..n} a(floor(n/k)).

Original entry on oeis.org

1, 2, 4, 8, 13, 22, 32, 48, 67, 93, 120, 164, 209, 266, 331, 418, 506, 626, 747, 905, 1076, 1276, 1477, 1755, 2039, 2370, 2723, 3149, 3576, 4112, 4649, 5295, 5971, 6737, 7519, 8501, 9484, 10590, 11744, 13109, 14475, 16092, 17710, 19561, 21504, 23650, 25797, 28386, 30986, 33903
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 20 2022

Keywords

Comments

Partial sums of A320225.

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = a[n - 1] + Sum[a[Floor[n/k]], {k, 2, n}]; Table[a[n], {n, 1, 50}]

Formula

G.f. A(x) satisfies: A(x) = x/(1 - x) + (1/(1 - x)^2) * Sum_{k>=2} (1 - x^k) * A(x^k).
Showing 1-10 of 14 results. Next