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.

Showing 1-4 of 4 results.

A355565 T(j,k) are the numerators s in the representation R = s/t + (2/Pi)*u/v of the resistance between two nodes separated by the distance vector (j,k) in an infinite square lattice of one-ohm resistors, where T(j,k), j >= 0, 0 <= k <= j, is a triangle read by rows.

Original entry on oeis.org

0, 1, 0, 2, -1, 0, 17, -4, 1, 0, 40, -49, 6, -1, 0, 401, -140, 97, -8, 1, 0, 1042, -1569, 336, -161, 10, -1, 0, 11073, -4376, 4321, -660, 241, -12, 1, 0, 29856, -48833, 13342, -9681, 1144, -337, 14, -1, 0, 325441, -136488, 160929, -33188, 18929, -1820, 449, -16, 1, 0
Offset: 0

Views

Author

Hugo Pfoertner, Jul 07 2022

Keywords

Comments

The recurrence given by Cserti (2000), page 5, (32) is used to calculate the resistance between two arbitrarily spaced nodes in an infinite square lattice whose edges are replaced by one-ohm resistors. The lower triangle, including the diagonal, in Table I of Atkinson and Steenwijk (1999), page 487, is reproduced. The solution to the resistor grid problem shown in the xkcd Web Comic #356 "Nerd Sniping", provided in A211074, is the special case (j,k) = (2,1).
Using the terms of A280079 and A280317 as pairs of grid indices leads to strictly increasing resistances, i.e., R(A280079(m),A280317(m)) > R(A280079(i),A280317(i)) for m > i. This implies that for grid points on the same radius the resistance increases with the circumferential angle between 0 and Pi/4. The further dependence of the resistance along the circumferential angle with a fixed radius results from symmetry. - Hugo Pfoertner, Aug 31 2022

Examples

			The triangle begins:
     0;
     1,     0;
     2,    -1,   0;
    17,    -4,   1,    0;
    40,   -49,   6,   -1,  0;
   401,  -140,  97,   -8,  1,  0;
  1042, -1569, 336, -161, 10, -1, 0
.
The combined triangles used to calculate the resistances are:
  \  k      0       |        1        |       2       |      3       |
   \    s/t     u/v |    s/t    u/v   |  s/t      u/v |  s/t    u/v  |
  j \---------------|-----------------|---------------|--------------|
  0 |   0       0   |     .      .    |   .        .  |   .      .   |
  1 |   1/2     0   |    0      1     |   .        .  |   .      .   |
  2 |   2      -2   |   -1/2    2     |  0        4/3 |   .      .   |
  3 |  17/2   -12   |   -4     23/3   |  1/2      2/3 |  0     23/15 |
  4 |  40    -184/3 | - 49/2   40     |  6    -118/15 | -1/2   12/5  |
  5 | 401/2  -940/3 | -140    3323/15 | 97/2 -1118/15 | -8    499/35 |
.
continued:
  \ k     4       |      5       |
   \  s/t   u/v   | s/t    u/v   |
  j \-------------|--------------|
  0 |  .     .    |  .      .    |
  1 |  .     .    |  .      .    |
  2 |  .     .    |  .      .    |
  3 |  .     .    |  .      .    |
  4 | 0   176/105 |  .      .    |
  5 | 1/2  20/21  | 0    563/315 |
.
E.g., the resistance for a node distance vector (4,1) is R = T(4,1)/A131406(5,2) + (2/Pi)*A355566(4,1)/A355567(4,1) = -49/2 + (2/Pi)*40/1 = 80/Pi - 49/2.
		

References

  • See A211074 for more references and links.

Crossrefs

A131406 are the corresponding denominators t, with indices shifted by 1.
A355566 and A355567 are u and v.
Cf. A355585, A355586, A355587, A355588 (same problem for the infinite triangular lattice).

Programs

  • Maple
    See link.
  • Mathematica
    alphas[beta_] :=
    Log[2 - Cos[beta] + Sqrt[3 + Cos[beta]*(Cos[beta] - 4)]];
    Rsqu[n_, p_] :=
    Simplify[(1/Pi)*
       Integrate[(1 - Exp[-Abs[n]*alphas[beta]]*Cos[p*beta])/
         Sinh[alphas[beta]], {beta, 0, Pi}]];
    Table[Rsqu[n, k], {n, 0, 4}, {k, 0, n}] // TableForm (* Hugo Pfoertner, Aug 21 2022, calculates R, after Atkinson and Steenwijk *)
  • PARI
    R(m,p,x=pi) = {if (m==0 && p==0, return(0)); if (m==1 && p==0, return(1/2)); if (m==1 && p==1, return(2/x)); if(m==p, my(mm=m-1); return(R(mm,mm)*4*mm/(2*mm+1) - R(mm-1,mm-1)*(2*mm-1)/(2*mm+1))); if (p==(m-1), my(mm=m-1); return(2*R(mm,mm) - R(mm,mm-1))); if (p==0, my(mm=m-1); return(4*R(mm,0) - R(mm-1,0) - 2*R(mm,1))); if (p0, my(mm=m-1); return(4*R(mm,p) - R(mm-1,p) - R(mm,p+1) - R(mm,p-1)))};
    for(j=0,9,for(k=0,j,my(q=pi*R(j,k,pi));print1(numerator(polcoef(q,1,pi)),", "));print())

Formula

The resistance for the distance vector (j,k) is R(j,k) = T(j,k)/(1+mod(j+k,2)) +(2/Pi)*A355566(j,k)/A355567(j,k), avoiding the use of A131406.
From Rainer Rosenthal, Aug 04 2022: (Start)
R(0,0) = 0; R(1,0) = 1/2.
R(n,n) = R(n-1,n-1) + (2/Pi)/(2*n-1) for n >= 1.
R(j,k) = R(k,j) and R(-j,k) = R(j,k).
4*R(j,k) = R(j-1,k) + R(j+1,k) + R(j,k-1) + R(j,k+1) for (j,k) != (0,0).
(End)
T(j+1,0) = A089165(j)/(1 + mod(j,2)) for j >= 0. - Hugo Pfoertner, Aug 21 2022

A280317 Ordinate of points (x,y) of the square lattice such that x >= 0 and 0 <= y <= x, and ranked in order of increasing distance from the origin. Equidistant points are ranked in order of increasing ordinate.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 3, 2, 0, 3, 1, 2, 4, 3, 0, 1, 2, 4, 3, 0, 1, 5, 4, 2, 3, 5, 0, 1, 4, 2, 6, 3, 5, 4, 0, 1, 2, 6, 5, 3, 4, 7, 0, 6, 1, 2, 5, 3, 7, 4, 6, 0, 1, 2, 5, 8, 3, 7, 6, 4, 0, 1, 8, 5, 2, 7, 3, 6, 4, 9, 8, 0, 5, 1, 7, 2, 3, 6, 9, 4, 8, 7, 5, 0, 1, 2, 10, 9, 3, 6, 8, 4, 7, 5, 10
Offset: 1

Views

Author

Keywords

Examples

			a(12) = 3 since the twelfth point in distance from the origin is (3,3) at a distance of 3*sqrt(2) = 4.242640... whereas the eleventh is (4,1) at a distance of sqrt(17) = 4.12310... and the thirteenth is (4,2) at a distance of 2*sqrt(5) = 4.472113... .
The fourteenth and fifteenth points are respectively (5,0) and (4,3) and have the same distance 5 to the origin, but (5,0) has a smaller ordinate than (4,3), so a(14) = 0 and a(15) = 3.
		

Crossrefs

Cf. A280079.

Programs

  • Mathematica
    xmax = 20; (* Maximum explorative abscissa *)
    (* t are points in the triangle of vertices (0, 0), (0, max) and (xmax, xmax) *)
    t = Flatten[Table[{x, y}, {x, 0, xmax}, {y, 0, x}], 1];
    nmax = Floor[xmax^2/4] (* Safe limit for correctly sorted sequence *)
    Transpose[SortBy[t, {#[[1]]^2 + #[[2]]^2 &, #[[2]] &}]][[2]][[1 ;;
       nmax]]

A283618 A 2D -> 1D binary encoding of points (x,y) of the square lattice such that x >= 0 and 0 <= y <= x, and ranked in order of increasing distance from the origin. Equidistant points are ranked in order of increasing ordinate.

Original entry on oeis.org

0, 2, 3, 8, 9, 12, 10, 11, 14, 32, 33, 15, 36, 34, 37, 35, 38, 48, 39, 40, 41, 44, 50, 45, 42, 43, 51, 56, 46, 47, 57, 128, 129, 58, 132, 60, 133, 59, 144, 130, 131, 134, 62, 145, 135, 146, 63, 136, 148, 137, 140, 147, 141, 149, 152, 150, 138, 139, 142, 153, 192, 143, 151, 156, 154, 160, 161, 194, 155, 164, 157, 165
Offset: 1

Views

Author

Andres Cicuttin, Mar 12 2017

Keywords

Comments

The encoding consists of assigning a number whose binary representation is the interleaving of the binary representation of the two integers of the encoded pair. Let's call Enc(x,y) the encoding function of two nonnegative integers x and y, and call z the corresponding coding number, that is Enc(x,y) = z, and also call respectively nbx, nby and nbz the corresponding number of bits of x, y, and z; then there are two possible cases:
a) If nbx >= nby then nbz is even, and the bits of z in odd positions correspond to the bits of x, and those in even positions correspond to y. For example, if x=8 (1000 in base 2) and y=3 (11 in base 2) then z = Enc(8,3) = 133 (10000101 in base 2):
x: 8 -> 1000 -> 1 0 0 0
odd positions | | | |
z: interleaved -> 1 0 0 0 0 1 0 1 -> 10000101 -> 133
even positions | | | |
y: 3 -> 0011 -> 0 0 1 1
b) If nbx < nby then nbz is odd, and the bits of z in even positions correspond to the bits of x, and those in odd positions correspond to y. For example if x=5 (101 in base 2) and y=31 (11111 in base 2) then z= 383(101111111 in base 2):
x: 5 -> 101 -> 0 1 0 1
even positions | | | |
z: interleaved -> 1 0 1 1 1 0 1 1 1 -> 101110111 -> 375
odd positions | | | | |
y: 31 -> 10001 -> 1 1 1 1 1
Before interleaving the bits, the binary representations must be eventually completed by padding with zeros on the left to ensure an equal number of bits for both integers.
The same encoding scheme could be generalized for more dimensions (ND -> 1D), and for numeric representations in other bases of the positional numeral system.
This encoding scheme can also be generalized for real numbers, for example, establishing a bijection between reals belonging to the open interval (0,1) and points within the square with vertices (0,0),(0,1),(1,0) and (1,1). In this case the corresponding binary representations will in general be infinite.
Number of bits of a(n) is even for n > 1.
The encoded points are those whose abscissas and ordinates are respectively given by A280079, A280317.

Crossrefs

Programs

  • Mathematica
    (* Maximum explorative abscissa *)
    xmax=20;
    (* points in the triangle of vertices (0,0),(0,max) and (xmax,xmax) *)
    points=Flatten[Table[{x,y},{x,0,xmax},{y,0,x}],1];
    (* Sorting points: first by increasing distance from origin, and then by increasing ordinate *)
    sortedpoints=SortBy[points,{#[[1]]^2+#[[2]]^2&,#[[2]]&}];
    (* Safe limit for correctly sorted sequence *)
    nmax=Floor[xmax^2/4];
    (* Separate lists of abscissas and ordinates *)
    abs=Transpose[sortedpoints][[1]][[1;;nmax]];
    ord=Transpose[sortedpoints][[2]][[1;;nmax]];
    (* Definition of the 2D -> 1D binary encoding function: *)
    MergerEncoder[a_,b_]:=Module[{x,maxbits},
    maxbits=32; (* for a,b < 2^32-1, increase this value for larger integers *)
    x={IntegerDigits[a,2,maxbits],
    IntegerDigits[b,2,maxbits]}//Transpose//Flatten;
    FromDigits[x,2]//Return];
    a= Table[MergerEncoder[abs[[n]],ord[[n]]],{n,1,nmax}]

A357021 First coordinate x of points in the triangular lattice, sorted first by the distance from the origin and then by the circumferential angle phi restricted to the sector 0 <= phi < Pi/6. y is given in A357022.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 7, 8, 8, 8, 9, 9, 8, 9, 9, 10, 10, 10, 9, 10, 10, 11, 11, 11, 10, 11, 12, 12, 11, 12, 12, 11, 12, 13, 13, 12, 13, 13, 12, 13, 14, 14, 14, 14, 13, 14, 13, 15, 15, 14, 15, 15, 14, 15, 16, 16, 14, 16, 15
Offset: 1

Views

Author

Hugo Pfoertner, Sep 10 2022

Keywords

Comments

The coordinates (x,y) are defined in an oblique coordinate system with an angle of 120 degrees between the axes, see e.g. A307012.
The distance from the origin is given by r = sqrt(x^2 - x*y + y^2), and the circumferential angle is phi = atan(sqrt(3)*y/(2*x - y)).
Using the pairs of terms of this sequence and of A357022(n) as grid indices in an infinite triangular lattice of one-ohm resistors leads to strictly increasing resistances against (0,0) (see A355585). This is similar to the role of A280079 and A280317 used as grid indices in the square lattice (see A355565).

Examples

			R is the resistance between a grid point (x,y) and (0,0) in an infinite triangular lattice of one-ohm resistors.
.
   n  x y  r^2   phi      R
              (degrees) (ohms)
   1  0 0   0          0.0000000000
   2  1 0   1    0.000 0.3333333333
   3  2 1   3   30.000 0.4359911242
   4  2 0   4    0.000 0.4613510850
   5  3 1   7   19.107 0.5132889542
   6  3 0   9    0.000 0.5362130198
   7  4 2  12   30.000 0.5627909282
   8  4 1  13   13.898 0.5700986140
   9  4 0  16    0.000 0.5891518971
  ...
  19  7 1  43    7.589 0.6800193341
  20  8 4  48   30.000 0.6901322715
  21  7 0  49    0.000 0.6920215369
  22  8 3  49   21.787 0.6920259223
  23  8 2  52   13.898 0.6974842443
		

Crossrefs

Showing 1-4 of 4 results.