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.

User: Rainer Rosenthal

Rainer Rosenthal's wiki page.

Rainer Rosenthal has authored 69 sequences. Here are the ten most recent ones:

A373692 Table of the number of ways T(m,n) to partition a 2m X 2n grid into Cartesian products of size 2 X 2, read by ascending antidiagonals.

Original entry on oeis.org

1, 3, 3, 15, 45, 15, 105, 1575, 1575, 105, 945, 99225, 510525, 99225, 945, 10395, 9823275, 376473825, 376473825, 9823275, 10395, 135135, 1404728325, 533407191975, 4202869719825, 533407191975, 1404728325, 135135, 2027025, 273922023375, 1302400497234375, 115509334438258425, 115509334438258425, 1302400497234375, 273922023375, 2027025
Offset: 1

Author

Rainer Rosenthal and Markus Sigg, Jun 13 2024

Keywords

Comments

This is a special case of the problem to partition a Cartesian product P X Q into squares P_i X Q_i, i.e. |P_i| = |Q_i|. In our case all subsets have size 2. Using the terminology of A160911 we deal with partitions of type (2m X 2n: 2,2,2,...).
From Markus Sigg, Jul 25-26 2024: (Start)
T(m,n) is a multiple of (2m-1)(2n-1) as there are that many ways to place a Cartesian product with one point in the top left of the grid, and the resulting configurations are equivalent.
For m,n > 1, starting with the Cartesian product {1,2m} X {1,2n} and evaluating the options for adding a Cartesian product with one point in (1,2) shows that T(m,n) is a multiple of (2m-1)(2n-1)*lcm(2m-3,2n-3). (End)

Examples

			Table T(m,n) begins:
.
     n       1             2                 3              4             5
  m \ ---------------------------------------------------------------------
  1 |        1             3                15            105           945
  2 |        3            45              1575          99225       9823275
  3 |       15          1575            510525      376473825  533407191975
  4 |      105         99225         376473825  4202869719825
  5 |      945       9823275      533407191975  115509334438258425
  6 |    10395    1404728325  1302400497234375  6907197292027901339625
  7 |   135135  273922023375
  8 |  2027025
.
These are the T(1,2) = 3 possible partitions:
.
    |A A B B|   |A B A B|   |A B B A|
    |A A B B|   |A B A B|   |A B B A|
    _________________________________
       #1          #2          #3
.
For T(2,2) = 45 consider these special partitions:
.
   |A A B B|   |A A B B|   |A A B B|
   |A A B B|   |A A B B|   |A A C C|
   |C C D D|   |C D C D|   |D D B B|
   |C C D D|   |C D C D|   |D D C C|
  ___________________________________
     Base1       Base2       Base3
.
Any partition is equivalent to exactly one of these partitions, i.e. it differs only by the order of the rows and columns. The number of equivalent partitions is respectively 9, 18, 18. Thus we have T(2,2) = 9 + 18 + 18 = 45.
See the picture and the expanded example in the link section.
.
Some other known terms: T(5,5) = 84250218148544569727025, T(6,4) = 6907197292027901339625, T(7,4) = 814287280679532017261528625, T(8,4) = 173936355367823940296258779550625, T(9,4) = 62626268302216078023651174787170095625, T(10,4) = 35784629301848063975515694953866493243805625.
		

Crossrefs

Cf. A001147 (column 1), A079484 (column 2 - conjectured), A160911.

Programs

  • C
    // See Markus Sigg link.

Extensions

a(24) and beyond from Markus Sigg, Jul 18 2024

A367896 a(n) is the y-coordinate of the n-th point in a square spiral mapped to a square grid rotated by Pi/4 using the variant of the distance-limited strip bijection described in A367150.

Original entry on oeis.org

0, 1, 1, 1, 0, -1, -1, -1, 0, 0, 1, 2, 3, 2, 2, 1, 0, 0, -1, -2, -3, -2, -2, -1, 0, 1, 2, 2, 3, 3, 4, 3, 3, 2, 2, 1, 0, -1, -2, -2, -3, -3, -4, -3, -3, -2, -2, -1, 0, 0, 1, 2, 3, 4, 4, 5, 6, 5, 4, 4, 3, 2, 1, 1, 0, 0, -1, -2, -3, -4, -4, -5, -6, -5, -4, -4, -3, -2, -1, -1, 0, 1
Offset: 0

Author

Hugo Pfoertner and Rainer Rosenthal, Dec 04 2023

Keywords

Crossrefs

A367895 gives the corresponding x-coordinates.

Programs

  • PARI
    \\ See A367895 for definitions of required functions.
    a367896(n) = BijectionD([ax(n), ay(n)])[2]

A367895 a(n) is the x-coordinate of the n-th point in a square spiral mapped to a square grid rotated by Pi/4 using the variant of the distance-limited strip bijection described in A367150.

Original entry on oeis.org

0, 1, 0, -1, -1, -1, 0, 1, 1, 2, 2, 1, 0, 0, -1, -2, -3, -2, -2, -1, 0, 0, 1, 2, 3, 3, 3, 2, 2, 1, 0, -1, -2, -2, -3, -3, -4, -3, -3, -2, -2, -1, 0, 1, 2, 2, 3, 3, 4, 5, 4, 4, 3, 2, 1, 0, 0, -1, -1, -2, -3, -4, -4, -5, -6, -5, -4, -4, -3, -2, -1, 0, 0, 1, 1, 2, 3, 4, 4, 5, 6, 6
Offset: 0

Author

Hugo Pfoertner and Rainer Rosenthal, Dec 04 2023

Keywords

Crossrefs

A367896 gives the corresponding y-coordinates.

Programs

  • PARI
    \\ ax(n), ay(n) after Kevin Ryde's functions in A174344 and A274923.
    \\ It is assumed that the PARI program from A367150 has been loaded and the functions defined there are available.
    ax(n) = {my (m=sqrtint(n), k=ceil(m/2)); n -= 4*k^2; if (n<0, if (n<-m, k, -k-n), if (n
    				

A367150 Results of the strip bijection as described in A307110 with subsequent reassignment of the pair connections at all locations, in which 4 points of a unit square in one grid are mapped to a unit square in the other (rotated by Pi/4) grid in such a way that the maximum distance of the two points in the 4 assigned pairs is minimized.

Original entry on oeis.org

0, 5, 6, 7, 8, 2, 3, 4, 1, 13, 15, 17, 19, 14, 10, 16, 11, 18, 12, 20, 9, 26, 27, 28, 25, 21, 22, 23, 24, 38, 39, 40, 41, 42, 43, 44, 37, 30, 31, 32, 33, 34, 35, 36, 29, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 61, 46, 47, 48, 45, 50, 51, 52, 53, 54, 55
Offset: 0

Author

Rainer Rosenthal and Hugo Pfoertner, Nov 22 2023

Keywords

Comments

The strip bijection of A307110 assigns each grid point in one grid to a unique grid point in the rotated grid. The mapping therefore corresponds to a permutation of the nonnegative integers. Approximately 2/3 of the grid points are mapped in such a way that 4 points that form a unit square in the original grid also form a unit square after being mapped onto the rotated grid. We call this a stable (grid) cell under the bijection map. The method differs from that used in A307731 in that for each stable cell it is tried whether the maximum of the 4 pair distances resulting from the application of strip bijection can be reduced by a cyclic rotation of the connections. The one of the two assignments by cyclic connection change is selected that provides a smaller maximum of the 4 distances in the pairs assigned to each other. In contrast, a cyclic rotation of the connections is only carried out in the method of A307731 if the maximum of the 4 distances exceeds the upper limit of the bijection distance of sqrt(5)*sin(Pi/8)=0.855706... .

Examples

			   n   i = A305575(n)
   |   |   j = A305576(n)
   |   |   |   A307110(n)
   |   |   |   |  k   m  distance_A307110
   |   |   |   |  |   |    |      a(n)  k'  m' distance after
   |   |   |   |  |   |    |        |   |   |  reconnecting
   0   0   0   0  0   0  0.0000     0   0   0   0.0000
   1   1   0   1  1   0  0.7654 L   5   1   1   0.4142  r
   2   0   1   6 -1   1  0.4142     6  -1   1   0.4142
   3  -1   0   3 -1   0  0.7654 L   7  -1  -1   0.4142  r
   4   0  -1   8  1  -1  0.4142     8   1  -1   0.4142
   5   1   1   2  0   1  0.4142     2   0   1   0.4142
   6  -1   1  11 -2   0  0.5858     3  -1   0   0.4142  r
   7  -1  -1   4  0  -1  0.4142     4   0  -1   0.4142
   8   1  -1   9  2   0  0.5858     1   1   0   0.4142  r
   9   2   0   5  1   1  0.5858    13   2   1   0.7174  r
  10   0   2  15 -1   2  0.7174    15  -1   2   0.7174
  11  -2   0   7 -1  -1  0.5858    17  -2  -1   0.7174  r
  13   2   1                improved by reconnecting
  15  -1   2         L = 0.7654      ->         0.7174
  17  -2  -1
See the linked file for a visualization of the differences from A307110.
		

Crossrefs

Cf. A305575, A305576 (enumeration of the grid points in the square lattice).

Programs

  • PARI
    \\ See Pfoertner link.

A364341 a(n) is the greatest k such that there are exactly n distinct numbers j that can be expressed as the sum of two squares with k^2 < j < (k+1)^2, or -1 if such a k does not exist.

Original entry on oeis.org

0, 1, 3, 4, 6, 7, 11, 10, 14, 12, 16, 20, 22, 23, 21, 27, 29, 30, 32, 35, 38, 37, 42, 44, 47, 43, 54, 52, 51, 58, 57, 62, 56, 71, 64, 67, 68, 73, 76, 77, 78, 83, 72, 87, 90, 91, -1, 95, 103, 100, 107, 109, 105, 104, 108, -1, 116, 119, 110, 129, 117, 126, -1, 128, 134
Offset: 0

Author

Rainer Rosenthal, Jul 20 2023

Keywords

Comments

Index of last occurrence of n in A077773 if there is any, otherwise -1.

Crossrefs

A363522 Number of integers k such that there are exactly n distinct numbers j with k^2 < j < (k+1)^2 which can be expressed as sum of two squares.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 3, 2, 1, 1, 3, 2, 2, 1, 3, 3, 1, 3, 1, 2, 1, 4, 2, 1, 3, 1, 3, 1, 3, 1, 4, 1, 3, 2, 1, 1, 4, 1, 4, 2, 3, 0, 2, 3, 3, 3, 2, 2, 2, 1, 0, 3, 5, 1, 4, 1, 4, 0, 2, 2, 3, 4, 1, 1, 3, 3, 0, 5, 1, 4, 1, 2, 1, 3, 4, 0, 3, 3, 2, 2, 4, 0, 3
Offset: 0

Author

Rainer Rosenthal, Jul 07 2023

Keywords

Comments

Number of occurrences of n in A077773.

Examples

			a(0) = 1, since A077773(k) = 0 at the single index k = 0.
a(6) = 3, since A077773(k) = 6 for these 3 indices: k = 8, 9, and 11.
a(46) = 0, since A077773 doesn't contain 46; see A363761, A363762 and A363763.
		

Crossrefs

Programs

  • Python
    from sympy import factorint
    def A363522(n):
        s = 0
        for k in range(n>>1,((n+1)**2<<1)+1):
            c = 0
            for m in range(k**2+1,(k+1)**2):
                if all(p==2 or p&3==1 or e&1^1 for p, e in factorint(m).items()):
                    c += 1
                    if c>n:
                        break
            if c==n:
                s += 1
        return s # Chai Wah Wu, Jul 10 2023

A360030 a(n) is the minimum number of equal resistors needed in an electrical network so that n nodes can be selected in this network such that there are n*(n-1)/2 distinct resistances 0 < R < oo between the selected nodes.

Original entry on oeis.org

1, 3, 5, 8, 10, 11, 12, 14, 15, 16, 18, 19, 21
Offset: 2

Author

Hugo Pfoertner and Rainer Rosenthal, Feb 12 2023

Examples

			a(2) = 1, [[1,2]]
.
  1           2
  O----R1R----O
  R_12 = 1
.
a(3) = 3, [[1,2]^2,[2,3]]
.
  1   .---R1R---.   2           3
  O --|         |-- O ---R3R--- O
      .---R2R---.
.
  R_12 = 1/2, R_13 = 3/2,
              R_23 = 1
.
a(4) = 5, node 5 hidden, [[1,2],[2,3]^2,[3,5],[4,5]]
.
  1           2   .---R2R---.   3          (5)          4
  O ---R1R--- O --|         |-- O ---R4R--- O ---R5R--- O
                  .---R3R---.
.
  R_12 = 1, R_13 = 3/2, R_14 = 7/2,
            R_23 = 1/2, R_24 = 5/2,
                        R_34 = 2
.
a(5) = 8, node 6 hidden,
  [[1, 2], [1, 3]^2, [2, 3], [2, 4], [3, 6], [4, 5], [4, 6]]
.
    1             2           4           5
    O-----R1R-----O----R5R----O----R8R----O
    |             |           |
    |            R4R         R7R
    .---R2R---.   |           |
    |         |---O----R6R----O
    .---R3R---.   3          (6)
.
   R_12 = 5/9, R_13 = 7/18, R_14 = 19/18, R_15 = 37/18,
               R_23 = 1/2,  R_24 = 13/18, R_25 = 31/18,
                            R_34 =  8/9,  R_35 = 17/9,
                                          R_45 =  1
		

Crossrefs

Extensions

a(14) from Klaus Nagel and Hugo Pfoertner, Aug 21 2025

A358075 a(1) = 1; a(n+1) is the smallest integer > 0 that cannot be obtained from the integers {a(1), ..., a(n)} using each number exactly once and the operators +, -, *, /, where intermediate subexpressions must be integers.

Original entry on oeis.org

1, 2, 4, 11, 34, 152, 1007, 6703, 56837, 766478
Offset: 1

Author

Rainer Rosenthal, Oct 29 2022

Keywords

Comments

A variation of sequence A071115: terms are used "exactly once" instead of "at most once". First difference is a(8) = 6703 < 7335 = A071115(8).

Examples

			All positive numbers up to 151 can be computed from the first 5 terms 1, 2, 4, 11, 34; e.g., 105 = (1 + 4) * (34 - 11 - 2). All terms are used, and each term is used only once.
There is no such formula for 152, so a(6) = 152.
		

Crossrefs

Programs

  • Maple
    restart: with(combinat):
    # generate numbers from set s
    GEN := proc(s) option remember;
       local erg,X,Y,x,y,i,a,b;
       if nops(s) < 2 then
          return s;
       fi;
       erg := {};
       for i to nops(s)/2 do
          for a in choose(s,i) do
             b := s minus a;
             X := procname(a);
             Y := procname(b);
             for x in X do
             for y in Y do
                erg := erg union {x+y};
                if x < y then
                   erg := erg union {y-x};
                elif x > y then
                   erg := erg union {x-y};
                fi;
                erg := erg union {x*y};
                if type(x/y,integer) then
                   erg := erg union {x/y};
                elif type(y/x,integer) then
                   erg := erg union {y/x};
                fi;
             od;
             od;
          od;
       od;
       return erg;
    end:
    # minimal excluded number (not in set s)
    MEX := proc(s)
       local i;
       for i to infinity do
          if not member(i,s) then
             return i;
          fi;
       od;
    end:
    MaxIndex := 8;
    a := array(1..MaxIndex):
    w := {}:
    for n to MaxIndex do
       a[n] := MEX(GEN(w));
       w := w union {a[n]};
    od:
    seq(a[n],n=1..MaxIndex);
  • Python
    def a(n, v):
        R = dict() # index of each reachable subset is [card(s)-1][s]
        for i in range(n): R[i] = dict()
        for i in range(n): R[0][(v[i], )] = {v[i]}
        for j in range(1, n):
            for i in range((j+1)//2):
                for s1 in R[i]:
                    for s2 in R[j-1-i]:
                        if set(s1) & set(s2) == set():
                            s12 = tuple(sorted(set(s1) | set(s2)))
                            if s12 not in R[len(s12)-1]:
                                R[len(s12)-1][s12] = set()
                            for a in R[i][s1]:
                                for b in R[j-1-i][s2]:
                                    allowed = [a+b, a*b, a-b, b-a]
                                    if a!=0 and b%a==0: allowed.append(b//a)
                                    if b!=0 and a%b==0: allowed.append(a//b)
                                    R[len(s12)-1][s12].update(allowed)
        k = 1
        while k in R[n-1][tuple(v)]: k += 1
        return k
    alst = [1]
    [alst.append(a(n, alst)) for n in range(1, 8)]
    print(alst) # Michael S. Branicky, Oct 30 2022

Extensions

a(9) from Michael S. Branicky, Oct 30 2022
a(10) from Michael S. Branicky, Nov 07 2022

A357891 a(1) = 1; a(n+1) is the smallest integer > 0 that cannot be obtained from the integers {a(1), ..., a(n)} using each number exactly once and the operators +, -, *, /.

Original entry on oeis.org

1, 2, 4, 11, 34, 152, 1079, 6610, 93221
Offset: 1

Author

Rainer Rosenthal and Hugo Pfoertner, Nov 01 2022

Keywords

Crossrefs

Programs

  • Python
    from fractions import Fraction
    def a(n, v):
        R = dict() # index of each reachable subset is [card(s)-1][s]
        for i in range(n): R[i] = dict()
        for i in range(n): R[0][(v[i], )] = {v[i]}
        #reach = set(v)
        for j in range(1, n):
            for i in range((j+1)//2):
                for s1 in R[i]:
                    for s2 in R[j-1-i]:
                        if set(s1) & set(s2) == set():
                            s12 = tuple(sorted(set(s1) | set(s2)))
                            if s12 not in R[len(s12)-1]:
                                R[len(s12)-1][s12] = set()
                            for a in R[i][s1]:
                                for b in R[j-1-i][s2]:
                                    allowed = [a+b, a*b, a-b, b-a]
                                    if a!=0: allowed.append(Fraction(b, a))
                                    if b!=0: allowed.append(Fraction(a, b))
                                    R[len(s12)-1][s12].update(allowed)
        k = 1
        while k in R[n-1][tuple(v)]: k += 1
        return k
    alst = [1]
    [alst.append(a(n, alst)) for n in range(1, 6)]
    print(alst) # Michael S. Branicky, Nov 01 2022

Extensions

a(9) from Michael S. Branicky, Nov 10 2022

A353448 Number w is in this sequence if every frame w X h, w >= h >= 3, contains more distinct distance quadrilaterals with corners interior to the 4 sides with concurrent diagonals, i.e., both ascending or both descending, than non-concurrent diagonals, or equivalently A353450(w,h) >= A353449(w,h).

Original entry on oeis.org

3, 4, 5, 7, 10, 11, 13, 14, 15, 16, 17, 19, 21, 23, 25, 29, 31, 33, 34, 37, 41, 43, 45, 46, 49, 55, 57, 61, 67, 73, 79, 81, 85, 89, 91, 97, 109, 113, 121, 127, 133, 141, 145, 151, 157, 161, 169, 181, 193, 201, 205, 209, 211, 217, 221, 225, 241, 253, 261, 265, 271
Offset: 1

Author

Rainer Rosenthal, May 22 2022

Keywords

Comments

It is conjectured that this sequence is a subsequence A160007 except for the small terms <= 46 (verified for all w < 661). The example section depicts the way this sequence matches the irregular pattern of A160007. Numbers w > 100 were computed by Hugo Pfoertner.
w = 617 is one of the rare occurrences of remainder 17 mod 60 in A160007, and it is also in this sequence. One might suspect that there would be less and less hits, but the time-consuming computation successfully countered the intuition.

Examples

			.
w = 5 is in this sequence:
.
                        5 | . . . C .
   4 | . . C . .        4 | .       .    w = 5 is in this sequence because all
   3 | .       B        3 | .       B    quadrilaterals in (5,4) and (5,5)
   2 | D       .        2 | D       .    shown in the example section of A353450
   1 | . A . . .        1 | . A . . .    have concurrent diagonals.
   y /----------        y /----------
     x 1 2 3 4 5          x 1 2 3 4 5
.
w = 6 is *not* in this sequence:
.
   4 | . . . C . .         w = 6 is not in this sequence because of the single
   3 | D         .         quadrilateral in (6,4) shown in the example section
   2 | .         B         of A353449. Diagonal AC is rising while diagonal DB
   1 | . A . . . .         is falling (non-concurrent diagonals).
   y /------------         There is no (6,4) quadrilateral with all distances
     x 1 2 3 4 5 6         distinct and with concurrent diagonals!
.
            123456789012345678901234567890123456789012345678901234567890
    1 -  60   ::: x  :: x:::: x x : x   x x ::  x   x x ::  x     x x
   61 - 120 x     x   . x     x x   x   x x     x   . . .   x   x .
  121 - 180 x     x     x     . x   x     x     x   x .     x     . .
  181 - 240 x     .     x   . . x   x   x x     x   x . x   .     .
  241 - 300 x     .     x     . x   x     x .   .   x .     x     .
  301 - 360 x   . . .   x     . x   x     .     x   . .     . . . .
  361 - 420 x   . . .   .     x .   x     x .   x   x .     x     . .
  421 - 480 x     .     x     . x   .   . .     x   . x .   x     . .
  481 - 540 x     .   . .   . . .   x     .     .   x .     x   . .
  541 - 600 x   . .   . .     . x   .     . .   x   . .     x     .
  601 - 660 x     . .   x   x . .   x     x     .   x . .   x .   .
.
Legend:
  "x" marks numbers w belonging to this sequence and to A160007.
  ":" marks numbers w belonging to this sequence only.
  "." marks numbers w belonging to A160007 only.
		

Crossrefs

Cf. A160007, A353532 ("all tetrapods"), A353449 ("unisense"), A353450 ("contrasense").
Cf. A225730 (has many terms in common when 1 is added, see also comparison plot).