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-7 of 7 results.

A364317 Irregular triangle T read by rows: T(n, k) gives the number of permutations of [n] = {1, 2, ..., n} with a cycle of length m = floor(n/2) + k = A138099(n, k), for 1 <= k <= n - floor(n/2) = ceiling(n/2).

Original entry on oeis.org

1, 1, 3, 2, 8, 6, 40, 30, 24, 180, 144, 120, 1260, 1008, 840, 720, 8064, 6720, 5760, 5040, 72576, 60480, 51840, 45360, 40320, 604800, 518400, 453600, 403200, 362880, 6652800, 5702400, 4989600, 4435200, 3991680, 3628800
Offset: 1

Views

Author

Wolfdieter Lang, Aug 12 2023

Keywords

Comments

The length of row n is ceiling(n/2) = A008619(n-1).
The numbers for these cycles of permutations of [n], appear in the solution of the Locker Problem. See the link, p. 25.
For the probability of failures with the strategy used in the locker problem with n lockers and opening of up to floor(n/2) lockers see A058313(n)/A058312(n), for n > = 1. For n = 1 the one team member is not allowed to open the one locker (with the member's wallet) because (n/2) = 0; so certainly a failure.
For the probability of success in this locker problem for n lockers see A119248(n)/A058312(n), for n >= 1.

Examples

			The irregular triangle begins:
n\k       1       2       3       4       5       6 ...
-------------------------------------------------------
1:        1
2:        1
3:        3       2
4:        8       6
5:       40      30      24
6:      180     144     120
7:     1260    1008     840     720
8:     8064    6720    5760    5040
9:    72576   60480   51840   45360   40320
10:  604800  518400  453600  403200  362880
11: 6652800 5702400 4989600 4435200 3991680 3628800
...
T(5, 1) = 40 because m(5, 1) = 2 + 1 = 3, and for each of the binomial(5, 3) = 10 possibilities for choosing three numbers from [5] there are (3 - 1)! = 2 3-cycles if each starts with the smallest number, e.g., for {2, 3, 5} the cycles are (2, 3, 5) and (2, 5, 3). For the remaining 5-3 = 2 numbers there are 2! possible permutations; in the example permutations of {1, 4}, namely (1)(4) and (1,4). Thus T(5, 3) = binomial(5, 3)*2!*2! = 10*2*2 = 40 = 5!/3.
		

Crossrefs

Programs

Formula

T(n, k) = binomial(n, m(n, k))*(m(n, k) - 1)!*(n - m(n, k))! = n!/m(n, k), with m(n, k) = floor(n/2) + k = A138099(n, k), for n >= 1 and k = 1, 2, ..., ceiling(n/2).

A359634 a(0)=1 and thereafter a(n) is the length of the longest contiguous group of terms in the sequence thus far that add up to n; if no such group exists, set a(n)=0.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Jan 08 2023

Keywords

Comments

If a zero appears, it is not counted as a term in a contiguous grouping. For example, if (10, 30, 0, 60) is our longest group to sum to 100, this counts as 3 terms, not 4. However, in 50 million terms (computed by Kevin Ryde), a zero has not appeared. Why is this?
How does the lower envelope of this sequence behave?

Examples

			a(6) is 4 because in the sequence thus far (1,1,2,2,3,3), the longest run of consecutive terms that sums to 6 is (1,1,2,2), which is 4 terms.
		

Crossrefs

Cf. A331614, A358537. a(1-16) in A138099 are the same.

Programs

  • C
    See Links section.

A173195 Values of k such that 4^x + 4^y + 4^z = k^2 with arbitrary integers x <= y <= z.

Original entry on oeis.org

3, 6, 9, 12, 18, 24, 33, 36, 48, 66, 72, 96, 129, 132, 144, 192, 258, 264, 288, 384, 513, 516, 528, 576, 768, 1026, 1032, 1056, 1152, 1536, 2049, 2052, 2064, 2112, 2304, 3072, 4098, 4104, 4128, 4224, 4608, 6144, 8193, 8196, 8208, 8256, 8448, 9216, 12288
Offset: 1

Views

Author

Michel Lagneau, Feb 12 2010

Keywords

Comments

We prove that the solutions of 4^x + 4^y + 4^z = k^2 are (x,y,2y-x-1), for any arbitrary integer x,y. We calculate z. 4^x + 4^y + 4^z is square if positive integers m and odd integer t are such as : 1 + 4^(y-x) + 4^(z-x) = (1 + t*2^m)^2, that's why : (1 + 4^(z-y)*( 4^(y-x)) = t(1 + t*2^(m+1)) t.2^(m+1), and then m = 2y - 2x - 1. If we report this value in the precedent equation, we obtain : t-1 = (2^(z-2y+x+1) + t)(2^(z-2y+x+1) - t) * 4^(y-x-1). Because t is odd, z = 2y - x - 1. Finally, this values gives the square (2^x + 2^(2y-x-1))^2 = k^2.
From Frederik P.J. Vandecasteele, Jun 06 2025: (Start)
For a given n, the exponents are x = A384688(n-1), y = A138099(n), z = A000267(n-1) so that a(n) = 2^A384688(n-1) + 2^A000267(n-1).
Terms are all and only those k whose binary expansion is two 1 bits an odd distance apart. (End)

Examples

			x = 0, y = 1 then z = 1, and k = 3.
x = 1, y = 2 then z = 2, and k = 6.
x = 0, y = 2 then z = 3, and k = 9.
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976.
  • J. M. De Koninck, A. Mercier, 1001 problèmes en théorie classique des nombres. Ellipses, 2004.
  • H. N. Shapiro, Introduction to the Theory of Numbers, John Wiley & Sons, 1983.

Crossrefs

Cf. A263132.
Subsequence of A018900.

Programs

  • Maple
    for x from 0 to 1000 do :for y from x to 1000 do: n := evalf(2^x + 2^(2*y-x-1)): print (n) ; od :od :
  • Mathematica
    Take[Union[Select[Sqrt[Flatten[Table[(2^x + 2^(2*y - x - 1))^2, {x, 0, 13}, {y, 0, 13}]]], IntegerQ]],49] (* Jean-François Alcover, Sep 13 2011 *)

Formula

k = 2^x + 2^(2y-x-1), and z = 2y - x - 1.
Conjecture: a(n) = 3*A263132(n). - George Beck, May 05 2021

A269837 Irregular triangle read by rows: even terms of A094728(n+1) divided by 4.

Original entry on oeis.org

1, 2, 4, 3, 6, 4, 9, 8, 5, 12, 10, 6, 16, 15, 12, 7, 20, 18, 14, 8, 25, 24, 21, 16, 9, 30, 28, 24, 18, 10, 36, 35, 32, 27, 20, 11, 42, 40, 36, 30, 22, 12, 49, 48, 45, 40, 33, 24, 13, 56, 54, 50, 44, 36, 26, 14, 64, 63, 60, 55, 48, 39, 28, 15
Offset: 0

Views

Author

Paul Curtz, Mar 06 2016

Keywords

Comments

See A264798 and A261046 for the Hydrogen atom and the Janet periodic table.
a(n) odd terms are again A264798.
Decomposition by multiplication i.e. a(n) = b(n)*c(n) by irregular triangle:
1, 1 1,
2, 1 2,
4, 3, 2, 1, 2, 3,
6, 4, = 2, 1, * 3, 4,
9, 8, 5, 3, 2, 1, 3, 4, 5,
12, 10, 6, 3, 2, 1, 4, 5, 6,
16, 15, 12, 7, 4, 3, 2, 1, 4, 5, 6, 7,
etc. etc. etc.
b(n) is duplicated A004736(n) or mirror of A122197(n+1). c(n) = A138099(n+1).
Decomposition by subtraction, a(n) = d(n) - e(n):
1, 1 0,
2, 2, 0,
4, 3, 4, 3, 0, 0,
6, 4, = 6, 5, - 0, 1,
9, 8, 5, 9, 8, 7, 0, 0, 2,
12, 10, 6, 12, 11, 10, 0, 1, 4,
16, 15, 12, 7, 16, 15, 14, 13, 0, 0, 2, 6,
20, 18, 14, 8, 20, 19, 18, 17, 0, 1, 4, 9,
etc. etc. etc.
d(n) is the natural numbers A000027 inverted by lines. e(n) will be studied (see A239873).
Sum of a(n) by diagonals: 1, 5, 13, 27, 48, ... . The third differences have the period 2: repeat 2, 1. See A002717.

Crossrefs

Programs

A300154 Consider a spiral on an infinite hexagonal grid. a(n) is the number of cells in the part of the spiral from 1st to n-th cell that are on the same column or diagonal (in any of three directions) as the n-th cell along the spiral, including that cell itself.

Original entry on oeis.org

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

Views

Author

Emily Chitwood and Kimberly Johnsen, Feb 26 2018

Keywords

Comments

A138099 and A280026 are analogs for the square grid. - Andrey Zabolotskiy, Mar 05 2018

Examples

			a(3) = 3 because the third hexagon is on the same diagonal as itself, the second hexagon, and the original hexagon.
a(7) = 5 because the 7th cell is on the same columns/diagonals as cells No. 2 (in one direction), 6 (in another direction), 1 and 4 (in the third direction), plus itself.
		

A355859 Triangle read by rows: T(n,k) = (n + k)/2 if (n + k) is congruent to 0 (mod 2), otherwise T(n,k) = 0; n >= 1, k >= 1.

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, Jul 19 2022

Keywords

Comments

Row sums see A001318.

Examples

			The triangle begins:
      k=1  2  3  4  5  6
  n=1:  1;
  n=2:  0, 2;
  n=3:  2, 0, 3;
  n=4:  0, 3, 0, 4;
  n=5:  3, 0, 4, 0, 5;
  n=6:  0, 4, 0, 5, 0, 6;
  and so on.
		

Crossrefs

Cf. A001318, A138099 (without the zeros).

Programs

  • Mathematica
    T[n_, k_] := If[EvenQ[n + k], (n + k)/2, 0]; Table[T[n, k], {n, 1, 13}, {k, 1, n}] // Flatten (* Amiram Eldar, Jul 19 2022 *)

A366421 a(n) is the floor of the n-th improper fraction (including the ones of the type n/n) sorted by increasing numerator+denominator, then by numerator.

Original entry on oeis.org

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

Views

Author

Mariano Masiello, Nov 16 2023

Keywords

Examples

			The first such fraction is 1/1, followed by 2/1, 2/2, 3/1, 3/2 and so on, then a(1)=[1/1]=1, a(2)=[2/1]=2, a(3)=[2/2]=1, a(4)=[3/1]=3, a(5)=[3/2]=1 and so on, where [.] is the floor function.
Terms begin:
  [1/1]=1,
  [2/1]=2,
  [2/2]=1, [3/1]=3,
  [3/2]=1, [4/1]=4,
  [3/3]=1, [4/2]=2, [5/1]=5,
  [4/3]=1, [5/2]=2, [6/1]=6,
  ...
		

Formula

a(n) = floor[A138099(n)/(A216607(n)+1)]
Showing 1-7 of 7 results.