%I #22 Mar 22 2024 17:43:09
%S 1,2,1,3,2,1,4,3,0,1,5,4,2,0,1,6,5,0,0,0,1,7,6,3,2,0,0,1,8,7,0,0,0,0,
%T 0,1,9,8,4,0,2,0,0,0,1,10,9,0,3,0,0,0,0,0,1,11,10,5,0,0,2,0,0,0,0,1,
%U 12,11,0,0,0,0,0,0,0,0,0,1,13,12,6,4,3,0,2,0,0,0,0,0,1
%N Triangle T(n, k) = n/k if n mod k = 0, otherwise T(n, k) = 0, with T(n, 0) = n+1, read by rows.
%C Apparently this is different from A141672. - _N. J. A. Sloane_, Sep 13 2008
%C For n, k >= 1 this triangle is the same as A126988(n, k). - _G. C. Greubel_, Mar 16 2024
%H G. C. Greubel, <a href="/A141671/b141671.txt">Rows n = 0..100 of the triangle, flattened</a>
%F T(n, k) = n/k if n mod k = 0, otherwise T(n, k) = 0, with T(n, 0) = n+1.
%e Triangle begins as:
%e 1;
%e 2, 1;
%e 3, 2, 1;
%e 4, 3, 0, 1;
%e 5, 4, 2, 0, 1;
%e 6, 5, 0, 0, 0, 1;
%e 7, 6, 3, 2, 0, 0, 1;
%e 8, 7, 0, 0, 0, 0, 0, 1;
%e 9, 8, 4, 0, 2, 0, 0, 0, 1;
%e 10, 9, 0, 3, 0, 0, 0, 0, 0, 1;
%e 11, 10, 5, 0, 0, 2, 0, 0, 0, 0, 1;
%t T[n_, k_]= If[k==0, n+1, If[Mod[n,k]==0, n/k, 0]];
%t Table[T[n, k], {n,0,15}, {k,0,n}]//Flatten
%o (PARI) T(m,n)={if(m, if(n%m, 0, n/m), n+1)};
%o for(n=0, 10, for(m=0, n, print1(T(m,n)","))) \\ _Charles R Greathouse IV_, Oct 11 2009
%o (Magma)
%o A141671:= func< n,k | k eq 0 select n+1 else (n mod k) eq 0 select n/k else 0>;
%o [A141671(n,k): k in [0..n], n in [0..15]]; // _G. C. Greubel_, Mar 16 2024
%o (SageMath)
%o def A141671(n, k):
%o if k==0: return n+1
%o elif (n%k==0): return n//k
%o else: return 0
%o flatten([[A141671(n,k) for k in range(n+1)] for n in range(13)]) # _G. C. Greubel_, Mar 16 2024
%Y Cf. A126988, A141672.
%K nonn,easy,tabl
%O 0,2
%A _Roger L. Bagula_ and _Gary W. Adamson_ and _Mats Granvik_, Sep 06 2008
%E Edited by _G. C. Greubel_, Mar 16 2024
|