OFFSET
1,4
COMMENTS
LINKS
Antti Karttunen, Rows 1..10 of the table, flattened
Kival Ngaokrajang, Illustration for n = 1..10
EXAMPLE
Row n of this irregular triangle is obtained by taking the first A003418(n) = lcm(1..n) terms (up to and including the first zero) of the following array (which starts at row n=1 and column k=1 and is periodic in each row):
0; 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0; 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
2 2 1 1 3 0; 2 2 1 1 3 0 2 2 1 1 3 0 2 2 # A110269
3 4 4 1 4 2 5 2 2 3 6 0; 3 4 4 1 4 2 5 2
4 6 7 5 4 3 7 5 6 3 7 2 6 8 4 2 6 5 9 2
5 8 10 9 9 3 8 7 9 7 12 2 7 10 7 6 11 5 10 4
6 10 13 13 14 9 8 8 11 10 16 7 13 10 8 8 14 9 15 10
7 12 16 17 19 15 15 8 12 12 19 11 18 16 15 8 15 11 18 14
8 14 19 21 24 21 22 16 12 13 21 14 22 21 21 15 23 11 19 16
9 16 22 25 29 27 29 24 21 13 22 16 25 25 26 21 30 19 28 16
PROG
(Small Basic)
For n = 1 to 20
k = 1
loop:
rs = 0
For i = 1 To n
rs = rs + math.Remainder(k, i)
EndFor
TextWindow.Write(rs+", ")
If rs > 0 then
k = k + 1
Goto loop
EndIf
EndFor
(Scheme)
(define (A238280tabf n k) (add (lambda (i) (modulo k i)) 1 n))
;; Implements sum_{i=lowlim..uplim} intfun(i):
(define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
;; Antti Karttunen, Feb 27 2014
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Kival Ngaokrajang, Feb 22 2014
STATUS
approved