A349159
Numbers whose sum of prime indices is twice their alternating sum.
Original entry on oeis.org
1, 12, 63, 66, 112, 190, 255, 325, 408, 434, 468, 609, 805, 832, 931, 946, 1160, 1242, 1353, 1380, 1534, 1539, 1900, 2035, 2067, 2208, 2296, 2387, 2414, 2736, 3055, 3108, 3154, 3330, 3417, 3509, 3913, 4185, 4340, 4503, 4646, 4650, 4664, 4864, 5185, 5684, 5863
Offset: 1
The terms and their prime indices begin:
1: ()
12: (2,1,1)
63: (4,2,2)
66: (5,2,1)
112: (4,1,1,1,1)
190: (8,3,1)
255: (7,3,2)
325: (6,3,3)
408: (7,2,1,1,1)
434: (11,4,1)
468: (6,2,2,1,1)
609: (10,4,2)
805: (9,4,3)
832: (6,1,1,1,1,1,1)
931: (8,4,4)
946: (14,5,1)
1160: (10,3,1,1,1)
These partitions are counted by
A000712 up to 0's.
A025047 counts alternating or wiggly compositions, complement
A345192.
A116406 counts compositions with alternating sum >= 0, ranked by
A345913.
A138364 counts compositions with alternating sum 0, ranked by
A344619.
A346697 adds up odd-indexed prime indices.
A346698 adds up even-indexed prime indices.
Cf.
A000070,
A000290,
A001700,
A028260,
A045931,
A120452,
A195017,
A241638,
A257991,
A257992,
A325698,
A345958,
A349155.
-
primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
Select[Range[1000],Total[primeMS[#]]==2*ats[primeMS[#]]&]
A000713
EULER transform of 3, 2, 2, 2, 2, 2, 2, 2, ...
Original entry on oeis.org
1, 3, 8, 18, 38, 74, 139, 249, 434, 734, 1215, 1967, 3132, 4902, 7567, 11523, 17345, 25815, 38045, 55535, 80377, 115379, 164389, 232539, 326774, 456286, 633373, 874213, 1200228, 1639418, 2228546, 3015360, 4062065, 5448995, 7280060, 9688718, 12846507, 16972577
Offset: 0
- H. Gupta et al., Tables of Partitions. Royal Society Mathematical Tables, Vol. 4, Cambridge Univ. Press, 1958, p. 122.
- 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).
-
with(numtheory): etr:= proc(p) local b; b:=proc(n) option remember; local d,j; if n=0 then 1 else add(add(d*p(d), d=divisors(j)) *b(n-j), j=1..n)/n fi end end: a:= etr(n-> `if`(n<2,3,2)): seq(a(n), n=0..40); # Alois P. Heinz, Sep 08 2008
-
nn=20; g=Product[1/(1-x^i), {i,1,nn}]; c=1/(1-x); CoefficientList[Series[g^2/(1-x), {x,0,nn}], x] (* Geoffrey Critzer, Apr 19 2012 *)
-
x='x+O('x^66); Vec(1/((1-x)*eta(x)^2)) \\ Joerg Arndt, May 01 2013
-
from functools import lru_cache
from sympy import divisor_sigma
@lru_cache(maxsize=None)
def A000713(n): return sum(A000713(k)*((divisor_sigma(n-k)<<1)+1) for k in range(n))//n if n else 1 # Chai Wah Wu, Sep 25 2023
A210590
Triangle of numbers generated by the Nekrasov-Okounkov formula.
Original entry on oeis.org
1, 1, 1, 4, 5, 1, 18, 29, 12, 1, 120, 218, 119, 22, 1, 840, 1814, 1285, 345, 35, 1, 7920, 18144, 14674, 5205, 805, 51, 1, 75600, 196356, 185080, 79219, 16450, 1624, 70, 1, 887040, 2427312, 2515036, 1258628, 324569, 43568, 2954, 92, 1, 10886400, 32304240, 37012572, 21034376, 6431733, 1088409, 101178, 4974, 117, 1
Offset: 0
Table starts as:
1;
1, 1;
4, 5, 1;
18, 29, 12, 1;
120, 218, 119, 22, 1;
840, 1814, 1285, 345, 35, 1;
7920, 18144, 14674, 5205, 805, 51, 1;
...
-
w=9; MapIndexed[ CoefficientList[#1,t] Tr[#2-1]! &, CoefficientList[Series[Product[(1-x^i)^(-1-t), {i,w}], {x,0,w}], x]];
or alternatively:
CoefficientList[#, t] & /@ Table[1/n! Tr[(NumberOfTableaux[#1]^2 Apply[Times, t + Flatten[hooklength[#1]]^2] &) /@ Partitions[n]], {n,0,9}]
or alternatively:
Table[1/n!Tr[NumberOfTableaux[#]^2 f[ Flatten[hooklength[#]]^2,e,k,n ]&/@ Partitions[n] ],{n,0,9},{k,0,n}]
with e and f defined as:
e[n_,v_]:= Tr[Times @@@ Select[Subsets[Table[Subscript[x,j],{j,v}]],Length[#]==n&]];
f[li_List,fun_,par_,k_]:=fun[par,k]/.Thread[Array[Subscript[x,#1]&,Length[li]]->li];
A300789
Heinz numbers of integer partitions whose Young diagram can be tiled by dominos.
Original entry on oeis.org
1, 3, 4, 7, 9, 10, 12, 13, 16, 19, 21, 22, 25, 27, 28, 29, 34, 36, 37, 39, 40, 43, 46, 48, 49, 52, 53, 55, 57, 61, 62, 63, 64, 70, 71, 75, 76, 79, 81, 82, 84, 85, 87, 88, 89, 90, 91, 94, 100, 101, 107, 108, 111, 112, 113, 115, 116, 117, 118, 121, 129, 130, 131
Offset: 1
Sequence of integer partitions whose Young diagram can be tiled by dominos begins: (), (2), (11), (4), (22), (31), (211), (6), (1111), (8), (42), (51), (33), (222), (411).
Cf.
A000712,
A000898,
A001405,
A004003,
A045931,
A097613,
A099390,
A299926,
A300056,
A300060,
A300787,
A300788,
A304662.
-
a:= proc(n) option remember; local k; for k from 1+
`if`(n=1, 0, a(n-1)) while (l-> add(`if`(l[i]::odd,
(-1)^i, 0), i=1..nops(l))<>0)(sort(map(i->
numtheory[pi](i[1])$i[2], ifactors(k)[2]))) do od; k
end:
seq(a(n), n=1..100); # Alois P. Heinz, May 22 2018
-
primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
Select[Range[100],Total[(-1)^Flatten[Position[primeMS[#],_?OddQ]]]===0&] (* Conjectured *)
A301935
Number of positive subset-sum trees whose composite a positive subset-sum of the integer partition with Heinz number n.
Original entry on oeis.org
0, 1, 1, 2, 1, 3, 1, 10, 2, 3, 1, 21, 1, 3, 3, 58, 1, 21, 1, 21, 3, 3, 1, 164, 2, 3, 10, 21, 1, 34, 1, 373, 3, 3, 3, 218, 1, 3, 3, 161, 1, 7, 1, 5, 5, 3, 1, 1320, 2, 5, 3, 5, 1, 7, 3, 7, 3, 3, 1, 7, 1, 3, 4, 2558, 3, 7, 1, 5, 3, 6, 1, 7
Offset: 1
Cf.
A000108,
A000712,
A108917,
A122768,
A262671,
A262673,
A275972,
A276024,
A284640,
A299701,
A301854,
A301855,
A301856,
A301934.
A304444
Coefficient of x^n in Product_{k>=1} 1/(1-x^k)^(2*n).
Original entry on oeis.org
1, 2, 14, 98, 726, 5512, 42614, 333608, 2636326, 20985272, 168012824, 1351507830, 10914317934, 88432329546, 718545161208, 5852747363518, 47774241056710, 390702055798978, 3200542803221192, 26257321971526646, 215705170816632376, 1774181109262878848
Offset: 0
-
nmax = 25; Table[SeriesCoefficient[Product[1/(1-x^k)^(2*n), {k, 1, n}], {x, 0, n}], {n, 0, nmax}]
nmax = 25; Table[SeriesCoefficient[1/QPochhammer[x]^(2*n), {x, 0, n}], {n, 0, nmax}]
(* Calculation of constants {d,c}: *) eq = FindRoot[{1/QPochhammer[r*s]^2 == s, 1/s + 2*r*Sqrt[s]*Derivative[0, 1][QPochhammer][r*s, r*s] == (2*(Log[1 - r*s] + QPolyGamma[0, 1, r*s]))/(s* Log[r*s])}, {r, 1/8}, {s, 2}, WorkingPrecision -> 1000]; {N[1/r /. eq, 120], val = Sqrt[((1 - r*s)*Log[r*s]^2)/(Pi*(16*r*s*ArcTanh[1 - 2*r*s] - (-1 + r*s)*(Log[r*s] - 2*Log[1 - r*s])*(3*Log[r*s] - 2*Log[1 - r*s]) - 8*Log[1 - r*s] - 8*(-1 + r*s)*(-1 + 2*ArcTanh[1 - 2*r*s])* QPolyGamma[0, 1, r*s] + (4 - 4*r*s)* QPolyGamma[0, 1, r*s]^2 + 4*(-1 + r*s)*(QPolyGamma[1, 1, r*s] + r*s*Log[r*s] * (r*s^(3/2)*Log[r*s]* Derivative[0, 2][QPochhammer][r*s, r*s] - 2*Derivative[0, 0, 1][QPolyGamma][0, 1, r*s]))))] /. eq; N[Chop[val], -Floor[Log[10, Abs[Im[val]]]] - 3]} (* Vaclav Kotesovec, Oct 03 2023 *)
A316271
FDH numbers of strict non-knapsack partitions.
Original entry on oeis.org
24, 40, 70, 84, 120, 126, 135, 168, 198, 210, 216, 220, 231, 264, 270, 280, 286, 312, 330, 351, 360, 364, 378, 384, 408, 416, 420, 440, 456, 462, 504, 520, 528, 540, 544, 546, 552, 560, 576, 594, 600, 616, 630, 640, 646, 660, 663, 680, 696, 702, 728, 744, 748
Offset: 1
a(1) = 24 is the FDH number of (3,2,1), which is not knapsack because 3 = 2 + 1.
Cf.
A000712,
A005117,
A050376,
A056239,
A064547,
A108917,
A213925,
A275972,
A284640,
A299702,
A299755,
A299757,
A301899,
A301900.
-
nn=1000;
sksQ[ptn_]:=And[UnsameQ@@ptn,UnsameQ@@Plus@@@Union[Subsets[ptn]]];
FDfactor[n_]:=If[n==1,{},Sort[Join@@Cases[FactorInteger[n],{p_,k_}:>Power[p,Cases[Position[IntegerDigits[k,2]//Reverse,1],{m_}->2^(m-1)]]]]];
FDprimeList=Array[FDfactor,nn,1,Union];FDrules=MapIndexed[(#1->#2[[1]])&,FDprimeList];
Select[Range[nn],!sksQ[FDfactor[#]/.FDrules]&]
A358369
Euler transform of 2^floor(n/2), (A016116).
Original entry on oeis.org
1, 1, 3, 5, 12, 20, 43, 73, 146, 250, 475, 813, 1499, 2555, 4592, 7800, 13761, 23253, 40421, 67963, 116723, 195291, 332026, 552882, 932023, 1544943, 2585243, 4267081, 7094593, 11662769, 19281018, 31575874, 51937608, 84753396, 138772038, 225693778, 368017636
Offset: 0
Sequences that can be represented as a EulerTransform(BinaryRecurrenceSequence()) include
A000009,
A000041,
A000712,
A001970,
A002513,
A010054,
A015128,
A022567,
A034691,
A111317,
A111335,
A117410,
A156224,
A166861,
A200544,
A261031,
A261329,
A358449.
-
BinaryRecurrenceSequence := proc(b, c, u0:=0, u1:=1) local u;
u := proc(n) option remember; if n < 2 then return [u0, u1][n + 1] fi;
b*u(n - 1) + c*u(n - 2) end; u end:
EulerTransform := proc(a) local b;
b := proc(n) option remember; if n = 0 then return 1 fi; add(add(d * a(d),
d = NumberTheory:-Divisors(j)) * b(n-j), j = 1..n) / n end; b end:
a := EulerTransform(BinaryRecurrenceSequence(0, 2, 1)): seq(a(n), n=0..36);
-
from typing import Callable
from functools import cache
from sympy import divisors
def BinaryRecurrenceSequence(b:int, c:int, u0:int=0, u1:int=1) -> Callable:
@cache
def u(n: int) -> int:
if n < 2:
return [u0, u1][n]
return b * u(n - 1) + c * u(n - 2)
return u
def EulerTransform(a: Callable) -> Callable:
@cache
def b(n: int) -> int:
if n == 0:
return 1
s = sum(sum(d * a(d) for d in divisors(j)) * b(n - j)
for j in range(1, n + 1))
return s // n
return b
b = BinaryRecurrenceSequence(0, 2, 1)
a = EulerTransform(b)
print([a(n) for n in range(37)])
-
# uses[EulerTransform from A166861]
b = BinaryRecurrenceSequence(0, 2, 1)
a = EulerTransform(b)
print([a(n) for n in range(37)])
A381895
Triangle read by rows: T(n, k) is the number of partitions of n with at most k parts where 0 <= k <= n, and each part is one of two kinds.
Original entry on oeis.org
1, 0, 2, 0, 2, 5, 0, 2, 6, 10, 0, 2, 9, 15, 20, 0, 2, 10, 22, 30, 36, 0, 2, 13, 31, 48, 58, 65, 0, 2, 14, 40, 68, 90, 102, 110, 0, 2, 17, 51, 97, 135, 162, 176, 185, 0, 2, 18, 64, 128, 194, 242, 274, 290, 300, 0, 2, 21, 77, 171, 271, 357, 415, 452, 470, 481
Offset: 0
Triangle starts:
0 : [1]
1 : [0, 2]
2 : [0, 2, 5]
3 : [0, 2, 6, 10]
4 : [0, 2, 9, 15, 20]
5 : [0, 2, 10, 22, 30, 36]
6 : [0, 2, 13, 31, 48, 58, 65]
7 : [0, 2, 14, 40, 68, 90, 102, 110]
8 : [0, 2, 17, 51, 97, 135, 162, 176, 185]
9 : [0, 2, 18, 64, 128, 194, 242, 274, 290, 300]
10 : [0, 2, 21, 77, 171, 271, 357, 415, 452, 470, 481]
...
-
A381895(row_max) = {my(N=row_max+1,x='x+O('x^N), y='y+O('y^N), h=prod(i=1,N, 1/(1-y*x^i)^2)/(1-y)); for(n=0,N-1, if(n<1, print([1]),print(concat([0],Vec(polcoeff(h, n))[1..n]))))}
A381895(12) \\ John Tyler Rascoe, Mar 19 2025
-
from sympy.utilities.iterables import partitions
from sympy.combinatorics.partitions import IntegerPartition
def a381895_row( n):
if n == 0 : return [1]
t = list( [0] * n)
for p in partitions( n):
p = IntegerPartition( p).as_dict()
fact = 1
s = 0
for k in p :
s += p[k]
fact *= 1 + p[k]
if s > 0 :
t[s - 1] += fact
for i in range( n - 1):
t[i+1] += t[i]
return [0] + t
A060850
Array of the coefficients A(n,k) in the expansion of Product_{i>=1} 1/(1-x^i)^n = Sum_{k>=0} A(n,k)*x^k, n >= 1, k >= 0.
Original entry on oeis.org
1, 1, 1, 1, 2, 2, 1, 3, 5, 3, 1, 4, 9, 10, 5, 1, 5, 14, 22, 20, 7, 1, 6, 20, 40, 51, 36, 11, 1, 7, 27, 65, 105, 108, 65, 15, 1, 8, 35, 98, 190, 252, 221, 110, 22, 1, 9, 44, 140, 315, 506, 574, 429, 185, 30, 1, 10, 54, 192, 490, 918, 1265, 1240, 810, 300, 42, 1, 11, 65, 255
Offset: 1
Bo T. Ahlander (ahlboa(AT)isk.kth.se), May 03 2001
Table (row k, k >= 0: number of partitions of n, n >= 0, into parts of k kinds):
Array begins:
=======================================================================
k\n| 0 1 2 3 4 5 6 7 8 9 10
---|-------------------------------------------------------------------
1 | 1 1 2 3 5 7 11 15 22 30 42
2 | 1 2 5 10 20 36 65 110 185 300 481
3 | 1 3 9 22 51 108 221 429 810 1479 2640
4 | 1 4 14 40 105 252 574 1240 2580 5180 10108
5 | 1 5 20 65 190 506 1265 2990 6765 14725 31027
6 | 1 6 27 98 315 918 2492 6372 15525 36280 81816
7 | 1 7 35 140 490 1547 4522 12405 32305 80465 192899
8 | 1 8 44 192 726 2464 7704 22528 62337 164560 417140
9 | 1 9 54 255 1035 3753 12483 38709 113265 315445 841842
10 | 1 10 65 330 1430 5512 19415 63570 195910 573430 1605340
11 | 1 11 77 418 1925 7854 29183 100529 325193 997150 2919411
...
Triangle (row n, n >= 0: number of partitions of n into parts of n - k kinds, 0 <= k <= n) (antidiagonals of above table) (parenthesized last term on each row, which would correspond to row k = 0 in above table)
Triangle begins: (column k: n - k kinds of parts)
===================================
n\k| 0 1 2 3 4 5 6 7
---+-------------------------------
0 |(1)
1 | 1, (0)
2 | 1, 1, (0)
3 | 1, 2, 2, (0)
4 | 1, 3, 5, 3, (0)
5 | 1, 4, 9, 10, 5, (0)
6 | 1, 5, 14, 22, 20, 7, (0)
7 | 1, 6, 20, 40, 51, 36, 11, (0)
...
Cf.
A067687 (table antidiagonal sums, triangle row sums).
-
t[n_, k_] := CoefficientList[ Series[ Product[1/(1 - x^i)^n, {i, k}], {x, 0, k}], x][[k]]; (* Robert G. Wilson v, Aug 08 2018 *)
t[n_, k_]; = IntegerPartitions[n, {k}]; Table[ t[n - k + 1, k], {n, 12}, {k, n}] // Flatten (* Robert G. Wilson v, Aug 08 2018 *)
Comments