A363611
Expansion of Sum_{k>0} x^(4*k)/(1-x^k)^4.
Original entry on oeis.org
0, 0, 0, 1, 4, 10, 20, 36, 56, 88, 120, 176, 220, 306, 368, 491, 560, 746, 816, 1058, 1160, 1450, 1540, 1982, 2028, 2520, 2656, 3232, 3276, 4116, 4060, 4986, 5080, 6016, 6008, 7457, 7140, 8586, 8656, 10232, 9880, 12116, 11480, 13792, 13668, 15730, 15180, 18652, 17316, 20536
Offset: 1
-
a[n_] := DivisorSum[n, Binomial[# - 1, 3] &]; Array[a, 50] (* Amiram Eldar, Jul 25 2023 *)
-
my(N=60, x='x+O('x^N)); concat([0, 0, 0], Vec(sum(k=1, N, x^(4*k)/(1-x^k)^4)))
-
a(n) = my(f = factor(n)); (sigma(f, 3) - 6*sigma(f, 2) + 11*sigma(f) - 6*numdiv(f)) / 6; \\ Amiram Eldar, Jan 01 2025
A065061
Numbers k such that sigma(k) - tau(k) is a prime.
Original entry on oeis.org
3, 8, 162, 512, 1250, 8192, 31250, 32768, 41472, 663552, 2531250, 3748322, 5120000, 6837602, 7558272, 8000000, 15780962, 33554432, 35701250, 42762752, 45334242, 68024448, 75031250, 78125000, 91125000, 137149922, 243101250, 512000000, 907039232, 959570432
Offset: 1
162 is a term since sigma(162) - tau(162) = 363 - 10 = 353, which is prime.
Cf.
A000005,
A000203,
A023194,
A038344,
A055813,
A062700,
A115919,
A141242,
A229264,
A229265,
A229266,
A229268.
-
Do[ If[ PrimeQ[ DivisorSigma[1, n] - DivisorSigma[0, n]], Print[n]], {n, 1, 10^7}]
-
{ n=0; for (m=1, 10^9, if (isprime(sigma(m) - numdiv(m)), write("b065061.txt", n++, " ", m); if (n==100, return)) ) } \\ Harry J. Smith, Oct 05 2009
-
from itertools import count, islice
from sympy import isprime, divisor_sigma as s, divisor_count as t
def agen(): # generator of terms
yield 3
yield from (k for k in (2*i*i for i in count(1)) if isprime(s(k)-t(k)))
print(list(islice(agen(), 30))) # Michael S. Branicky, Jun 20 2022
A125182
Triangle read by rows: T(n,k) is the number of permutations p of {1,2,...,n} such that the set {p(i)-i, i=1,2,...,n} has exactly k elements (1<=k<=n).
Original entry on oeis.org
1, 1, 1, 1, 2, 3, 1, 4, 12, 7, 1, 4, 38, 54, 23, 1, 8, 77, 248, 303, 83, 1, 6, 160, 824, 2008, 1636, 405, 1, 11, 285, 2320, 9449, 15789, 10352, 2113, 1, 10, 476, 5564, 37237, 102726, 133293, 70916, 12657, 1, 14, 799, 13172, 122708, 536900, 1158368, 1177168, 537373, 82297
Offset: 1
T(4,2) = 4 because we have 4123, 3412, 2143 and 2341.
Triangle starts:
1;
1, 1;
1, 2, 3;
1, 4, 12, 7;
1, 4, 38, 54, 23;
...
- Alois P. Heinz, Rows n = 1..12, flattened
- M. Alekseyev, E. Deutsch, and J. H. Steelman, Problem 11281, Amer. Math. Monthly, 116, No. 5, 2009, p. 465. - _Emeric Deutsch_, Apr 23 2009
-
n:=7: with(combinat): P:=permute(n): for j from 1 to n! do c[j]:=0 od: for j from 1 to n! do if nops({seq(P[j][i]-i,i=1..n)}) = 1 then c[1]:=c[1]+1 elif nops({seq(P[j][i]-i,i=1..n)}) = 2 then c[2]:=c[2]+1 elif nops({seq(P[j][i]-i,i=1..n)}) = 3 then c[3]:=c[3]+1 elif nops({seq(P[j][i]-i,i=1..n)}) = 4 then c[4]:=c[4]+1 elif nops({seq(P[j][i]-i,i=1..n)}) = 5 then c[5]:=c[5]+1 elif nops({seq(P[j][i]-i,i=1..n)}) = 6 then c[6]:=c[6]+1 elif nops({seq(P[j][i]-i,i=1..n)}) = 7 then c[7]:=c[7]+1 elif nops({seq(P[j][i]-i,i=1..n)}) = 8 then c[8]:=c[8]+1 elif nops({seq(P[j][i]-i,i=1..n)}) = 9 then c[9]:=c[9]+1 elif nops({seq(P[j][i]-i,i=1..n)}) = 10 then c[10]:=c[10]+1 else fi od: seq(c[i],i=1..n);
# second Maple program:
b:= proc(p, s) option remember; `if`(p={}, x^nops(s),
add(b(p minus {t}, s union {t+nops(p)}), t=p))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b({$1..n}, {})):
seq(T(n), n=1..9); # Alois P. Heinz, May 04 2014; revised, Sep 08 2018
-
b[i_, p_List, s_List] := b[i, p, s] = If[p == {}, x^Length[s], Sum[b[i+1, p ~Complement~ {t}, s ~Union~ {t+i}], {t, p}]]; T[n_] := Function[{p}, Table[ Coefficient[p, x, i], {i, 1, n}]][b[1, Range[n], {}]]; Table[T[n], {n, 1, 9}] // Flatten (* Jean-François Alcover, Feb 19 2015, after Alois P. Heinz *)
A229268
Primes of the form sigma(k) - tau(k), where sigma(k) = A000203(k) and tau(k) = A000005(k).
Original entry on oeis.org
2, 11, 353, 1013, 2333, 16369, 58579, 65519, 123733, 1982273, 7089683, 5778653, 12795053, 10500593, 22586027, 19980143, 24126653, 67108837, 72494713, 90781993, 106199593, 203275951, 164118923, 183105421, 320210549, 259997173, 794091653, 1279963973
Offset: 1
Second term of A065061 is 8 and sigma(8) - tau(8) = 15 - 4 = 11 is prime.
Cf.
A000005,
A000010,
A000203,
A009087,
A023194,
A038344,
A055813,
A062700,
A064205,
A065608,
A141242,
A229264,
A229266
-
with(numtheory); P:=proc(q) local a,n; a:= sigma(n)-tau(n); for n from 1 to q do
if isprime(a) then print(a); fi; od; end: P(10^6);
-
Join[{2}, Select[(DivisorSigma[1, #] - DivisorSigma[0, #]) & /@ (2*Range[20000]^2), PrimeQ]] (* Amiram Eldar, Dec 06 2022 *)
A263730
Irregular triangle read by rows in which row n > 1 lists k such that (k^2 + k*n)/(k + 1) is an integer.
Original entry on oeis.org
0, 0, 1, 0, 2, 0, 1, 3, 0, 4, 0, 1, 2, 5, 0, 6, 0, 1, 3, 7, 0, 2, 8, 0, 1, 4, 9, 0, 10, 0, 1, 2, 3, 5, 11, 0, 12, 0, 1, 6, 13, 0, 2, 4, 14, 0, 1, 3, 7, 15, 0, 16, 0, 1, 2, 5, 8, 17, 0, 18, 0, 1, 3, 4, 9, 19, 0, 2, 6, 20, 0, 1, 10, 21, 0, 22, 0, 1, 2, 3, 5, 7, 11, 23, 0, 4, 24, 0, 1, 12, 25
Offset: 2
n\k| 0 1 2 3 4 5 6 7 8 9 10
---+------------------------------------------
0 | 0
1 | 0 1 2 3 4 5 6 7 8 9 10
2 | 0
3 | 0 1
4 | 0 2
5 | 0 1 3
6 | 0 4
7 | 0 1 2 5
8 | 0 6
9 | 0 1 3 7
10 | 0 2 8
11 | 0 1 4 9
12 | 0 10
13 | 0 1 2 3 5 11
-
Table[Select[Range[0,n-2],Divisible[#^2+n #,#+1]&],{n,30}]//Flatten (* Harvey P. Dale, Dec 27 2016 *)
-
tabf(nn) = {for (n=2, nn, for (k=0, n, if (!((k^2 + k*n) % (k+1)), print1(k, ", "));); print(););} \\ Michel Marcus, Oct 25 2015
A077478
Rectangular array R read by antidiagonals: R(i,j) is the number of integers k that divide both i and j (i >= 1, j >= 1).
Original entry on oeis.org
1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 1, 4, 1, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1
Offset: 1
First few rows of the array R are:
1, 1, 1, 1, 1, 1, 1, ...
1, 2, 1, 2, 1, 2, 1, ...
1, 1, 2, 1, 1, 2, 1, ...
1, 2, 1, 3, 1, 2, 1, ...
1, 1, 1, 1, 2, 1, 1, ...
1, 2, 2, 2, 1, 4, 1, ...
...
First few rows of the triangle T are:
1;
1, 1;
1, 2, 1;
1, 1, 1, 1;
1, 2, 2, 2, 1;
1, 1, 1, 1, 1, 1;
1, 2, 1, 3, 1, 3, 1;
1, 1, 2, 1, 1, 2, 1, 1;
1, 2, 1, 2, 2, 2, 1, 2, 1;
1, 1, 1, 1, 1, 1, 1, 1, 1, 1;
1, 2, 2, 3, 1, 4, 1, 3, 2, 2, 1;
...
R(4,2)=2 since 1|2, 1|4 and 2|2, 2|4.
-
T[n_,k_]:=DivisorSigma[0,GCD[n,k]]; Flatten[Table[T[n-k+1,k],{n,14},{k,n}]] (* Stefano Spezia, May 23 2021 *)
A191822
Number of solutions to the Diophantine equation x1*x2 + x2*x3 + x3*x4 + x4*x5 = n, with all xi >= 1.
Original entry on oeis.org
0, 0, 0, 1, 2, 6, 8, 16, 20, 32, 36, 58, 58, 86, 92, 125, 122, 178, 164, 228, 224, 286, 268, 382, 330, 436, 424, 534, 474, 660, 556, 740, 692, 840, 752, 1043, 846, 1094, 1032, 1276, 1078, 1476, 1204, 1582, 1458, 1710, 1480, 2070, 1628, 2096, 1924, 2332, 1946, 2652, 2148, 2770, 2480, 2908, 2480, 3512
Offset: 1
G.f.: x^4 + 2 x^5 + 6 x^6 + 8 x^7 + 16 x^8 + 20 x^9 + 32 x^10 + ...
-
with(numtheory);
D00:=n->add(tau(j)*tau(n-j),j=1..n-1);
L4:=n->sigma[2](n)-n*sigma[0](n)-D00(n);
[seq(L4(n),n=1..60)];
-
a[ n_] := Length @ FindInstance[{x1 > 0, x2 > 0, x3 > 0, x4 > 0, x5 > 0, n == x1 x2 + x2 x3 + x3 x4 + x4 x5}, {x1, x2, x3, x4, x5}, Integers, 10^9]; (* Michael Somos, Nov 12 2016 *)
A342343
Number of strict compositions of n with alternating parts strictly decreasing.
Original entry on oeis.org
1, 1, 1, 3, 3, 5, 8, 10, 13, 18, 27, 32, 44, 55, 73, 97, 121, 151, 194, 240, 299, 384, 465, 576, 706, 869, 1051, 1293, 1572, 1896, 2290, 2761, 3302, 3973, 4732, 5645, 6759, 7995, 9477, 11218, 13258, 15597, 18393, 21565, 25319, 29703, 34701, 40478, 47278, 54985
Offset: 0
The a(1) = 1 through a(8) = 13 compositions:
(1) (2) (3) (4) (5) (6) (7) (8)
(1,2) (1,3) (1,4) (1,5) (1,6) (1,7)
(2,1) (3,1) (2,3) (2,4) (2,5) (2,6)
(3,2) (4,2) (3,4) (3,5)
(4,1) (5,1) (4,3) (5,3)
(2,3,1) (5,2) (6,2)
(3,1,2) (6,1) (7,1)
(3,2,1) (2,4,1) (2,5,1)
(4,1,2) (3,4,1)
(4,2,1) (4,1,3)
(4,3,1)
(5,1,2)
(5,2,1)
The non-strict odd-length case is
A001522.
Strict compositions in general are counted by
A032020
The non-strict even-length case is
A064428.
The case of reversed partitions is
A065033.
A000726 counts partitions with alternating parts unequal.
A003242 counts anti-run compositions.
A027193 counts odd-length compositions.
A034008 counts even-length compositions.
A064391 counts partitions by crank.
A064410 counts partitions of crank 0.
A224958 counts compositions with alternating parts unequal.
A257989 gives the crank of the partition with Heinz number n.
A325548 counts compositions with strictly decreasing differences.
A342194 counts strict compositions with equal differences.
A342527 counts compositions with alternating parts equal.
Cf.
A000009,
A000670,
A008965,
A062968,
A065608,
A109613,
A114921,
A325546,
A332304,
A332305,
A342532.
-
ici[q_]:=And@@Table[q[[i]]>q[[i+2]],{i,Length[q]-2}];
Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n],UnsameQ@@#&],ici]],{n,0,15}]
-
seq(n)={my(p=prod(k=1, n, 1 + y*x^k + O(x*x^n))); Vec(sum(k=0, n, binomial(k, k\2) * polcoef(p,k,y)))} \\ Andrew Howroyd, Apr 16 2021
A348915
a(n) = Sum_{d|n} d^(d mod 2).
Original entry on oeis.org
1, 2, 4, 3, 6, 6, 8, 4, 13, 8, 12, 8, 14, 10, 24, 5, 18, 16, 20, 10, 32, 14, 24, 10, 31, 16, 40, 12, 30, 28, 32, 6, 48, 20, 48, 19, 38, 22, 56, 12, 42, 36, 44, 16, 78, 26, 48, 12, 57, 34, 72, 18, 54, 44, 72, 14, 80, 32, 60, 32, 62, 34, 104, 7, 84, 52, 68, 22, 96, 52, 72, 22, 74
Offset: 1
For n = 12, the divisors of 12 are 1, 2, 3, 4, 6, 12 with corresponding summands 1, 1, 3, 1, 1, 1, respectively. The sum is then a(12) = 1 + 1 + 3 + 1 + 1 + 1 = 8.
-
f:= proc(n) local d;
add(d^(d mod 2), d = numtheory:-divisors(n))
end proc;
map(f, [$1..100]); # Robert Israel, Jun 01 2025
-
a[n_] := DivisorSum[n, #^Mod[#, 2] &]; Array[a, 100] (* Amiram Eldar, Nov 04 2021 *)
-
a(n) = sumdiv(n, d, if (d%2, d, 1)); \\ Michel Marcus, Nov 04 2021
-
from math import prod
from sympy import factorint
def A348915(n):
f = factorint(n>>(m:=(~n&n-1).bit_length())).items()
d = prod(e+1 for p,e in f)
s = prod((p**(e+1)-1)//(p-1) for p, e in f)
return s+d*m # Chai Wah Wu, Jul 16 2022
A184396
a(n) = number of numbers k <= sigma(n) such that k is not equal to sigma(d) for any divisor d of n, where sigma = A000203.
Original entry on oeis.org
0, 1, 2, 4, 4, 8, 6, 11, 10, 14, 10, 22, 12, 20, 20, 26, 16, 33, 18, 36, 28, 32, 22, 52, 28, 38, 36, 50, 28, 64, 30, 57, 44, 50, 44, 82, 36, 56, 52, 82, 40, 88, 42, 78, 72, 68, 46, 114, 54, 87, 68, 92, 52, 112, 68, 112, 76, 86, 58, 156, 60, 92, 98, 120, 80, 137, 66, 120, 92, 136, 70, 183, 72, 110, 118, 134, 92, 160, 78, 176, 116
Offset: 1
For n = 4, sigma(4) = 7, from numbers 1 - 7 there are four numbers k such that k is not equal to sigma(d) for any divisor d of n: 2, 4, 5, 6; a(4) = 4.
-
f[n_] := Block[{c = 0, k = 1, lmt = DivisorSigma[1, n] + 1, sd = DivisorSigma[1, #] & /@ Divisors@ n}, While[k < lmt, If[! MemberQ[sd, k], c++]; k++]; c]; Array[f, 67]
-
A184395(n) = length(vecsort(apply(d->sigma(d),divisors(n)), , 8));
A184396(n) = (sigma(n) - A184395(n)); \\ Antti Karttunen, Aug 24 2017
Comments