%I #20 Aug 28 2017 08:10:33
%S 1,2,1,2,3,1,1,1,1,1,2,3,5,1,1,1,1,1,1,1,1,2,3,1,7,1,1,1,1,1,1,1,1,1,
%T 1,1,2,3,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,1,1,11,1,1,1,1,1,1,1,1,
%U 1,1,1,1,1,1,1,1,1,1,2,3,5,7,1,13,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
%N Triangle read by rows: Row products give A027642.
%C Except for the first column, the n-th prime number appears in every A006093(n)-th row, beginning at the A000040(n)-th row, in the n-th column.
%H Michel Marcus, <a href="/A138243/b138243.txt">Rows n=0..100 of triangle, flattened</a>
%F T(n,k) = A000040(k) if A027642(n) mod A000040(k) = 0, 1 otherwise.
%e Row products of the first few rows are:
%e 1 = 1
%e 2*1 = 2
%e 2*3*1 = 6
%e 1*1*1*1 = 1
%e 2*3*5*1*1 = 30
%e 1*1*1*1*1*1 = 1
%e 2*3*1*7*1*1*1 = 42
%e 1*1*1*1*1*1*1*1 = 1
%e 2*3*5*1*1*1*1*1*1 = 30
%p T:= (n, k)-> (p-> `if`(irem(denom(bernoulli(n)), p)=0, p, 1))(ithprime(k)):
%p seq(seq(T(n, k), k=1..n+1), n=0..20); # _Alois P. Heinz_, Aug 27 2017
%t Table[With[{p = Prime@ k}, p Boole[Divisible[Denominator@ BernoulliB[n - 1], p]]] /. 0 -> 1, {n, 14}, {k, n}] // Flatten (* _Michael De Vlieger_, Aug 27 2017 *)
%o (PARI) tabl(nn) = {for (n=0, nn, dbn = denominator(bernfrac(n)); for (k=1, n+1, if (! (dbn % prime(k)), w = prime(k), w = 1); print1(w, ", "); ); print; ); } \\ _Michel Marcus_, Aug 27 2017
%Y Cf. A006093, A027642.
%K nonn,tabl
%O 0,2
%A _Mats Granvik_, Mar 08 2008
%E Offset corrected by _Alois P. Heinz_, Aug 27 2017