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.

A027746 Irregular triangle in which first row is 1, n-th row (n>1) gives prime factors of n with repetition.

This page as a plain text file.
%I A027746 #71 Jul 02 2025 16:01:55
%S A027746 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,
%T A027746 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,
%U A027746 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
%N A027746 Irregular triangle in which first row is 1, n-th row (n>1) gives prime factors of n with repetition.
%C A027746 n-th row has length A001222(n) (n>1).
%H A027746 N. J. A. Sloane, <a href="/A027746/b027746.txt">First 2048 rows of triangle, flattened</a>
%H A027746 S. von Worley (?), <a href="http://www.datapointed.net/visualizations/math/factorization/animated-diagrams/">Animated Factorization Diagrams</a>, Oct. 2012.
%H A027746 Brent Yorgey, <a href="https://mathlesstraveled.com/2012/10/05/factorization-diagrams/">Factorization diagrams</a>, The Math Less Traveled, Oct 05 2012.
%F A027746 Product_{k=1..A001222(n)} T(n,k) = n.
%F A027746 From _Reinhard Zumkeller_, Aug 27 2011: (Start)
%F A027746 A001414(n) = Sum_{k=1..A001222(n)} T(n,k), n>1;
%F A027746 A006530(n) = T(n,A001222(n)) = Max_{k=1..A001222(n)} T(n,k);
%F A027746 A020639(n) = T(n,1) = Min_{k=1..A001222(n)} T(n,k). (End)
%e A027746 Triangle begins
%e A027746   1;
%e A027746   2;
%e A027746   3;
%e A027746   2, 2;
%e A027746   5;
%e A027746   2, 3;
%e A027746   7;
%e A027746   2, 2, 2;
%e A027746   3, 3;
%e A027746   2, 5;
%e A027746   11;
%e A027746   2, 2, 3;
%e A027746   ...
%p A027746 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
%t A027746 row[n_] := Flatten[ Table[#[[1]], {#[[2]]}] & /@ FactorInteger[n]]; Flatten[ Table[ row[n], {n, 1, 45}]] (* _Jean-François Alcover_, Dec 01 2011 *)
%o A027746 (Haskell)
%o A027746 import Data.List (unfoldr)
%o A027746 a027746 n k = a027746_tabl !! (n-1) !! (k-1)
%o A027746 a027746_tabl = map a027746_row [1..]
%o A027746 a027746_row 1 = [1]
%o A027746 a027746_row n = unfoldr fact n where
%o A027746    fact 1 = Nothing
%o A027746    fact x = Just (p, x `div` p) where p = a020639 x
%o A027746 -- _Reinhard Zumkeller_, Aug 27 2011
%o A027746 (PARI) 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
%o A027746 (Sage) v=[1]
%o A027746 for k in [2..45]: v.extend(p for (p, m) in factor(k) for _ in range(m))
%o A027746 print(v) # _Giuseppe Coppoletta_, Dec 29 2017
%o A027746 (Python)
%o A027746 def factors(n: int) -> list[int]:
%o A027746     p = n
%o A027746     L:list[int] = []
%o A027746     for f in range(2, p + 1):
%o A027746         if f * f > p: break
%o A027746         while True:
%o A027746             q, r = divmod(p, f)
%o A027746             if r != 0: break
%o A027746             L.append(f)
%o A027746             p = q
%o A027746             if p == 1: return L
%o A027746     L.append(p)
%o A027746     return L  # _Peter Luschny_, Jul 18 2024
%Y A027746 Cf. A000027, A001222, A027748.
%Y A027746 a(A022559(A000040(n))+1) = A000040(n).
%Y A027746 Column 1 is A020639, columns 2 and 3 correspond to A014673 and A115561.
%Y A027746 A281890 measures frequency of each prime in each column, with A281889 giving median values.
%Y A027746 Cf. A175943 (partial products), A265110 (partial row products), A265111.
%K A027746 nonn,easy,nice,tabf
%O A027746 1,2
%A A027746 _Maghraoui Abdelkader_
%E A027746 More terms from _James Sellers_