A319513 The boustrophedonic Rosenberg-Strong function maps N onto N X N where N = {0, 1, 2, ...} and n -> factor(a(n)) = 2^x*3^y -> (x, y).
1, 3, 6, 2, 4, 12, 36, 18, 9, 27, 54, 108, 216, 72, 24, 8, 16, 48, 144, 432, 1296, 648, 324, 162, 81, 243, 486, 972, 1944, 3888, 7776, 2592, 864, 288, 96, 32, 64, 192, 576, 1728, 5184, 15552, 46656, 23328, 11664, 5832, 2916, 1458, 729, 2187, 4374, 8748, 17496
Offset: 0
Keywords
References
- A. L. Rosenberg, H. R. Strong, Addressing arrays by shells, IBM Technical Disclosure Bulletin, vol 14(10), 1972, p. 3026-3028.
Links
- Georg Cantor, Ein Beitrag zur Mannigfaltigkeitslehre, Journal für die reine und angewandte Mathematik 84 (1878), 242-258.
- Steven Pigeon, Mœud deux, 2018.
- A. L. Rosenberg, Allocating storage for extendible Arrays, J. ACM, vol 21(4), 1974, p. 652-670.
- M. P. Szudzik, The Rosenberg-Strong Pairing Function", arXiv:1706.04129 [cs.DM], 2017.
Crossrefs
Programs
-
Julia
function bRS(n) m = x = isqrt(n) y = n - x^2 x <= y && ((x, y) = (2x - y, x)) isodd(m) ? (y, x) : (x, y) end A319513(n) = ((x, y) = bRS(n); 2^x * 3^y) [A319513(n) for n in 0:52] |> println
-
Maple
A319513 := proc(n) local b, r, p, m; b := floor(sqrt(n)); r := n - b^2; p := `if`(r < b, [b, r], [2*b-r, b]); m := `if`(p[1] > p[2], p[1], p[2]); `if`(irem(m,2) = 0, 2^p[1]*3^p[2], 2^p[2]*3^p[1]) end: seq(A319513(n), n=0..52);
-
Mathematica
a[n_] := Module[{b, r, p1, p2, m}, b = Floor[Sqrt[n]]; r = n-b^2; {p1, p2} = If[rp2, p1, p2]; If[EvenQ[m], 2^p1 3^p2, 2^p2 3^p1]]; Table[a[n], {n, 0, 52}] (* Jean-François Alcover, Feb 14 2019, from Maple *)
Comments