cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A072735 Simple triangle-stretching N X N -> N bijection: Inverse of A072734, variant of A072733.

This page as a plain text file.
%I A072735 #5 May 01 2014 02:47:42
%S A072735 0,1,2,3,5,9,10,6,14,20,21,15,4,27,35,36,28,7,8,44,54,55,45,11,13,19,
%T A072735 65,77,78,66,22,16,26,34,90,104,105,91,37,29,12,43,53,119,135,136,120,
%U A072735 56,46,17,18,64,76,152,170,171,153,79,67,23,25,33,89,103,189,209,210
%N A072735 Simple triangle-stretching N X N -> N bijection: Inverse of A072734, variant of A072733.
%H A072735 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%o A072735 (Scheme) (define (A072735 n) (packA072735 (A025581 n) (A002262 n)))
%o A072735 (define (packA001477 x y) (/ (+ (expt (+ x y) 2) x (* 3 y)) 2))
%o A072735 (define (packA072735 x y) (cond ((<= x y) (let ((half-x (floor->exact (/ x 2)))) (packA001477 half-x (+ half-x (* 2 (- y (* 2 half-x))) (modulo x 2) (if (and (eq? x y) (even? x)) 0 -1))))) (else (let ((half-y (floor->exact (/ y 2)))) (packA001477 (+ half-y (* 2 (- (-1+ x) (* 2 half-y))) (modulo y 2) (if (and (eq? x (1+ y)) (even? y)) 1 0)) half-y)))))
%Y A072735 Inverse: A072734, projections: A072781 & A072782, variant of the same theme: A072733. Cf. also A001477 and its projections A025581 & A002262.
%K A072735 nonn,tabl
%O A072735 0,3
%A A072735 _Antti Karttunen_, Jun 12 2002