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

A327482 Irregular triangle read by rows where T(n,k) is the number of integer partitions of n with mean d = A027750(n, k).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 5, 4, 1, 1, 7, 1, 1, 7, 5, 1, 1, 1, 1, 11, 15, 12, 6, 1, 1, 1, 1, 15, 7, 1, 1, 30, 19, 1, 1, 22, 34, 8, 1, 1, 1, 1, 30, 58, 27, 9, 1, 1, 1, 1, 42, 84, 64, 10, 1, 1, 105, 37, 1, 1, 56, 11, 1
Offset: 1

Views

Author

Gus Wiseman, Sep 13 2019

Keywords

Examples

			Triangle begins:
  1
  1  1
  1  1
  1  2  1
  1  1
  1  3  3  1
  1  1
  1  5  4  1
  1  7  1
  1  7  5  1
  1  1
  1 11 15 12  6  1
  1  1
  1 15  7  1
  1 30 19  1
  1 22 34  8  1
		

Crossrefs

Row sums are A067538.
The version for subsets is A327481.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],Mean[#]==d&]],{n,20},{d,Divisors[n]}]

Extensions

Name edited by Peter Munn, Mar 05 2025

A359894 Number of integer partitions of n whose parts do not have the same mean as median.

Original entry on oeis.org

0, 0, 0, 0, 1, 3, 3, 10, 13, 20, 28, 49, 53, 93, 113, 145, 203, 287, 329, 479, 556, 724, 955, 1242, 1432, 1889, 2370, 2863, 3502, 4549, 5237, 6825, 8108, 9839, 12188, 14374, 16958, 21617, 25852, 30582, 36100, 44561, 51462, 63238, 73386, 85990, 105272, 124729
Offset: 0

Views

Author

Gus Wiseman, Jan 20 2023

Keywords

Examples

			The a(4) = 1 through a(8) = 13 partitions:
  (211)  (221)   (411)    (322)     (332)
         (311)   (3111)   (331)     (422)
         (2111)  (21111)  (421)     (431)
                          (511)     (521)
                          (2221)    (611)
                          (3211)    (4211)
                          (4111)    (5111)
                          (22111)   (22211)
                          (31111)   (32111)
                          (211111)  (41111)
                                    (221111)
                                    (311111)
                                    (2111111)
		

Crossrefs

The complement is counted by A240219.
These partitions are ranked by A359890, complement A359889.
The odd-length case is ranked by A359892, complement A359891.
The odd-length case is A359896, complement A359895.
The strict case is A359898, complement A359897.
The odd-length strict case is A359900, complement A359899.
A000041 counts partitions, strict A000009.
A008284 and A058398 count partitions by mean, ranked by A326567/A326568.
A008289 counts strict partitions by mean.
A027193 counts odd-length partitions, strict A067659, ranked by A026424.
A067538 counts ptns with integer mean, strict A102627, ranked by A316413.
A237984 counts ptns containing their mean, strict A240850, ranked by A327473.
A325347 counts ptns with integer median, strict A359907, ranked by A359908.
A326622 counts factorizations with integer mean, strict A328966.
A359893 and A359901 count partitions by median, odd-length A359902.
A359909 counts factorizations with the same mean as median, odd-len A359910.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],Mean[#]!=Median[#]&]],{n,0,30}]

A327481 Triangle read by rows where T(n,k) is the number of nonempty subsets of {1..n} with mean k.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 3, 3, 1, 1, 3, 7, 3, 1, 1, 3, 9, 9, 3, 1, 1, 3, 9, 19, 9, 3, 1, 1, 3, 9, 25, 25, 9, 3, 1, 1, 3, 9, 29, 51, 29, 9, 3, 1, 1, 3, 9, 31, 75, 75, 31, 9, 3, 1, 1, 3, 9, 31, 93, 151, 93, 31, 9, 3, 1, 1, 3, 9, 31, 105, 235, 235, 105, 31, 9, 3, 1
Offset: 1

Views

Author

Gus Wiseman, Sep 13 2019

Keywords

Comments

All terms are odd.

Examples

			Triangle begins:
                         1
                       1   1
                     1   3   1
                   1   3   3   1
                 1   3   7   3   1
               1   3   9   9   3   1
             1   3   9  19   9   3   1
           1   3   9  25  25   9   3   1
         1   3   9  29  51  29   9   3   1
       1   3   9  31  75  75  31   9   3   1
     1   3   9  31  93 151  93  31   9   3   1
   1   3   9  31 105 235 235 105  31   9   3   1
The subsets counted in row n = 5:
  {1}  {2}      {3}          {4}      {5}
       {1,3}    {1,5}        {3,5}
       {1,2,3}  {2,4}        {3,4,5}
                {1,3,5}
                {2,3,4}
                {1,2,4,5}
                {1,2,3,4,5}
		

Crossrefs

Row sums are A051293.
The sequence of rows converges to A066571.
The version for partitions is A327482.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Mean[#]==k&]],{n,10},{k,n}]

A359897 Number of strict integer partitions of n whose parts have the same mean as median.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 4, 4, 4, 7, 6, 6, 10, 7, 10, 13, 11, 9, 20, 10, 20, 18, 21, 12, 30, 24, 28, 27, 30, 15, 73, 16, 37, 43, 45, 67, 74, 19, 55, 71, 126, 21, 150, 22, 75, 225, 78, 24, 183, 126, 245, 192, 132, 27, 284, 244, 403, 303, 120, 30, 828
Offset: 0

Views

Author

Gus Wiseman, Jan 20 2023

Keywords

Examples

			The a(1) = 1 through a(9) = 7 partitions:
  (1)  (2)  (3)    (4)    (5)    (6)      (7)    (8)    (9)
            (2,1)  (3,1)  (3,2)  (4,2)    (4,3)  (5,3)  (5,4)
                          (4,1)  (5,1)    (5,2)  (6,2)  (6,3)
                                 (3,2,1)  (6,1)  (7,1)  (7,2)
                                                        (8,1)
                                                        (4,3,2)
                                                        (5,3,1)
		

Crossrefs

The non-strict version is A240219, complement A359894, ranked by A359889.
The complement is counted by A359898.
The odd-length case is A359899, complement A359900.
A000041 counts partitions, strict A000009.
A008284/A058398/A327482 count partitions by mean, ranked by A326567/A326568.
A008289 counts strict partitions by mean.
A237984 counts partitions containing their mean, complement A327472.
A240850 counts strict partitions containing their mean, complement A240851.
A325347 counts ptns with integer median, strict A359907, ranked by A359908.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&Mean[#]==Median[#]&]],{n,0,30}]

A065795 Number of subsets of {1,2,...,n} that contain the average of their elements.

Original entry on oeis.org

1, 2, 4, 6, 10, 16, 26, 42, 72, 124, 218, 390, 706, 1292, 2388, 4436, 8292, 15578, 29376, 55592, 105532, 200858, 383220, 732756, 1403848, 2694404, 5179938, 9973430, 19229826, 37125562, 71762396, 138871260, 269021848, 521666984, 1012520400, 1966957692, 3824240848
Offset: 1

Views

Author

John W. Layman, Dec 05 2001

Keywords

Comments

Also the number of subsets of {1,2,...,n} with sum of entries divisible by the largest element (compare A000016). See the Palmer Melbane link for a bijection. - Joel B. Lewis, Nov 13 2014

Examples

			a(4)=6, since {1}, {2}, {3}, {4}, {1,2,3} and {2,3,4} contain their averages.
From _Gus Wiseman_, Sep 14 2019: (Start)
The a(1) = 1 through a(6) = 16 subsets:
  {1}  {1}  {1}      {1}      {1}          {1}
       {2}  {2}      {2}      {2}          {2}
            {3}      {3}      {3}          {3}
            {1,2,3}  {4}      {4}          {4}
                     {1,2,3}  {5}          {5}
                     {2,3,4}  {1,2,3}      {6}
                              {1,3,5}      {1,2,3}
                              {2,3,4}      {1,3,5}
                              {3,4,5}      {2,3,4}
                              {1,2,3,4,5}  {2,4,6}
                                           {3,4,5}
                                           {4,5,6}
                                           {1,2,3,6}
                                           {1,4,5,6}
                                           {1,2,3,4,5}
                                           {2,3,4,5,6}
(End)
		

Crossrefs

Subsets containing n whose mean is an element are A000016.
The version for integer partitions is A237984.
Subsets not containing their mean are A327471.

Programs

  • Mathematica
    Table[ Sum[a = Select[Divisors[i], OddQ[ # ] &]; Apply[ Plus, 2^(i/a) * EulerPhi[a]]/i, {i, n}]/2, {n, 34}]
    (* second program *)
    Table[Length[Select[Subsets[Range[n]],MemberQ[#,Mean[#]]&]],{n,0,10}] (* Gus Wiseman, Sep 14 2019 *)
  • PARI
    a(n) = (1/2)*sum(i=1, n, (1/i)*sumdiv(i, d, if (d%2, 2^(i/d)*eulerphi(d)))); \\ Michel Marcus, Dec 20 2020
    
  • Python
    from sympy import totient, divisors
    def A065795(n): return sum((sum(totient(d)<>(~k&k-1).bit_length(),generator=True))<<1)//k for k in range(1,n+1))>>1 # Chai Wah Wu, Feb 22 2023

Formula

a(n) = (1/2)*Sum_{i=1..n} (f(i) - 1) where f(i) = (1/i) * Sum_{d | i and d is odd} 2^(i/d) * phi(d).
a(n) = (n + A051293(n))/2.
a(n) = 2^n - A327471(n). - Gus Wiseman, Sep 14 2019

Extensions

Edited and extended by Robert G. Wilson v, Nov 15 2002

A359899 Number of strict odd-length integer partitions of n whose parts have the same mean as median.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 1, 4, 1, 1, 6, 1, 1, 6, 1, 5, 7, 1, 1, 8, 12, 1, 9, 2, 1, 33, 1, 1, 11, 1, 50, 12, 1, 1, 13, 70, 1, 46, 1, 1, 122, 1, 1, 16, 102, 155, 17, 1, 1, 30, 216, 258, 19, 1, 1, 310, 1, 1, 666, 1, 382, 23, 1, 1, 23, 1596, 1, 393, 1, 1
Offset: 0

Views

Author

Gus Wiseman, Jan 20 2023

Keywords

Examples

			The a(30) = 33 partitions:
  (30)  (11,10,9)  (8,7,6,5,4)
        (12,10,8)  (9,7,6,5,3)
        (13,10,7)  (9,8,6,4,3)
        (14,10,6)  (9,8,6,5,2)
        (15,10,5)  (10,7,6,4,3)
        (16,10,4)  (10,7,6,5,2)
        (17,10,3)  (10,8,6,4,2)
        (18,10,2)  (10,8,6,5,1)
        (19,10,1)  (10,9,6,3,2)
                   (10,9,6,4,1)
                   (11,7,6,4,2)
                   (11,7,6,5,1)
                   (11,8,6,3,2)
                   (11,8,6,4,1)
                   (11,9,6,3,1)
                   (12,7,6,3,2)
                   (12,7,6,4,1)
                   (12,8,6,3,1)
                   (12,9,6,2,1)
                   (13,7,6,3,1)
                   (13,8,6,2,1)
                   (14,7,6,2,1)
                   (11,10,6,2,1)
		

Crossrefs

Strict odd-length case of A240219, complement A359894, ranked by A359889.
Strict case of A359895, complement A359896, ranked by A359891.
Odd-length case of A359897, complement A359898.
The complement is counted by A359900.
A000041 counts partitions, strict A000009.
A008284/A058398/A327482 count partitions by mean, ranked by A326567/A326568.
A008289 counts strict partitions by mean.
A027193 counts odd-length partitions, strict A067659, ranked by A026424.
A067538 counts ptns with integer mean, strict A102627, ranked by A316413.
A237984 counts ptns containing their mean, strict A240850, ranked by A327473.
A325347 counts ptns with integer median, strict A359907, ranked by A359908.
A359893 and A359901 count partitions by median, odd-length A359902.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], UnsameQ@@#&&OddQ[Length[#]]&&Mean[#]==Median[#]&]],{n,0,30}]
  • PARI
    \\ Q(n,k,m) is g.f. for k strict parts of max size m.
    Q(n,k,m)={polcoef(prod(i=1, m, 1 + y*x^i + O(x*x^n)), k, y)}
    a(n)={if(n==0, 0, sumdiv(n, d, if(d%2, my(m=n/d, h=d\2, r=n-m*(h+1)); if(r>=h*(h+1), polcoef(Q(r, h, m-1)*Q(r, h, r), r)))))} \\ Andrew Howroyd, Jan 21 2023

Formula

a(p) = 1 for prime p. - Andrew Howroyd, Jan 21 2023

A359900 Number of strict odd-length integer partitions of n whose parts do not have the same mean as median.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 4, 5, 4, 8, 10, 8, 15, 18, 17, 26, 27, 31, 43, 51, 53, 59, 81, 87, 109, 127, 115, 169, 194, 213, 255, 243, 322, 379, 431, 478, 487, 629, 667, 804, 907, 902, 1151, 1294, 1439, 1530, 1674, 2031, 2290, 2559, 2829, 2973, 3296, 3939
Offset: 0

Views

Author

Gus Wiseman, Jan 21 2023

Keywords

Examples

			The a(7) = 1 through a(16) = 15 partitions (A=10, B=11, C=12, D=13):
  (421)  (431)  (621)  (532)  (542)  (651)  (643)  (653)  (762)  (754)
         (521)         (541)  (632)  (732)  (652)  (743)  (843)  (763)
                       (631)  (641)  (831)  (742)  (752)  (861)  (853)
                       (721)  (731)  (921)  (751)  (761)  (942)  (862)
                              (821)         (832)  (842)  (A32)  (871)
                                            (841)  (851)  (A41)  (943)
                                            (931)  (932)  (B31)  (952)
                                            (A21)  (941)  (C21)  (961)
                                                   (A31)         (A42)
                                                   (B21)         (A51)
                                                                 (B32)
                                                                 (B41)
                                                                 (C31)
                                                                 (D21)
                                                                 (64321)
		

Crossrefs

This is the strict case of A359896, complement A359895, ranked by A359892.
This is the odd-length case of A359898, complement A359897.
The complement is counted by A359899.
A000041 counts partitions, strict A000009.
A008284/A058398/A327482 count partitions by mean, ranked by A326567/A326568.
A008289 counts strict partitions by mean.
A027193 counts odd-length partitions, strict A067659, ranked by A026424.
A359893/A359901/A359902 count partitions by median, ranked by A360005.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], UnsameQ@@#&&OddQ[Length[#]]&&Mean[#]!=Median[#]&]],{n,0,30}]

A072701 Number of ways to write n as the arithmetic mean of a set of distinct primes.

Original entry on oeis.org

0, 1, 1, 2, 3, 4, 5, 10, 9, 18, 19, 40, 37, 80, 79, 188, 163, 385, 355, 855, 738, 1815, 1555, 3796, 3237, 8281, 6682, 17207, 13967, 35370, 28575, 74385, 58831, 153816, 119948, 312288, 244499, 643535, 495011, 1309267, 997381, 2629257, 2004295, 5334522
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 04 2002 and Jul 15 2002

Keywords

Comments

a(n) = #{ m | A072700(m)=n }.
a(n) < A066571(n).

Examples

			a(6) = 4, as 6 = (5+7)/2 = (2+3+13)/3 = (2+5+11)/3 = (2+3+5+7+13)/5;
a(7) = 5, as 7 = 7/1 = (3+11)/2 = (3+5+13)/3 = (3+7+11)/3 = (3+5+7+13)/4.
		

Crossrefs

Programs

  • Haskell
    a072701 n = f a000040_list 1 n 0 where
       f (p:ps) l nl x
         | y > nl    = 0
         | y < nl    = f ps (l + 1) (nl + n) y + f ps l nl x
         | otherwise = if y `mod` l == 0 then 1 else 0
         where y = x + p
    -- Reinhard Zumkeller, Feb 13 2013
  • Maple
    sp:= proc(i) option remember; `if`(i=1, 2, sp(i-1) +ithprime(i)) end: b:= proc(n,i,t) if n<0 then 0 elif n=0 then `if`(t=0, 1, 0) elif i=2 then `if`(n=2 and t=1, 1, 0) else b(n,i,t):= b(n, prevprime(i), t) +b(n-i, prevprime(i), t-1) fi end: a:= proc(n) local s, k; s:= `if`(isprime(n), 1, 0); for k from 2 while sp(k)/k<=n do s:= s +b(k*n, nextprime(k*n -sp(k-1)-1), k) od; s end: seq(a(n), n=1..28);  # Alois P. Heinz, Jul 20 2009
  • Mathematica
    Needs["DiscreteMath`Combinatorica`"]; a = Drop[ Sort[ Subsets[ Table[ Prime[i], {i, 1, 20}]]], 1]; b = {}; Do[c = Apply[Plus, a[[n]]]/Length[a[[n]]]; If[ IntegerQ[c], b = Append[b, c]], {n, 1, 2^20 - 1}]; b = Sort[b]; Table[ Count[b, n], {n, 1, 20}]
    t = Table[0, {200}]; k = 2; lst = Prime@Range@25; While[k < 2^25+1, slst = Flatten@Subsets[lst, All, {k}]; If[Mod[Plus @@ slst, Length@slst] == 0, t[[(Plus @@ slst)/(Length@slst)]]++ ]; k++ ]; t (* Robert G. Wilson v *)
    sp[i_] := sp[i] = If[i == 1, 2, sp[i - 1] + Prime[i]];
    b[n_, i_, t_] := b[n, i, t] = Which[n < 0, 0, n == 0, If[t == 0, 1, 0], i == 2, If[n == 2 && t == 1, 1, 0], True, b[n, NextPrime[i, -1], t] + b[n - i, NextPrime[i, -1], t - 1]];
    a[n_] := Module[{s, k}, s = If[PrimeQ[n], 1, 0]; For[k = 2, sp[k]/k <= n, k++, s = s + b[k*n, NextPrime[k*n - sp[k - 1] - 1], k]]; s];
    Table[a[n], {n, 1, 44}] (* Jean-François Alcover, Feb 13 2018, after Alois P. Heinz *)

Extensions

Corrected by John W. Layman, Jul 11 2002
More terms from Alois P. Heinz, Jul 20 2009

A359896 Number of odd-length integer partitions of n whose parts do not have the same mean as median.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 2, 6, 9, 11, 15, 27, 32, 50, 58, 72, 112, 149, 171, 246, 286, 359, 477, 630, 773, 941, 1181, 1418, 1749, 2289, 2668, 3429, 4162, 4878, 6074, 7091, 8590, 10834, 12891, 15180, 18491, 22314, 25845, 31657, 36394, 42269, 52547, 62414, 73576, 85701
Offset: 0

Views

Author

Gus Wiseman, Jan 20 2023

Keywords

Examples

			The a(4) = 1 through a(9) = 11 partitions:
  (211)  (221)  (411)    (322)    (332)      (441)
         (311)  (21111)  (331)    (422)      (522)
                         (421)    (431)      (621)
                         (511)    (521)      (711)
                         (22111)  (611)      (22221)
                         (31111)  (22211)    (32211)
                                  (32111)    (33111)
                                  (41111)    (42111)
                                  (2111111)  (51111)
                                             (2211111)
                                             (3111111)
		

Crossrefs

These partitions are ranked by A359892.
The any-length version is A359894, complement A240219, strict A359898.
The complement is counted by A359895, ranked by A359891.
The strict case is A359900, complement A359899.
A000041 counts partitions, strict A000009.
A008284/A058398/A327482 count partitions by mean, ranked by A326567/A326568.
A027193 counts odd-length partitions, strict A067659, ranked by A026424.
A067538 counts ptns with integer mean, strict A102627, ranked by A316413.
A237984 counts ptns containing their mean, strict A240850, ranked by A327473.
A325347 counts ptns with integer median, strict A359907, ranked by A359908.
A359893 and A359901 count partitions by median, odd-length A359902.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], OddQ[Length[#]]&&Mean[#]!=Median[#]&]],{n,0,30}]

A359898 Number of strict integer partitions of n whose parts do not have the same mean as median.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 4, 6, 5, 11, 12, 14, 21, 29, 26, 44, 44, 58, 68, 92, 92, 118, 137, 165, 192, 241, 223, 324, 353, 405, 467, 518, 594, 741, 809, 911, 987, 1239, 1276, 1588, 1741, 1823, 2226, 2566, 2727, 3138, 3413, 3905, 4450, 5093, 5434, 6134
Offset: 0

Views

Author

Gus Wiseman, Jan 20 2023

Keywords

Examples

			The a(7) = 1 through a(13) = 11 partitions:
  (4,2,1)  (4,3,1)  (6,2,1)  (5,3,2)  (5,4,2)    (6,5,1)    (6,4,3)
           (5,2,1)           (5,4,1)  (6,3,2)    (7,3,2)    (6,5,2)
                             (6,3,1)  (6,4,1)    (8,3,1)    (7,4,2)
                             (7,2,1)  (7,3,1)    (9,2,1)    (7,5,1)
                                      (8,2,1)    (6,3,2,1)  (8,3,2)
                                      (5,3,2,1)             (8,4,1)
                                                            (9,3,1)
                                                            (10,2,1)
                                                            (5,4,3,1)
                                                            (6,4,2,1)
                                                            (7,3,2,1)
		

Crossrefs

The non-strict version is ranked by A359890, complement A359889.
The non-strict version is A359894, complement A240219.
The complement is counted by A359897.
The odd-length case is A359900, complement A359899.
A000041 counts partitions, strict A000009.
A008284/A058398/A327482 count partitions by mean, ranked by A326567/A326568.
A008289 counts strict partitions by mean.
A067538 counts ptns with integer mean, strict A102627, ranked by A316413.
A237984 counts ptns containing their mean, strict A240850, ranked by A327473.
A325347 counts ptns with integer median, strict A359907, ranked by A359908.
A359893 and A359901 count partitions by median, odd-length A359902.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], UnsameQ@@#&&Mean[#]!=Median[#]&]],{n,0,30}]
Showing 1-10 of 12 results. Next