login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Square array A(row,col) = B(row,(2*col)-1), where B(p,2q-1) = 0 if gcd(p,2q-1) > 1, and A269158(p,q) otherwise. Array is read by descending antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...
6

%I #22 Feb 28 2016 07:56:20

%S 0,0,1,0,2,1,0,7,0,0,0,4,3,0,1,0,13,3,0,2,0,0,14,0,0,0,0,1,0,11,1,0,2,

%T 4,0,1,0,8,1,0,1,7,7,2,1,0,25,0,0,1,0,0,7,0,0,0,26,3,0,6,15,5,4,0,0,1,

%U 0,31,3,0,0,10,3,13,4,0,2,1,0,28,0,0,6,0,2,14,0,6,0,0,1,0,21,1,0,1,26,7,11,4,12,0,3,0,0

%N Square array A(row,col) = B(row,(2*col)-1), where B(p,2q-1) = 0 if gcd(p,2q-1) > 1, and A269158(p,q) otherwise. Array is read by descending antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

%C The array gives the values of bivariate function B(p,q) which is well-defined only when q is odd, thus while here its argument p obtains all integer values from 1 onward, argument q gets only odd numbers 1, 3, 5, 7, 9, ... as its values.

%C Any row n occurs also as row (4^k * n), for all k >= 0.

%H Antti Karttunen, <a href="/A268728/b268728.txt">Table of n, a(n) for n = 1..32896; the first 256 antidiagonals of the array</a>

%F A(row,col) = B(row,(2*col)-1), where function B(p,q) [only odd values allowed for q] is defined as: If gcd(p,q) > 1, B(p,q) = 0, otherwise B(p,q) = F(p,q) = A269158(p,(q+1)/2), function F defined as in A269158.

%e The top left [1 .. 16] x [1 .. 25] section of the array:

%e 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

%e 1, 2, 7, 4, 13, 14, 11, 8, 25, 26, 31, 28, 21, 22, 19, 16

%e 1, 0, 3, 3, 0, 1, 1, 0, 3, 3, 0, 1, 1, 0, 3, 3

%e 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

%e 1, 2, 0, 2, 1, 1, 6, 0, 6, 1, 5, 6, 0, 6, 5, 5

%e 0, 0, 4, 7, 0, 15, 10, 0, 26, 25, 0, 29, 20, 0, 16, 19

%e 1, 0, 7, 0, 5, 3, 2, 7, 2, 1, 0, 3, 1, 4, 5, 4

%e 1, 2, 7, 4, 13, 14, 11, 8, 25, 26, 31, 28, 21, 22, 19, 16

%e 1, 0, 0, 4, 0, 4, 9, 0, 12, 1, 0, 0, 12, 0, 4, 9

%e 0, 0, 0, 6, 12, 15, 13, 0, 31, 27, 26, 26, 0, 16, 22, 21

%e 1, 2, 0, 0, 13, 0, 7, 11, 14, 13, 14, 3, 8, 10, 10, 15

%e 1, 0, 3, 3, 0, 1, 1, 0, 3, 3, 0, 1, 1, 0, 3, 3

%e 1, 0, 3, 7, 0, 14, 0, 6, 1, 11, 14, 8, 8, 9, 12, 11

%e 0, 2, 0, 0, 8, 13, 9, 15, 27, 27, 0, 31, 20, 18, 22, 20

%e 1, 0, 0, 0, 0, 0, 11, 0, 9, 3, 0, 15, 0, 0, 2, 15

%e 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

%e 1, 2, 7, 3, 13, 15, 0, 8, 0, 8, 17, 11, 8, 14, 18, 10

%e 0, 0, 7, 0, 0, 10, 2, 0, 21, 27, 0, 28, 25, 0, 23, 25

%e 1, 0, 0, 2, 0, 14, 10, 0, 25, 0, 11, 19, 8, 9, 10, 16

%e 1, 2, 0, 2, 1, 1, 6, 0, 6, 1, 5, 6, 0, 6, 5, 5

%e 1, 0, 0, 0, 0, 15, 11, 0, 0, 26, 0, 10, 17, 0, 10, 15

%e 0, 0, 7, 4, 0, 0, 12, 3, 23, 23, 17, 31, 29, 28, 25, 31

%e 1, 2, 3, 4, 1, 0, 13, 8, 26, 0, 31, 0, 13, 19, 8, 11

%e 0, 0, 4, 7, 0, 15, 10, 0, 26, 25, 0, 29, 20, 0, 16, 19

%e 1, 0, 0, 0, 5, 1, 1, 0, 25, 25, 0, 28, 0, 12, 25, 13

%o (Scheme)

%o (define (A268728 n) (A268728bi (A002260 n) (+ -1 (* 2 (A004736 n)))))

%o (define (A268728bi p q) (if (not (odd? q)) (error "A268728bi: the second argument should be odd: " p q) (let loop ((p p) (q q) (s 0)) (cond ((zero? p) 0) ((= 1 p) s) ((odd? p) (loop (modulo q p) p (A003987bi s (A004198bi p q)))) (else (loop (/ p 2) q (A003987bi s (A003987bi q (/ (- q 1) 2)))))))))

%o ;; Alternative implementation using the definition given in A269158:

%o (define (A268728 n) (let ((p (A002260 n)) (q (+ -1 (* 2 (A004736 n))))) (if (< 1 (gcd p q)) 0 (A269158auxbi p q))))

%Y Transpose: A268729.

%Y Column 1: Seems to be 0 followed by A039982.

%Y Cf. A065621 (occurs as row 2, row 8, and in general, as any row 2^(2n+1) for n >= 0).

%Y Cf. A268829, A269158 (variants).

%Y Cf. A003188, A003987, A004198.

%K nonn,tabl

%O 1,5

%A _Antti Karttunen_, Feb 19 2016