A258207 Square array: row n gives the numbers remaining after the stage n of Lucky sieve.
1, 3, 1, 5, 3, 1, 7, 7, 3, 1, 9, 9, 7, 3, 1, 11, 13, 9, 7, 3, 1, 13, 15, 13, 9, 7, 3, 1, 15, 19, 15, 13, 9, 7, 3, 1, 17, 21, 21, 15, 13, 9, 7, 3, 1, 19, 25, 25, 21, 15, 13, 9, 7, 3, 1, 21, 27, 27, 25, 21, 15, 13, 9, 7, 3, 1, 23, 31, 31, 31, 25, 21, 15, 13, 9, 7, 3, 1, 25, 33, 33, 33, 31, 25, 21, 15, 13, 9, 7, 3, 1, 27, 37, 37, 37, 33, 31, 25, 21, 15, 13, 9, 7, 3, 1, 29, 39, 43, 43, 37, 33, 31, 25, 21, 15, 13, 9, 7, 3, 1
Offset: 1
Examples
The top left corner of the array: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39 1, 3, 7, 9, 13, 15, 19, 21, 25, 27, 31, 33, 37, 39, 43, 45, 49, 51, 55, 57 1, 3, 7, 9, 13, 15, 21, 25, 27, 31, 33, 37, 43, 45, 49, 51, 55, 57, 63, 67 1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 45, 49, 51, 55, 63, 67, 69, 73 1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 49, 51, 55, 63, 67, 69, 73, 75 1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 49, 51, 63, 67, 69, 73, 75, 79 ... To get row 2 from row 1, we use the second term of the first row, which is 3, to remove every third term from row 1: 5, 11, 17, ... which leaves 1, 3, 7, 9, 13, ... To get row 3 from row 2, we use the third term of row 2, which is 7, to remove every seventh term from row 2: 19, 39, ... which then results in the third row.
Links
Crossrefs
Programs
-
Scheme
(define (A258207 n) (A258207bi (A002260 n) (A004736 n))) (define (A258207bi row col) ((rowfun_n_for_A000959sieve row) col)) ;; Uses definec-macro which can memoize also function-closures: (definec (rowfun_n_for_A000959sieve n) (if (= 1 n) A005408shifted (let* ((prevrowfun (rowfun_n_for_A000959sieve (- n 1))) (everynth (prevrowfun n))) (compose-funs prevrowfun (nonzero-pos 1 1 (lambda (i) (modulo i everynth))))))) (define (A005408shifted n) (- (* 2 n) 1))
Comments