A027746
Irregular triangle in which first row is 1, n-th row (n>1) gives prime factors of n with repetition.
Original entry on oeis.org
1, 2, 3, 2, 2, 5, 2, 3, 7, 2, 2, 2, 3, 3, 2, 5, 11, 2, 2, 3, 13, 2, 7, 3, 5, 2, 2, 2, 2, 17, 2, 3, 3, 19, 2, 2, 5, 3, 7, 2, 11, 23, 2, 2, 2, 3, 5, 5, 2, 13, 3, 3, 3, 2, 2, 7, 29, 2, 3, 5, 31, 2, 2, 2, 2, 2, 3, 11, 2, 17, 5, 7, 2, 2, 3, 3, 37, 2, 19, 3, 13, 2, 2, 2, 5, 41, 2, 3, 7, 43, 2, 2, 11, 3, 3, 5
Offset: 1
Triangle begins
1;
2;
3;
2, 2;
5;
2, 3;
7;
2, 2, 2;
3, 3;
2, 5;
11;
2, 2, 3;
...
A281890 measures frequency of each prime in each column, with
A281889 giving median values.
-
import Data.List (unfoldr)
a027746 n k = a027746_tabl !! (n-1) !! (k-1)
a027746_tabl = map a027746_row [1..]
a027746_row 1 = [1]
a027746_row n = unfoldr fact n where
fact 1 = Nothing
fact x = Just (p, x `div` p) where p = a020639 x
-- Reinhard Zumkeller, Aug 27 2011
-
P:=proc(n) local FM: FM:=ifactors(n)[2]: seq(seq(FM[j][1],k=1..FM[j][2]),j=1..nops(FM)) end: 1; for n from 2 to 45 do P(n) od; # yields sequence in triangular form; Emeric Deutsch, Feb 13 2005
-
row[n_] := Flatten[ Table[#[[1]], {#[[2]]}] & /@ FactorInteger[n]]; Flatten[ Table[ row[n], {n, 1, 45}]] (* Jean-François Alcover, Dec 01 2011 *)
-
A027746_row(n,o=[1])=if(n>1,concat(apply(t->vector(t[2],i,t[1]), Vec(factor(n)~))),o) \\ Use %(n,[]) if you want the more natural [] for the first row. - M. F. Hasler, Jul 29 2015
-
def factors(n: int) -> list[int]:
p = n
L:list[int] = []
for f in range(2, p + 1):
if f * f > p: break
while True:
q, r = divmod(p, f)
if r != 0: break
L.append(f)
p = q
if p == 1: return L
L.append(p)
return L # Peter Luschny, Jul 18 2024
-
v=[1]
for k in [2..45]: v.extend(p for (p, m) in factor(k) for _ in range(m))
print(v) # Giuseppe Coppoletta, Dec 29 2017
A237270
Triangle read by rows in which row n lists the parts of the symmetric representation of sigma(n).
Original entry on oeis.org
1, 3, 2, 2, 7, 3, 3, 12, 4, 4, 15, 5, 3, 5, 9, 9, 6, 6, 28, 7, 7, 12, 12, 8, 8, 8, 31, 9, 9, 39, 10, 10, 42, 11, 5, 5, 11, 18, 18, 12, 12, 60, 13, 5, 13, 21, 21, 14, 6, 6, 14, 56, 15, 15, 72, 16, 16, 63, 17, 7, 7, 17, 27, 27, 18, 12, 18, 91, 19, 19, 30, 30, 20, 8, 8, 20, 90
Offset: 1
Illustration of the first 27 terms as regions (or parts) of a spiral constructed with the first 15.5 rows of A239660:
.
. _ _ _ _ _ _ _ _
. | _ _ _ _ _ _ _|_ _ _ _ _ _ _ 7
. | | |_ _ _ _ _ _ _|
. 12 _| | |
. |_ _| _ _ _ _ _ _ |_ _
. 12 _ _| | _ _ _ _ _|_ _ _ _ _ 5 |_
. _ _ _| | 9 _| | |_ _ _ _ _| |
. | _ _ _| 9 _|_ _| |_ _ 3 |_ _ _ 7
. | | _ _| | _ _ _ _ |_ | | |
. | | | _ _| 12 _| _ _ _|_ _ _ 3 |_|_ _ 5 | |
. | | | | _| | |_ _ _| | | | |
. | | | | | _ _| |_ _ 3 | | | |
. | | | | | | 3 _ _ | | | | | |
. | | | | | | | _|_ 1 | | | | | |
. _|_| _|_| _|_| _|_| |_| _|_| _|_| _|_| _
. | | | | | | | | | | | | | | | |
. | | | | | | |_|_ _ _| | | | | | | |
. | | | | | | 2 |_ _|_ _| _| | | | | | |
. | | | | |_|_ 2 |_ _ _|7 _ _| | | | | |
. | | | | 4 |_ _| _ _| | | | |
. | | |_|_ _ |_ _ _ _ | _| _ _ _| | | |
. | | 6 |_ |_ _ _ _|_ _ _ _| | 15 _| _ _| | |
. |_|_ _ _ |_ 4 |_ _ _ _ _| _| | _ _ _| |
. 8 | |_ _ | | _| | _ _ _|
. |_ | |_ _ _ _ _ _ | _ _|28 _| |
. |_ |_ |_ _ _ _ _ _|_ _ _ _ _ _| | _| _|
. 8 |_ _| 6 |_ _ _ _ _ _ _| _ _| _|
. | | _ _| 31
. |_ _ _ _ _ _ _ _ | |
. |_ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _| |
. 8 |_ _ _ _ _ _ _ _ _|
.
.
[For two other drawings of the spiral see the links. - _N. J. A. Sloane_, Nov 16 2020]
If the sequence does not contain negative terms then its terms can be represented in a quadrant. For the construction of the diagram we use the symmetric Dyck paths of A237593 as shown below:
---------------------------------------------------------------
Triangle Diagram of the symmetry of sigma (n = 1..24)
---------------------------------------------------------------
. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
1; |_| | | | | | | | | | | | | | | | | | | | | | | |
3; |_ _|_| | | | | | | | | | | | | | | | | | | | | |
2, 2; |_ _| _|_| | | | | | | | | | | | | | | | | | | |
7; |_ _ _| _|_| | | | | | | | | | | | | | | | | |
3, 3; |_ _ _| _| _ _|_| | | | | | | | | | | | | | | |
12; |_ _ _ _| _| | _ _|_| | | | | | | | | | | | | |
4, 4; |_ _ _ _| |_ _|_| _ _|_| | | | | | | | | | | |
15; |_ _ _ _ _| _| | _ _ _|_| | | | | | | | | |
5, 3, 5; |_ _ _ _ _| | _|_| | _ _ _|_| | | | | | | |
9, 9; |_ _ _ _ _ _| _ _| _| | _ _ _|_| | | | | |
6, 6; |_ _ _ _ _ _| | _| _| _| | _ _ _ _|_| | | |
28; |_ _ _ _ _ _ _| |_ _| _| _ _| | | _ _ _ _|_| |
7, 7; |_ _ _ _ _ _ _| | _ _| _| _| | | _ _ _ _|
12, 12; |_ _ _ _ _ _ _ _| | | | _|_| |* * * *
8, 8, 8; |_ _ _ _ _ _ _ _| | _ _| _ _|_| |* * * *
31; |_ _ _ _ _ _ _ _ _| | _ _| _| _ _|* * * *
9, 9; |_ _ _ _ _ _ _ _ _| | |_ _ _| _|* * * * * *
39; |_ _ _ _ _ _ _ _ _ _| | _ _| _|* * * * * * *
10, 10; |_ _ _ _ _ _ _ _ _ _| | | |* * * * * * * *
42; |_ _ _ _ _ _ _ _ _ _ _| | _ _ _|* * * * * * * *
11, 5, 5, 11; |_ _ _ _ _ _ _ _ _ _ _| | |* * * * * * * * * * *
18, 18; |_ _ _ _ _ _ _ _ _ _ _ _| |* * * * * * * * * * *
12, 12; |_ _ _ _ _ _ _ _ _ _ _ _| |* * * * * * * * * * *
60; |_ _ _ _ _ _ _ _ _ _ _ _ _|* * * * * * * * * * *
...
The total number of cells in the first n set of symmetric regions of the diagram equals A024916(n), the sum of all divisors of all positive integers <= n, hence the total number of cells in the n-th set of symmetric regions of the diagram equals sigma(n) = A000203(n).
For n = 9 the 9th row of A237593 is [5, 2, 2, 2, 2, 5] and the 8th row of A237593 is [5, 2, 1, 1, 2, 5] therefore between both symmetric Dyck paths there are three regions (or parts) of sizes [5, 3, 5], so row 9 is [5, 3, 5].
The sum of divisors of 9 is 1 + 3 + 9 = A000203(9) = 13. On the other hand the sum of the parts of the symmetric representation of sigma(9) is 5 + 3 + 5 = 13, equaling the sum of divisors of 9.
For n = 24 the 24th row of A237593 is [13, 4, 3, 2, 1, 1, 1, 1, 2, 3, 4, 13] and the 23rd row of A237593 is [12, 5, 2, 2, 1, 1, 1, 1, 2, 2, 5, 12] therefore between both symmetric Dyck paths there are only one region (or part) of size 60, so row 24 is 60.
The sum of divisors of 24 is 1 + 2 + 3 + 4 + 6 + 8 + 12 + 24 = A000203(24) = 60. On the other hand the sum of the parts of the symmetric representation of sigma(24) is 60, equaling the sum of divisors of 24.
Note that the number of *'s in the diagram is 24^2 - A024916(24) = 576 - 491 = A004125(24) = 85.
From _Omar E. Pol_, Nov 22 2020: (Start)
Also consider the infinite double-staircases diagram defined in A335616 (see the theorem).
For n = 15 the diagram with first 15 levels looks like this:
.
Level "Double-staircases" diagram
. _
1 _|1|_
2 _|1 _ 1|_
3 _|1 |1| 1|_
4 _|1 _| |_ 1|_
5 _|1 |1 _ 1| 1|_
6 _|1 _| |1| |_ 1|_
7 _|1 |1 | | 1| 1|_
8 _|1 _| _| |_ |_ 1|_
9 _|1 |1 |1 _ 1| 1| 1|_
10 _|1 _| | |1| | |_ 1|_
11 _|1 |1 _| | | |_ 1| 1|_
12 _|1 _| |1 | | 1| |_ 1|_
13 _|1 |1 | _| |_ | 1| 1|_
14 _|1 _| _| |1 _ 1| |_ |_ 1|_
15 |1 |1 |1 | |1| | 1| 1| 1|
.
Starting from A196020 and after the algorithm described in A280850 and A296508 applied to the above diagram we have a new diagram as shown below:
.
Level "Ziggurat" diagram
. _
6 |1|
7 _ | | _
8 _|1| _| |_ |1|_
9 _|1 | |1 1| | 1|_
10 _|1 | | | | 1|_
11 _|1 | _| |_ | 1|_
12 _|1 | |1 1| | 1|_
13 _|1 | | | | 1|_
14 _|1 | _| _ |_ | 1|_
15 |1 | |1 |1| 1| | 1|
.
The 15th row
of A249351 : [1,1,1,1,1,1,1,1,0,0,0,1,1,1,2,1,1,1,0,0,0,1,1,1,1,1,1,1,1]
The 15th row
of triangle: [ 8, 8, 8 ]
The 15th row
of A296508: [ 8, 7, 1, 0, 8 ]
The 15th row
of A280851 [ 8, 7, 1, 8 ]
.
More generally, for n >= 1, it appears there is the same correspondence between the original diagram of the symmetric representation of sigma(n) and the "Ziggurat" diagram of n.
For the definition of subparts see A239387 and also A296508, A280851. (End)
- Robert Price, Table of n, a(n) for n = 1..15542 (rows n = 1..5000, flattened)
- Hartmut F. W. Hoft, Sample visual documentation for Mathematica code
- Michel Marcus, A colored version of the symmetric representation of sigma(n), multipage, n = 1..85
- Omar E. Pol, An infinite stepped pyramid (A237593, A237270, A262626)
- Omar E. Pol, Perspective view of the stepped pyramid (16 levels)
- Omar E. Pol, Perspective view of the stepped pyramid into four quadrants (11 levels). This is formed by combing four copies of the pyramid back-to-back (cf. A244050).
- N. J. A. Sloane, Another drawing of the spiral
- N. J. A. Sloane, Spiral showing only the outer boundary
- Index entries for sequences related to sigma(n)
Cf.
A000203,
A004125,
A023196,
A024916,
A153485,
A196020,
A221529,
A231347,
A235791,
A235796,
A236104,
A236112,
A236540,
A237046,
A237048,
A237271,
A237590,
A237591,
A237593,
A239050,
A239660,
A239663,
A239665,
A239931,
A239932,
A239933,
A239934,
A240020,
A240062,
A244050,
A245092,
A249351,
A262626,
A280850,
A280851,
A296508,
A335616,
A340035,
A384149.
-
T[n_,k_] := Ceiling[(n + 1)/k - (k + 1)/2] (* from A235791 *)
path[n_] := Module[{c = Floor[(Sqrt[8n + 1] - 1)/2], h, r, d, rd, k, p = {{0, n}}}, h = Map[T[n, #] - T[n, # + 1] &, Range[c]]; r = Join[h, Reverse[h]]; d = Flatten[Table[{{1, 0}, {0, -1}}, {c}], 1];
rd = Transpose[{r, d}]; For[k = 1, k <= 2c, k++, p = Join[p, Map[Last[p] + rd[[k, 2]] * # &, Range[rd[[k, 1]]]]]]; p]
segments[n_] := SplitBy[Map[Min, Drop[Drop[path[n], 1], -1] - path[n - 1]], # == 0 &]
a237270[n_] := Select[Map[Apply[Plus, #] &, segments[n]], # != 0 &]
Flatten[Map[a237270, Range[40]]] (* data *)
(* Hartmut F. W. Hoft, Jun 23 2014 *)
Drawing of the spiral extended by
Omar E. Pol, Nov 22 2020
A135010
Triangle read by rows in which row n lists A000041(n-1) 1's followed by the list of juxtaposed lexicographically ordered partitions of n that do not contain 1 as a part.
Original entry on oeis.org
1, 1, 2, 1, 1, 3, 1, 1, 1, 2, 2, 4, 1, 1, 1, 1, 1, 2, 3, 5, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 3, 3, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 2, 5, 3, 4, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 2, 3, 3, 2, 6, 3, 5, 4, 4, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1
Triangle begins:
[1];
[1],[2];
[1],[1],[3];
[1],[1],[1],[2,2],[4];
[1],[1],[1],[1],[1],[2,3],[5];
[1],[1],[1],[1],[1],[1],[1],[2,2,2],[2,4],[3,3],[6];
...
From _Omar E. Pol_, Sep 03 2013: (Start)
Illustration of initial terms (n = 1..6). The table shows the six sections of the set of partitions of 6 in three ways. Note that before the dissection, the set of partitions was in the ordering mentioned in A026791. More generally, the six sections of the set of partitions of 6 also can be interpreted as the first six sections of the set of partitions of any integer >= 6.
---------------------------------------------------------
n j Diagram Parts Parts
---------------------------------------------------------
. _
1 1 |_| 1; 1;
. _
2 1 | |_ 1, 1,
2 2 |_ _| 2; 2;
. _
3 1 | | 1, 1,
3 2 | |_ _ 1, 1,
3 3 |_ _ _| 3; 3;
. _
4 1 | | 1, 1,
4 2 | | 1, 1,
4 3 | |_ _ _ 1, 1,
4 4 | |_ _| 2,2, 2,2,
4 5 |_ _ _ _| 4; 4;
. _
5 1 | | 1, 1,
5 2 | | 1, 1,
5 3 | | 1, 1,
5 4 | | 1, 1,
5 5 | |_ _ _ _ 1, 1,
5 6 | |_ _ _| 2,3, 2,3,
5 7 |_ _ _ _ _| 5; 5;
. _
6 1 | | 1, 1,
6 2 | | 1, 1,
6 3 | | 1, 1,
6 4 | | 1, 1,
6 5 | | 1, 1,
6 6 | | 1, 1,
6 7 | |_ _ _ _ _ 1, 1,
6 8 | | |_ _| 2,2,2, 2,2,2,
6 9 | |_ _ _ _| 2,4, 2,4,
6 10 | |_ _ _| 3,3, 3,3,
6 11 |_ _ _ _ _ _| 6; 6;
...
(End)
Cf.
A000041,
A026791,
A138121,
A141285,
A182703,
A187219,
A193870,
A194446,
A206437,
A207031,
A207383,
A207379,
A211009.
-
with(combinat):
T:= proc(m) local b, ll;
b:= proc(n, i, l)
if n=0 then ll:=ll, l[]
else seq(b(n-j, j, [l[], j]), j=i..n)
fi
end;
ll:= NULL; b(m, 2, []); [1$numbpart(m-1)][], ll
end:
seq(T(n), n=1..10); # Alois P. Heinz, Feb 19 2012
-
less[run1_, run2_] := (lg1 = run1 // Length; lg2 = run2 // Length; lg = Max[lg1, lg2]; r1 = If[lg1 == lg, run1, PadRight[run1, lg, 0]]; r2 = If[lg2 == lg, run2, PadRight[run2, lg, 0]]; Order[r1, r2] != -1); row[n_] := Join[ Array[1 &, {PartitionsP[n - 1]}], Sort[ Reverse /@ Select[ IntegerPartitions[n], FreeQ[#, 1] &], less] ] // Flatten; Table[row[n], {n, 1, 9}] // Flatten (* Jean-François Alcover, Jan 14 2013 *)
Table[Reverse@ConstantArray[{1}, PartitionsP[n - 1]]~Join~
DeleteCases[Sort@PadRight[Reverse/@Cases[IntegerPartitions[n], x_ /; Last[x] != 1]], x_ /; x == 0, 2], {n, 1, 9}] // Flatten (* Robert Price, May 12 2020 *)
A237591
Irregular triangle read by rows: T(n,k) is the difference between the total number of partitions of all positive integers <= n into exactly k consecutive parts, and the total number of partitions of all positive integers <= n into exactly k+1 consecutive parts (n>=1, 1<=k<=A003056(n)).
Original entry on oeis.org
1, 2, 2, 1, 3, 1, 3, 2, 4, 1, 1, 4, 2, 1, 5, 2, 1, 5, 2, 2, 6, 2, 1, 1, 6, 3, 1, 1, 7, 2, 2, 1, 7, 3, 2, 1, 8, 3, 1, 2, 8, 3, 2, 1, 1, 9, 3, 2, 1, 1, 9, 4, 2, 1, 1, 10, 3, 2, 2, 1, 10, 4, 2, 2, 1, 11, 4, 2, 1, 2, 11, 4, 3, 1, 1, 1, 12, 4, 2, 2, 1, 1, 12, 5, 2, 2, 1, 1, 13, 4, 3, 2, 1, 1, 13, 5, 3, 1, 2, 1, 14, 5, 2, 2, 2, 1
Offset: 1
Triangle begins:
1;
2;
2, 1;
3, 1;
3, 2;
4, 1, 1;
4, 2, 1;
5, 2, 1;
5, 2, 2;
6, 2, 1, 1;
6, 3, 1, 1;
7, 2, 2, 1;
7, 3, 2, 1;
8, 3, 1, 2;
8, 3, 2, 1, 1;
9, 3, 2, 1, 1;
9, 4, 2, 1, 1;
10, 3, 2, 2, 1;
10, 4, 2, 2, 1;
11, 4, 2, 1, 2;
11, 4, 3, 1, 1, 1;
12, 4, 2, 2, 1, 1;
12, 5, 2, 2, 1, 1;
13, 4, 3, 2, 1, 1;
13, 5, 3, 1, 2, 1;
14, 5, 2, 2, 2, 1;
14, 5, 3, 2, 1, 2;
15, 5, 3, 2, 1, 1, 1;
...
For n = 10 the 10th row of triangle A235791 is [10, 4, 2, 1] so row 10 is [6, 2, 1, 1].
From _Omar E. Pol_, Aug 23 2015: (Start)
Illustration of initial terms:
Row _
1 _|1|
2 _|2 _|
3 _|2 |1|
4 _|3 _|1|
5 _|3 |2 _|
6 _|4 _|1|1|
7 _|4 |2 |1|
8 _|5 _|2 _|1|
9 _|5 |2 |2 _|
10 _|6 _|2 |1|1|
11 _|6 |3 _|1|1|
12 _|7 _|2 |2 |1|
13 _|7 |3 |2 _|1|
14 _|8 _|3 _|1|2 _|
15 _|8 |3 |2 |1|1|
16 _|9 _|3 |2 |1|1|
17 _|9 |4 _|2 _|1|1|
18 _|10 _|3 |2 |2 |1|
19 _|10 |4 |2 |2 _|1|
20 _|11 _|4 _|2 |1|2 _|
21 _|11 |4 |3 _|1|1|1|
22 _|12 _|4 |2 |2 |1|1|
23 _|12 |5 _|2 |2 |1|1|
24 _|13 _|4 |3 |2 _|1|1|
25 _|13 |5 |3 _|1|2 |1|
26 _|14 _|5 _|2 |2 |2 _|1|
27 _|14 |5 |3 |2 |1|2 _|
28 |15 |5 |3 |2 |1|1|1|
...
Also the diagram represents the left part of the front view of the pyramid described in A245092. For the other half front view see A261350. For more information about the pyramid and the symmetric representation of sigma see A237593. (End)
From _Omar E. Pol_, Sep 08 2021: (Start)
For n = 12 the symmetric representation of sigma(12) in the fourth quadrant is as shown below:
. _
| |
| |
| |
| |
| |
_ _ _| |
_| _ _|
_| |
| _|
| _ _|1
_ _ _ _ _ _| | 2
|_ _ _ _ _ _ _|2
7
.
The lengths of the successive line segments from the first vertex to the central vertex of the largest Dyck path are [7, 2, 2, 1] respectively, the same as the 12th row of triangle. (End)
Cf.
A000203,
A001227,
A024916,
A196020,
A235791,
A236104,
A237048,
A237270,
A237271,
A237593,
A239660,
A239931-
A239934,
A240542,
A244580,
A245092,
A249351,
A259176,
A259177,
A261350,
A261699,
A262626,
A285356,
A286000,
A286001.
-
row[n_]:= Floor[(Sqrt[8*n+1] -1)/2]; f[n_,k_]:= Ceiling[(n+1)/k-(k+1)/2] - Ceiling[(n+1)/(k+1)-(k+2)/2];
Table[f[n,k],{n,1,50},{k,1,row[n]}]//Flatten
(* Hartmut F. W. Hoft, Apr 08 2014 *)
-
row235791(n) = vector((sqrtint(8*n+1)-1)\2, i, 1+(n-(i*(i+1)/2))\i);
row(n) = {my(orow = concat(row235791(n), 0)); vector(#orow -1, i, orow[i] - orow[i+1]);} \\ Michel Marcus, Mar 27 2014
-
from sympy import sqrt
import math
def T(n, k): return int(math.ceil((n + 1)/k - (k + 1)/2)) - int(math.ceil((n + 1)/(k + 1) - (k + 2)/2))
for n in range(1, 29): print([T(n, k) for k in range(1, int((sqrt(8*n + 1) - 1)/2) + 1)]) # Indranil Ghosh, Apr 30 2017
New name from a comment dated Apr 30 2017. -
Omar E. Pol, Jun 18 2023
A236104
Triangle read by rows: T(n,k), n >= 1, k >= 1, in which column k lists k copies of the positive squares in nondecreasing order, and the first element of column k is in row k(k+1)/2.
Original entry on oeis.org
1, 4, 9, 1, 16, 1, 25, 4, 36, 4, 1, 49, 9, 1, 64, 9, 1, 81, 16, 4, 100, 16, 4, 1, 121, 25, 4, 1, 144, 25, 9, 1, 169, 36, 9, 1, 196, 36, 9, 4, 225, 49, 16, 4, 1, 256, 49, 16, 4, 1, 289, 64, 16, 4, 1, 324, 64, 25, 9, 1, 361, 81, 25, 9, 1, 400, 81, 25, 9, 4
Offset: 1
Triangle begins:
1;
4;
9, 1;
16, 1;
25, 4;
36, 4, 1;
49, 9, 1;
64, 9, 1;
81, 16, 4;
100, 16, 4, 1;
121, 25, 4, 1;
144, 25, 9, 1;
169, 36, 9, 1;
196, 36, 9, 4;
225, 49, 16, 4, 1;
256, 49, 16, 4, 1;
289, 64, 16, 4, 1;
324, 64, 25, 9, 1;
361, 81, 25, 9, 1;
400, 81, 25, 9, 4;
441, 100, 36, 9, 4, 1;
484, 100, 36, 16, 4, 1;
529, 121, 36, 16, 4, 1;
576, 121, 49, 16, 4, 1;
...
For n = 6 the sum of all divisors of all positive integers <= 6 is [1] + [1+2] + [1+3] + [1+2+4] + [1+5] + [1+2+3+6] = 1 + 3 + 4 + 7 + 6 + 12 = 33. On the other hand the 6th row of triangle is 36, 4, 1, therefore the alternating row sum is 36 - 4 + 1 = 33, equaling the sum of all divisors of all positive integers <= 6.
Illustration of the alternating sum of the 6th row as the area of a polygon (or the number of cells), step by step, in the fourth quadrant:
. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
. | | | | | |
. | | | | | |
. | | | | | |
. | | | _ _| | _|
. | | | | | _|
. |_ _ _ _ _ _| |_ _ _ _| |_ _ _ _|
.
. 36 36 - 4 = 32 36 - 4 + 1 = 33
.
Then using this method we can draw a symmetric diagram for A000203, A024916, A004125, as shown below:
--------------------------------------------------
n A000203 A024916 Diagram
--------------------------------------------------
. _ _ _ _ _ _ _ _ _ _ _ _
1 1 1 |_| | | | | | | | | | | |
2 3 4 |_ _|_| | | | | | | | | |
3 4 8 |_ _| _|_| | | | | | | |
4 7 15 |_ _ _| _|_| | | | | |
5 6 21 |_ _ _| _| _ _|_| | | |
6 12 33 |_ _ _ _| _| | _ _|_| |
7 8 41 |_ _ _ _| |_ _|_| _ _|
8 15 56 |_ _ _ _ _| _| |* *
9 13 69 |_ _ _ _ _| | _|* *
10 18 87 |_ _ _ _ _ _| _ _|* * *
11 12 99 |_ _ _ _ _ _| |* * * * *
12 28 127 |_ _ _ _ _ _ _|* * * * *
.
The total number of cells in the first n set of symmetric regions of the diagram equals A024916(n). It appears that the total number of cells in the n-th set of symmetric regions of the diagram equals sigma(n) = A000203(n). Example: for n = 12 the 12th row of triangle is 144, 25, 9, 1, hence the alternating sums is 144 - 25 + 9 - 1 = 127. On the other hand we have that A000290(12) - A004125(12) = 144 - 17 = A024916(12) = 127, equaling the total number of cells in the diagram after 12 stages. The number of cells in the 12th set of symmetric regions of the diagram is sigma(12) = A000203(12) = 28. Note that in this case there is only one region. Finally, the number of *'s is A004125(12) = 17.
Note that the diagram is also the top view of the stepped pyramid described in A245092. - _Omar E. Pol_, Feb 12 2018
Cf.
A000203,
A000217,
A000290,
A001227,
A003056,
A008794,
A024916,
A004125,
A196020,
A211343,
A228813,
A231345,
A231347,
A235791,
A235794,
A235799,
A236106,
A236112,
A236540,
A237270,
A237591,
A237593,
A239660,
A244050,
A245092,
A262626,
A286000.
-
Table[Ceiling[(n + 1)/k - (k + 1)/2]^2, {n, 20}, {k, Floor[(Sqrt[8 n + 1] - 1)/2]}] // Flatten (* Michael De Vlieger, Feb 10 2018, after Hartmut F. W. Hoft at A235791 *)
-
from sympy import sqrt
import math
def T(n, k): return int(math.ceil((n + 1)/k - (k + 1)/2))
for n in range(1, 21): print([T(n, k)**2 for k in range(1, int(math.floor((sqrt(8*n + 1) - 1)/2)) + 1)]) # Indranil Ghosh, Apr 25 2017
A118914
Table of the prime signatures (sorted lists of exponents of distinct prime factors) of the positive integers.
Original entry on oeis.org
1, 1, 2, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 3, 1, 2, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 4, 2, 1, 2, 1, 1, 1, 2, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 6, 1, 1
Offset: 2
The table starts:
n : prime signature of n (factorization of n)
1 : {}, (empty product)
2 : {1}, (2^1)
3 : {1}, (3^1)
4 : {2}, (2^2)
5 : {1}, (5^1)
6 : {1, 1}, (2^1 * 3^1)
7 : {1}, (5^1)
8 : {3}, (2^3)
9 : {2}, (3^2)
10 : {1, 1}, (2^1 * 5^1)
11 : {1}, (11^1)
12 : {1, 2}, (2^2 * 3^1, but exponents are sorted increasingly)
etc.
-
import Data.List (sort)
a118914 n k = a118914_tabf !! (n-2) !! (k-1)
a118914_row n = a118914_tabf !! (n-2)
a118914_tabf = map sort $ tail a124010_tabf
-- Reinhard Zumkeller, Mar 23 2014
-
primeSignature[n_] := Sort[ FactorInteger[n] , #1[[2]] < #2[[2]]&][[All, 2]]; Flatten[ Table[ primeSignature[n], {n, 2, 65}]](* Jean-François Alcover, Nov 16 2011 *)
-
A118914_row(n)=vecsort(factor(n)[,2]~) \\ M. F. Hasler, Oct 12 2018
A235791
Irregular triangle read by rows: T(n,k), n >= 1, k >= 1, in which column k lists k copies of every positive integer in nondecreasing order, and the first element of column k is in row k(k+1)/2.
Original entry on oeis.org
1, 2, 3, 1, 4, 1, 5, 2, 6, 2, 1, 7, 3, 1, 8, 3, 1, 9, 4, 2, 10, 4, 2, 1, 11, 5, 2, 1, 12, 5, 3, 1, 13, 6, 3, 1, 14, 6, 3, 2, 15, 7, 4, 2, 1, 16, 7, 4, 2, 1, 17, 8, 4, 2, 1, 18, 8, 5, 3, 1, 19, 9, 5, 3, 1, 20, 9, 5, 3, 2, 21, 10, 6, 3, 2, 1, 22, 10, 6, 4, 2, 1, 23, 11, 6, 4, 2, 1, 24, 11, 7, 4, 2, 1
Offset: 1
Triangle begins:
1;
2;
3, 1;
4, 1;
5, 2;
6, 2, 1;
7, 3, 1;
8, 3, 1;
9, 4, 2;
10, 4, 2, 1;
11, 5, 2, 1;
12, 5, 3, 1;
13, 6, 3, 1;
14, 6, 3, 2;
15, 7, 4, 2, 1;
16, 7, 4, 2, 1;
17, 8, 4, 2, 1;
18, 8, 5, 3, 1;
19, 9, 5, 3, 1;
20, 9, 5, 3, 2;
21, 10, 6, 3, 2, 1;
22, 10, 6, 4, 2, 1;
23, 11, 6, 4, 2, 1;
24, 11, 7, 4, 2, 1;
25, 12, 7, 4, 3, 1;
26, 12, 7, 5, 3, 1;
27, 13, 8, 5, 3, 2;
28, 13, 8, 5, 3, 2, 1;
...
For n = 10 the 10th row of triangle is 10, 4, 2, 1, so we have that 10^2 - 4^2 + 2^2 - 1^2 = 100 - 16 + 4 - 1 = 87, the same as A024916(10) = 87, the sum of all divisors of all positive integers <= 10.
From _Omar E. Pol_, Nov 19 2015: (Start)
Illustration of initial terms in the third quadrant:
. y
Row _|
1 _|1|
2 _|2 _|
3 _|3 |1|
4 _|4 _|1|
5 _|5 |2 _|
6 _|6 _|2|1|
7 _|7 |3 |1|
8 _|8 _|3 _|1|
9 _|9 |4 |2 _|
10 _|10 _|4 |2|1|
11 _|11 |5 _|2|1|
12 _|12 _|5 |3 |1|
13 _|13 |6 |3 _|1|
14 _|14 _|6 _|3|2 _|
15 _|15 |7 |4 |2|1|
16 _|16 _|7 |4 |2|1|
17 _|17 |8 _|4 _|2|1|
18 _|18 _|8 |5 |3 |1|
19 _|19 |9 |5 |3 _|1|
20 _|20 _|9 _|5 |3|2 _|
21 _|21 |10 |6 _|3|2|1|
22 _|22 _|10 |6 |4 |2|1|
23 _|23 |11 _|6 |4 |2|1|
24 _|24 _|11 |7 |4 _|2|1|
25 _|25 |12 |7 _|4|3 |1|
26 _|26 _|12 _|7 |5 |3 _|1|
27 _|27 |13 |8 |5 |3|2 _|
28 |28 |13 |8 |5 |3|2|1|
...
T(n,k) is also the number of cells between the k-th vertical line segment (from left to right) and the y-axis in the n-th row of the structure.
Note that the number of horizontal line segments in the n-th row of the structure equals A001227(n), the number of odd divisors of n.
Also the diagram represents the left part of the front view of the pyramid described in A245092. (End)
For more information about the diagram see A286001. - _Omar E. Pol_, Dec 19 2020
From _Omar E. Pol_, Sep 08 2021: (Start)
For n = 12 the symmetric representation of sigma(12) in the fourth quadrant is as shown below:
_
| |
| |
| |
| |
| |
_ _ _| |
_| _ _|
_| |
| _|
| _ _|
_ _ _ _ _ _| |3 1
|_ _ _ _ _ _ _|
12 5
.
For n = 12 and k = 1 the total length of all line segments between the first vertex and the central vertex of the largest Dyck path is equal to 12, so T(12,1) = 12.
For n = 12 and k = 2 the total length of all line segments between the second vertex and the central vertex of the largest Dyck path is equal to 5, so T(12,2) = 5.
For n = 12 and k = 3 the total length of all line segments between the third vertex and the central vertex of the largest Dyck path is equal to 3, so T(12,3) = 3.
For n = 12 and k = 4 the total length of all line segments between the fourth vertex and the central vertex of the largest Dyck path is equal to 1, so T(12,4) = 1.
Hence the 12th row of triangle is [12, 5, 3, 1]. (End)
Cf.
A000203,
A000217,
A001227,
A196020,
A211343,
A228813,
A231345,
A231347,
A235794,
A236106,
A236112,
A237270,
A237271,
A237593,
A239660,
A245092,
A261699,
A262626,
A286000,
A286001,
A280850,
A280851,
A296508,
A335616.
-
row[n_] := Floor[(Sqrt[8*n + 1] - 1)/2]; f[n_, k_] := Ceiling[(n + 1)/k - (k + 1)/2]; Table[f[n, k], {n, 1, 150}, {k, 1, row[n]}] // Flatten (* Hartmut F. W. Hoft, Apr 07 2014 *)
-
row(n) = vector((sqrtint(8*n+1)-1)\2, i, 1+(n-(i*(i+1)/2))\i); \\ Michel Marcus, Mar 27 2014
-
from sympy import sqrt
import math
def T(n, k): return int(math.ceil((n + 1)/k - (k + 1)/2))
for n in range(1, 21): print([T(n, k) for k in range(1, int(math.floor((sqrt(8*n + 1) - 1)/2)) + 1)]) # Indranil Ghosh, Apr 25 2017
A196020
Irregular triangle read by rows: T(n,k), n >= 1, k >= 1, in which column k lists the odd numbers interleaved with k-1 zeros, and the first element of column k is in row k(k+1)/2.
Original entry on oeis.org
1, 3, 5, 1, 7, 0, 9, 3, 11, 0, 1, 13, 5, 0, 15, 0, 0, 17, 7, 3, 19, 0, 0, 1, 21, 9, 0, 0, 23, 0, 5, 0, 25, 11, 0, 0, 27, 0, 0, 3, 29, 13, 7, 0, 1, 31, 0, 0, 0, 0, 33, 15, 0, 0, 0, 35, 0, 9, 5, 0, 37, 17, 0, 0, 0, 39, 0, 0, 0, 3, 41, 19, 11, 0, 0, 1, 43, 0, 0, 7, 0, 0, 45, 21, 0, 0, 0, 0, 47, 0, 13, 0, 0, 0
Offset: 1
Triangle begins:
1;
3;
5, 1;
7, 0;
9, 3;
11, 0, 1;
13, 5, 0;
15, 0, 0;
17, 7, 3;
19, 0, 0, 1;
21, 9, 0, 0;
23, 0, 5, 0;
25, 11, 0, 0;
27, 0, 0, 3;
29, 13, 7, 0, 1;
31, 0, 0, 0, 0;
33, 15, 0, 0, 0;
35, 0, 9, 5, 0;
37, 17, 0, 0, 0;
39, 0, 0, 0, 3;
41, 19, 11, 0, 0, 1;
43, 0, 0, 7, 0, 0;
45, 21, 0, 0, 0, 0;
47, 0, 13, 0, 0, 0;
49, 23, 0, 0, 5, 0;
51, 0, 0, 9, 0, 0;
53, 25, 15, 0, 0, 3;
55, 0, 0, 0, 0, 0, 1;
...
For n = 15 the divisors of 15 are 1, 3, 5, 15, so the sum of divisors of 15 is 1 + 3 + 5 + 15 = 24. On the other hand, the 15th row of the triangle is 29, 13, 7, 0, 1, so the alternating row sum is 29 - 13 + 7 - 0 + 1 = 24, equaling the sum of divisors of 15.
If n is even then the alternating sum of the n-th row is simpler to evaluate than the sum of divisors of n. For example the sum of divisors of 24 is 1 + 2 + 3 + 4 + 6 + 8 + 12 + 24 = 60, and the alternating sum of the 24th row of triangle is 47 - 0 + 13 - 0 + 0 - 0 = 60.
From _Omar E. Pol_, Nov 24 2020: (Start)
For an illustration of the rows of triangle consider the infinite "double-staircases" diagram defined in A335616 (see also the theorem there).
For n = 15 the diagram with first 15 levels looks like this:
.
Level "Double-staircases" diagram
. _
1 _|1|_
2 _|1 _ 1|_
3 _|1 |1| 1|_
4 _|1 _| |_ 1|_
5 _|1 |1 _ 1| 1|_
6 _|1 _| |1| |_ 1|_
7 _|1 |1 | | 1| 1|_
8 _|1 _| _| |_ |_ 1|_
9 _|1 |1 |1 _ 1| 1| 1|_
10 _|1 _| | |1| | |_ 1|_
11 _|1 |1 _| | | |_ 1| 1|_
12 _|1 _| |1 | | 1| |_ 1|_
13 _|1 |1 | _| |_ | 1| 1|_
14 _|1 _| _| |1 _ 1| |_ |_ 1|_
15 |1 |1 |1 | |1| | 1| 1| 1|
.
The first largest double-staircase has 29 horizontal steps, the second double-staircase has 13 steps, the third double-staircase has 7 steps, and the fifth double-staircases has only one step. Note that the fourth double-staircase does not count because it does not have horizontal steps in the 15th level, so the 15th row of triangle is [29, 13, 7, 0, 1].
For a connection with the "Ziggurat" diagram and the parts and subparts of the symmetric representation of sigma(15) see also A237270. (End)
Cf.
A000203,
A000217,
A001227,
A001318,
A003056,
A211343,
A212119,
A228813,
A231345,
A231347,
A235791,
A235794,
A236104,
A236106,
A236112,
A237048,
A237271,
A237591,
A237593,
A238005,
A239660,
A244050,
A245092,
A261699,
A262626,
A286000,
A286001,
A280850,
A335616,
A338721.
-
T_row := proc(n) local T;
T := (n, k) -> if modp(n-k/2, k) = 0 and n >= k*(k+1)/2 then 2*n/k-k else 0 fi;
seq(T(n,k), k=1..floor((sqrt(8*n+1)-1)/2)) end:
seq(print(T_row(n)),n=1..24); # Peter Luschny, Oct 27 2015
-
T[n_, k_] := If[Mod[n - k*(k+1)/2, k] == 0 ,2*n/k - k, 0]
row[n_] := Floor[(Sqrt[8n+1]-1)/2]
line[n_] := Map[T[n, #]&, Range[row[n]]]
a196020[m_, n_] := Map[line, Range[m, n]]
Flatten[a196020[1,22]] (* data *)
(* Hartmut F. W. Hoft, Oct 26 2015 *)
A196020row = Function[n,Table[If[Divisible[Numerator[n-k/2],k] && CoprimeQ[ Denominator[n- k/2], k],2*n/k-k,0],{k,1,Floor[(Sqrt[8 n+1]-1)/2]}]]
Flatten[Table[A196020row[n], {n,1,24}]] (* Peter Luschny, Oct 28 2015 *)
-
def T(n,k):
q = (2*n-k)/2
b = k.divides(q.numerator()) and gcd(k,q.denominator()) == 1
return 2*n/k - k if b else 0
for n in (1..24): [T(n, k) for k in (1..floor((sqrt(8*n+1)-1)/2))] # Peter Luschny, Oct 28 2015
A238279
Triangle read by rows: T(n,k) is the number of compositions of n into nonzero parts with k parts directly followed by a different part, n>=0, 0<=k<=A004523(n-1).
Original entry on oeis.org
1, 1, 2, 2, 2, 3, 4, 1, 2, 10, 4, 4, 12, 14, 2, 2, 22, 29, 10, 1, 4, 26, 56, 36, 6, 3, 34, 100, 86, 31, 2, 4, 44, 148, 200, 99, 16, 1, 2, 54, 230, 374, 278, 78, 8, 6, 58, 322, 680, 654, 274, 52, 2, 2, 74, 446, 1122, 1390, 814, 225, 22, 1, 4, 88, 573, 1796, 2714, 2058, 813, 136, 10, 4, 88, 778, 2694, 4927
Offset: 0
Triangle starts:
00: 1;
01: 1;
02: 2;
03: 2, 2;
04: 3, 4, 1;
05: 2, 10, 4;
06: 4, 12, 14, 2;
07: 2, 22, 29, 10, 1;
08: 4, 26, 56, 36, 6;
09: 3, 34, 100, 86, 31, 2;
10: 4, 44, 148, 200, 99, 16, 1;
11: 2, 54, 230, 374, 278, 78, 8;
12: 6, 58, 322, 680, 654, 274, 52, 2;
13: 2, 74, 446, 1122, 1390, 814, 225, 22, 1;
14: 4, 88, 573, 1796, 2714, 2058, 813, 136, 10;
15: 4, 88, 778, 2694, 4927, 4752, 2444, 618, 77, 2;
16: 5, 110, 953, 3954, 8531, 9930, 6563, 2278, 415, 28, 1;
...
Row n=5 is 2, 10, 4 because in the 16 compositions of 5
##: [composition] no. of changes
01: [ 1 1 1 1 1 ] 0
02: [ 1 1 1 2 ] 1
03: [ 1 1 2 1 ] 2
04: [ 1 1 3 ] 1
05: [ 1 2 1 1 ] 2
06: [ 1 2 2 ] 1
07: [ 1 3 1 ] 2
08: [ 1 4 ] 1
09: [ 2 1 1 1 ] 1
10: [ 2 1 2 ] 2
11: [ 2 2 1 ] 1
12: [ 2 3 ] 1
13: [ 3 1 1 ] 1
14: [ 3 2 ] 1
15: [ 4 1 ] 1
16: [ 5 ] 0
there are 2 with no changes, 10 with one change, and 4 with two changes.
Columns k=0-10 give:
A000005 (for n>0), 2*
A002133,
A244714,
A244715,
A244716,
A244717,
A244718,
A244719,
A244720,
A244721,
A244722.
The version counting adjacent equal parts is
A106356.
The version for ascents/descents is
A238343.
The version for weak ascents/descents is
A333213.
The k-th composition in standard-order has
A124762(k) adjacent equal parts,
A124767(k) maximal runs,
A333382(k) adjacent unequal parts, and
A333381(k) maximal anti-runs.
-
b:= proc(n, v) option remember; `if`(n=0, 1, expand(
add(b(n-i, i)*`if`(v=0 or v=i, 1, x), i=1..n)))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
seq(T(n), n=0..14);
-
b[n_, v_] := b[n, v] = If[n == 0, 1, Expand[Sum[b[n-i, i]*If[v == 0 || v == i, 1, x], {i, 1, n}]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0]]; Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Feb 11 2015, after Maple *)
Table[If[n==0,1,Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[Split[#]]==k+1&]]],{n,0,12},{k,0,If[n==0,0,Floor[2*(n-1)/3]]}] (* Gus Wiseman, Apr 10 2020 *)
-
T_xy(max_row) = {my(N=max_row+1, x='x+O('x^N),h=(1+ sum(i=1,N,(x^i-y*x^i)/(1+y*x^i-x^i)))/(1-sum(i=1,N, y*x^i/(1+y*x^i-x^i)))); for(n=0,N-1, print(Vecrev(polcoeff(h,n))))}
T_xy(16) \\ John Tyler Rascoe, Jul 10 2024
A027748
Irregular triangle in which first row is 1, n-th row (n > 1) lists distinct prime factors of n.
Original entry on oeis.org
1, 2, 3, 2, 5, 2, 3, 7, 2, 3, 2, 5, 11, 2, 3, 13, 2, 7, 3, 5, 2, 17, 2, 3, 19, 2, 5, 3, 7, 2, 11, 23, 2, 3, 5, 2, 13, 3, 2, 7, 29, 2, 3, 5, 31, 2, 3, 11, 2, 17, 5, 7, 2, 3, 37, 2, 19, 3, 13, 2, 5, 41, 2, 3, 7, 43, 2, 11, 3, 5, 2, 23, 47, 2, 3, 7, 2, 5, 3, 17, 2, 13, 53, 2, 3, 5, 11, 2, 7, 3, 19, 2, 29, 59, 2, 3, 5, 61, 2, 31
Offset: 1
Triangle begins:
1;
2;
3;
2;
5;
2, 3;
7;
2;
3;
2, 5;
11;
2, 3;
13;
2, 7;
...
-
import Data.List (unfoldr)
a027748 n k = a027748_tabl !! (n-1) !! (k-1)
a027748_tabl = map a027748_row [1..]
a027748_row 1 = [1]
a027748_row n = unfoldr fact n where
fact 1 = Nothing
fact x = Just (p, until ((> 0) . (`mod` p)) (`div` p) x)
where p = a020639 x -- smallest prime factor of x
-- Reinhard Zumkeller, Aug 27 2011
-
with(numtheory): [ seq(factorset(n), n=1..100) ];
-
Flatten[ Table[ FactorInteger[n][[All, 1]], {n, 1, 62}]](* Jean-François Alcover, Oct 10 2011 *)
-
print1(1);for(n=2,20,f=factor(n)[,1];for(i=1,#f,print1(", "f[i]))) \\ Charles R Greathouse IV, Mar 20 2013
-
from sympy import primefactors
for n in range(2, 101):
print([i for i in primefactors(n)]) # Indranil Ghosh, Mar 31 2017
More terms from Scott Lindhurst (ScottL(AT)alumni.princeton.edu)
Comments