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.

A067255 Irregular triangle read by rows: row n gives exponents in prime factorization of n.

This page as a plain text file.
%I A067255 #43 May 27 2025 10:32:43
%S A067255 0,1,0,1,2,0,0,1,1,1,0,0,0,1,3,0,2,1,0,1,0,0,0,0,1,2,1,0,0,0,0,0,1,1,
%T A067255 0,0,1,0,1,1,4,0,0,0,0,0,0,1,1,2,0,0,0,0,0,0,0,1,2,0,1,0,1,0,1,1,0,0,
%U A067255 0,1,0,0,0,0,0,0,0,0,1,3,1,0,0,2,1,0,0,0,0,1,0,3,2,0,0,1,0,0,0,0,0,0,0,0,0,1
%N A067255 Irregular triangle read by rows: row n gives exponents in prime factorization of n.
%C A067255 Row lengths are given by A061395(n), n >= 2: [1, 2, 1, 3, 2, 4, 1, 2, ... ].
%C A067255 This sequence contains every finite sequence of nonnegative integers. - _Franklin T. Adams-Watters_, Jun 22 2005
%H A067255 Reinhard Zumkeller, <a href="/A067255/b067255.txt">Rows n = 1..250 of triangle, flattened</a>
%H A067255 Jeppe Stig Nielsen, <a href="http://jeppesn.dk/prim-eksp.text">See this explanation.</a>
%e A067255 1 = 2^0
%e A067255 2 = 2^1
%e A067255 3 = 2^0 3^1
%e A067255 4 = 2^2
%e A067255 5 = 2^0 3^0 5^1
%e A067255 6 = 2^1 3^1
%e A067255 ... and reading the exponents gives the sequence.
%e A067255 Since for example 99=2^0*3^2*5^0*7^0*11^1, we use this symbol for ninety-nine: 99: {0,2,0,0,1}. Concatenating all the symbols for 1,2,3,4,5,6,..., we get the sequence.
%t A067255 f[n_] := If[n == 1, {0}, Function[f, ReplacePart[Table[0, {PrimePi[f[[-1, 1]]]}], #] &@ Map[PrimePi@ First@ # -> Last@ # &, f]]@ FactorInteger@ n]; Array[f, 29] // Flatten (* _Michael De Vlieger_, Mar 08 2019 *)
%o A067255 (Haskell)
%o A067255 a067255 n k = a067255_tabf !! (n-1) !! (k-1)
%o A067255 a067255_row 1 = [0]
%o A067255 a067255_row n = f n a000040_list where
%o A067255    f 1 _      = []
%o A067255    f u (p:ps) = g u 0 where
%o A067255      g v e = if m == 0 then g v' (e + 1) else e : f v ps
%o A067255              where (v',m) = divMod v p
%o A067255 a067255_tabf = map a067255_row [1..]
%o A067255 -- _Reinhard Zumkeller_, Jun 11 2013
%Y A067255 Cf. A133457.
%Y A067255 Cf. A001222 (row sums), A061395 (lengths of rows n >= 2).
%Y A067255 Cf. A007814 (left edge), A071178 (right edge).
%Y A067255 Other versions: A054841 (rows reversed and concatenated into a decimal number), A060175 (square array), A082786 (regular triangle), A124010 (with 0's removed, excepting row 1), A143078 (another irregular triangle).
%K A067255 easy,nonn,tabf
%O A067255 1,5
%A A067255 _Jeppe Stig Nielsen_, Feb 20 2002