login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A288969 Triangular array read by rows: row n is the list of the 2*n-1 successive values taken by the function z = n - floor(x) * floor(y) along the hyperbola with equation y = n/x, for 1 <= x <= n. 3

%I #36 Oct 13 2017 05:51:56

%S 0,0,1,0,0,1,2,1,0,0,1,2,0,2,1,0,0,1,2,3,1,3,2,1,0,0,1,2,3,0,2,0,3,2,

%T 1,0,0,1,2,3,4,1,3,1,4,3,2,1,0,0,1,2,3,4,0,2,4,2,0,4,3,2,1,0,0,1,2,3,

%U 4,5,1,3,0,3,1,5,4,3,2,1,0

%N Triangular array read by rows: row n is the list of the 2*n-1 successive values taken by the function z = n - floor(x) * floor(y) along the hyperbola with equation y = n/x, for 1 <= x <= n.

%C See A288966's links for explanations about the algorithm used to go along an hyperbola of equation y = n/x, with 1 <= x <= n.

%C When represented as a triangular array, internal zeros "0" correspond to factorizations of n.

%C This array appears to resemble a version of the sieve of Eratosthenes with zeros aligned.

%C A053186 and A293497 appear to intertwine into this sequence. The following will be denoted "assumption (1)": with t indexing columns, t=0 being central: T(n, 2k) = A053186(n+k^2) and T(n, 2k+1) = A293497(n+k(k+1)). - _Luc Rousseau_, Oct 11 2017

%C It would be nice to have a larger b-file, or an a-file. - _N. J. A. Sloane_, Oct 13 2017

%H Luc Rousseau, <a href="/A288969/a288969.txt">The first 25 lines of the triangle array, formatted</a>

%F From _Luc Rousseau_, Oct 11 2017: (Start)

%F (All formulas under assumption (1))

%F With t indexing columns, t=0 being central,

%F T(n, 2k) = A053186(n+k^2).

%F T(n, 2k+1) = A293497(n+k(k+1)).

%F T(n, t) = n - x*(x+t) where x = floor((-t+sqrt(t^2+4n))/2).

%F With A293578 viewed as a 2D array T',

%F T'(n,t)=T(n-1,t)-T(n,t)+1 (define T(0,0) as 0).

%F (End)

%e Array begins:

%e 0

%e 0 1 0

%e 0 1 2 1 0

%e 0 1 2 0 2 1 0

%e 0 1 2 3 1 3 2 1 0

%e 0 1 2 3 0 2 0 3 2 1 0

%e 0 1 2 3 4 1 3 1 4 3 2 1 0

%e 0 1 2 3 4 0 2 4 2 0 4 3 2 1 0

%t (* Under assumption (1) *)

%t A288969[n_, t_] := Module[{x},

%t x = Floor[(-t + Sqrt[t^2 + 4 n])/2];

%t n - x (t + x)

%t ] (* _Luc Rousseau_, Oct 11 2017 *)

%t (* or *)

%t FEven[x_] := x^ 2

%t InvFEven[x_] := Sqrt[x]

%t GEven[n_] := n - FEven[Floor[InvFEven[n]]]

%t FOdd[x_] := x*(x + 1)

%t InvFOdd[x_] := (Sqrt[1 + 4 x] - 1)/2

%t GOdd[n_] := n - FOdd[Floor[InvFOdd[n]]]

%t A288969[n_, t_] := Module[

%t {e, k, x},

%t e = EvenQ[t];

%t k = If[e, t/2, (t - 1)/2];

%t x = n + If[e, FEven[k], FOdd[k]];

%t If[e, GEven[x], GOdd[x]]

%t ] (* _Luc Rousseau_, Oct 11 2017 *)

%o (Java)

%o package oeis;

%o public class B {

%o public static void main(String[] args) {

%o for (int n = 1; n <= 8; n ++) {

%o hyberbolaTiles(n);

%o }

%o }

%o private static void hyberbolaTiles(int n) {

%o int x = 0, y = 0, p = 0, q = n;

%o do {

%o if (p != 0) {

%o System.out.println(n - p * q);

%o }

%o if (y < 0) { x = y + q; q --; }

%o if (y > 0) { p ++; x = y - p; }

%o if (y == 0) {

%o p ++;

%o x = 0; System.out.println("0");

%o q --;

%o }

%o y = x + p - q;

%o } while (q > 0);

%o }

%o }

%o (PARI) htrow(n) = {my(x = 0, y = 0, p = 0, q = n); while (q>0, if (p, print1(n-p*q, ", ")); if (y < 0, x = y + q; q --); if (y > 0, p ++; x = y - p); if (y == 0, p++; x = 0; print1(0, ", "); q --;); y = x + p - q;);}

%o tabf(nn) = for (n=1, nn, htrow(n); print()); \\ _Michel Marcus_, Jun 21 2017

%Y Cf. A053186, A288966, A293497, A293578.

%K nonn,tabf

%O 1,7

%A _Luc Rousseau_, Jun 20 2017

%E More terms from _Michel Marcus_, Jun 21 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 04:59 EDT 2024. Contains 371264 sequences. (Running on oeis4.)