login
Triangle read by rows: T(n,k) = A000040(k) if A002445(n) mod A000040(k) = 0, otherwise 1.
4

%I #25 Aug 28 2017 08:12:09

%S 1,2,3,2,3,5,2,3,1,7,2,3,5,1,1,2,3,1,1,11,1,2,3,5,7,1,13,1,2,3,1,1,1,

%T 1,1,1,2,3,5,1,1,1,17,1,1,2,3,1,7,1,1,1,19,1,1,2,3,5,1,11,1,1,1,1,1,1,

%U 2,3,1,1,1,1,1,1,23,1,1,1,2,3,5,7,1,13,1,1,1,1,1,1,1,2,3,1,1,1,1,1,1,1,1,1

%N Triangle read by rows: T(n,k) = A000040(k) if A002445(n) mod A000040(k) = 0, otherwise 1.

%C Row products give A002445.

%C A prime number appears in a column at every A130290-th row from the (A130290+1)-th row onwards. The prime numbers are, so to speak, equidistantly distributed in the columns. A130290 is essentially A005097. Counting terms > 1 in the rows gives A046886.

%H Michel Marcus, <a href="/A138239/b138239.txt">Rows n=0..100 of triangle, flattened</a>

%e First few rows of the triangle and row products are:

%e 1 = 1

%e 2*3 = 6

%e 2*3*5 = 30

%e 2*3*1*7 = 42

%e 2*3*5*1*1 = 30

%e 2*3*1*1*11*1 = 66

%e 2*3*5*7*1*13*1 = 2730

%p T:= (n, k)-> (p-> `if`(irem(denom(bernoulli(2*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 t[n_, k_] := If[Mod[Denominator[BernoulliB[2n]], (p = Prime[k])] == 0, p, 1];

%t Flatten[Table[t[n, k], {n, 0, 13}, {k, 1, n+1}]][[1 ;; 102]] (* _Jean-François Alcover_, Jun 16 2011 *)

%o (PARI) tabl(nn) = {for (n=0, nn, dbn = denominator(bernfrac(2*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. A002445, A005097, A046886, A130290.

%K nonn,tabl

%O 0,2

%A _Mats Granvik_, Mar 07 2008

%E Definition edited by _N. J. A. Sloane_, Mar 18 2010

%E Offset corrected by _Alois P. Heinz_, Aug 27 2017