[go: up one dir, main page]

login
A141671
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.
2
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, 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, 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
OFFSET
0,2
COMMENTS
Apparently this is different from A141672. - N. J. A. Sloane, Sep 13 2008
For n, k >= 1 this triangle is the same as A126988(n, k). - G. C. Greubel, Mar 16 2024
FORMULA
T(n, k) = n/k if n mod k = 0, otherwise T(n, k) = 0, with T(n, 0) = n+1.
EXAMPLE
Triangle begins as:
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, 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;
MATHEMATICA
T[n_, k_]= If[k==0, n+1, If[Mod[n, k]==0, n/k, 0]];
Table[T[n, k], {n, 0, 15}, {k, 0, n}]//Flatten
PROG
(PARI) T(m, n)={if(m, if(n%m, 0, n/m), n+1)};
for(n=0, 10, for(m=0, n, print1(T(m, n)", "))) \\ Charles R Greathouse IV, Oct 11 2009
(Magma)
A141671:= func< n, k | k eq 0 select n+1 else (n mod k) eq 0 select n/k else 0>;
[A141671(n, k): k in [0..n], n in [0..15]]; // G. C. Greubel, Mar 16 2024
(SageMath)
def A141671(n, k):
if k==0: return n+1
elif (n%k==0): return n//k
else: return 0
flatten([[A141671(n, k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Mar 16 2024
CROSSREFS
Sequence in context: A334441 A278104 A141672 * A309596 A335442 A226247
KEYWORD
nonn,easy,tabl
AUTHOR
EXTENSIONS
Edited by G. C. Greubel, Mar 16 2024
STATUS
approved