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.

A209278 Second inverse function (numbers of rows) for pairing function A185180.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Jan 15 2013

Keywords

Examples

			The start of the sequence as table T(r,s) r,s >0 read by antidiagonals:
1...2...2...3...3...4...4...5...
1...3...2...4...3...5...4...6...
1...4...2...5...3...6...4...7...
1...5...2...6...3...7...4...8...
1...6...2...7...3...8...4...9...
1...7...2...8...3...9...4..10...
1...8...2...9...3..10...4..11...
. . .
The start of the sequence as triangle array read by rows:
1;
2, 1;
2, 3, 1;
3, 2, 4, 1;
3, 4, 2, 5, 1;
4, 3, 5, 2, 6, 1;
4, 5, 3, 6, 2, 7, 1;
5, 4, 6, 3, 7, 2, 8, 1;
. . .
Row number r contains permutation numbers form 1 to r.
If r is odd (r+1)/2, (r+1)/2 +1, (r+1)/2 -1, ... 2, r, 1.
If r is even r/2 + 1, r/2, r/2 + 2, ...  2, r, 1.
		

Crossrefs

Programs

  • Mathematica
    T[r_, s_] := If[OddQ[s], (s+1)/2, r + s/2];
    Table[T[r-s+1, s], {r, 1, 11}, {s, r, 1, -1}] // Flatten (* Jean-François Alcover, Nov 19 2019 *)
  • PARI
    T(r,s)=s\2+if(bittest(s,0),1,r) \\ - M. F. Hasler, Jan 15 2013
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    result=int((t+3)/2)+int(i/2)*(-1)**(i+t)
    

Formula

a(n) = floor((A003056(n)+3)/2) + floor(A002260(n)/2)*(-1)^(A002260(n)+A003056(n)).
a(n)= floor((t+3)/2)+ floor(i/2)*(-1)^(i+t),
where t=floor((-1+sqrt(8*n-7))/2), i=n-t*(t+1)/2.
T(r,2s-1)=s, T(r,2s)= r+s. (When read as square array by antidiagonals.)

A092543 Table below read by antidiagonals alternately upwards and downwards.

Original entry on oeis.org

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

Views

Author

Sam Alexander, Feb 27 2004

Keywords

Comments

1 2 3 4 5 ...
1 2 3 4 5 ...
1 2 3 4 5 ...
1 2 3 4 5 ...
...
Let A be sequence A092543 (this sequence) and B be sequence A092542 (1, 1, 2, 3, 2, 1, 1, ...). Under upper trimming or lower trimming, A transforms into B and B transforms into A. Also, B gives the number of times each element of A appears. For example, A(4) = 1 and B(4) = 3 because the 1 in A(4) is the third 1 to appear in A. - Kerry Mitchell, Dec 28 2005
First inverse function (numbers of rows) for pairing function A056011 and second inverse function (numbers of columns) for pairing function A056023. - Boris Putievskiy, Dec 24 2012
The rational numbers A092542(n)/a(n) can be systematically ordered and numbered in this way, as Georg Cantor first proved in 1873. - Martin Renner, Jun 05 2016

References

  • Amir D. Aczel, "The Mystery of the Aleph, Mathematics, the Kabbalah and the Search for Infinity", Barnes & Noble, NY 2000, page 112.

Crossrefs

Programs

  • Maple
    seq(seq(i-abs(i-j),j=1..2*i-1),i=2..20,2); # Robert Israel, Mar 01 2016
  • Mathematica
    Table[ Join[Range[2n], Reverse@Range[2n - 1]], {n, 7}] // Flatten (* Robert G. Wilson v, Sep 28 2006 *)

Formula

T(r,c)=c.
A092542(n)+a(n) = 1+A002024(n). - Enrique Pérez Herrero, Apr 01 2010
a(n) = ((-1)^t+1)*i/2-((-1)^t-1)*j/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 24 2012
G.f.: (1-x)^(-2)*Sum_{i>=0} x^(2*i^2+i+1)*(1-x^(2*i+2))^2. - Robert Israel, Mar 01 2016

A209279 First inverse function (numbers of rows) for pairing function A185180.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Jan 15 2013

Keywords

Comments

The triangle equals A158946 with the first column removed. - Georg Fischer, Jul 26 2023

Examples

			The start of the sequence as table T(r,s) r,s >0 read by antidiagonals:
  1...1...2...2...3...3...4...4...
  2...1...3...2...4...3...5...4...
  3...1...4...2...5...3...6...4...
  4...1...5...2...6...3...7...4...
  5...1...6...2...7...3...8...4...
  6...1...7...2...8...3...9...4...
  7...1...8...2...9...3..10...4...
  ...
The start of the sequence as triangle array read by rows:
  1;
  1, 2;
  2, 1, 3;
  2, 3, 1, 4;
  3, 2, 4, 1, 5;
  3, 4, 2, 5, 1, 6;
  4, 3, 5, 2, 6, 1, 7;
  4, 5, 3, 6, 2, 7, 1, 8;
  ...
Row number r contains permutation numbers form 1 to r.
If r is odd (r+1)/2, (r+1)/2-1, (r+1)/2+1,...r-1, 1, r.
If r is even r/2, r/2+1, r/2-1, ... r-1, 1, r.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := Abs[(2*k - 1 + (-1)^(n - k)*(2*n + 1))/4];
    Table[T[n, k], {n, 1, 15}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jun 14 2018, after Andrew Howroyd *)
  • PARI
    T(n, k)=abs((2*k-1+(-1)^(n-k)*(2*n+1))/4) \\ Andrew Howroyd, Dec 31 2017
    
  • Python
    # Edited by M. F. Hasler, May 30 2020
    def a(n):
       t = int((math.sqrt(8*n-7) - 1)/2);
       i = n-t*(t+1)/2;
       return int(t/2)+1+int(i/2)*(-1)**(i+t+1)

Formula

a(n) = floor((A003056(n)+2)/2)+ floor(A002260(n)/2)*(-1)^(A002260(n)+A003056(n)+1).
a(n) = |A128180(n)|.
a(n) = floor((t+2)/2) + floor(i/2)*(-1)^(i+t+1), where t=floor((-1+sqrt(8*n-7))/2), i=n-t*(t+1)/2.
T(r,2s)=s, T(r,2s-1)= r+s-1.(When read as table T(r,s) by antidiagonals.)
T(n,k) = ceiling((n + (-1)^(n-k)*k)/2) = (n+k)/2 if n-k even, otherwise (n-k+1)/2. - M. F. Hasler, May 30 2020

Extensions

Data corrected by Andrew Howroyd, Dec 31 2017

A322392 Array A read by antidiagonals: A(n,k) = n-th digit of the base k expansion of 1/n.

Original entry on oeis.org

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

Views

Author

Derek J. Graves, Dec 06 2018, on behalf of Joseph A. Stocke

Keywords

Examples

			A(10,9) = 8, as the 10th digit of the base 9 expansion of 1/10 = 0.0808080808080808080808080808... is 8.
Array A(n, k) begins:
n\k  1    2    3    4    5    6    7    8    9   10
1    0    0    0    0    0    0    0    0    0    0
2    0    0    1    0    2    0    3    0    4    0
3    0    0    0    1    1    0    2    2    0    3
4    0    0    2    0    1    0    5    0    2    0
5    0    0    0    0    0    1    1    1    1    0
6    0    0    1    2    4    0    1    2    4    6
7    0    0    0    0    0    0    0    1    1    1
8    0    0    1    0    3    0    6    0    1    0
9    0    0    0    3    3    0    3    0    0    1
10   0    0    0    1    2    3    4    6    8    0
		

Crossrefs

Supersequence of A061480.

Programs

  • Mathematica
    a = {}; l = 100; x = Table[ Join[Range[2n - 1], Reverse@ Range[2n - 2]], {n, l}] // Flatten; y = Table[ Join[Range[2m], Reverse@Range[2m - 1]], {m, l-1}] // Flatten; Do[a = Append[a, Mod[ Floor[1/Part[x, i] * Part[y,i]^Part[x, i]], Part[y,i]] ], {i, 1, l} ]; a

A079810 Sums of diagonals (upward from left to right) of the triangle shown in A079809.

Original entry on oeis.org

1, 1, 5, 3, 8, 8, 16, 12, 21, 21, 33, 27, 40, 40, 56, 48, 65, 65, 85, 75, 96, 96, 120, 108, 133, 133, 161, 147, 176, 176, 208, 192, 225, 225, 261, 243, 280, 280, 320, 300, 341, 341, 385, 363, 408, 408, 456, 432, 481, 481, 533, 507, 560, 560, 616, 588, 645, 645
Offset: 1

Views

Author

Amarnath Murthy, Feb 10 2003

Keywords

Examples

			a(7) = T(7,1) + T(6,2) + T(5,3) + T(4,4) = 7 + 2 + 3 + 4 = 16.
		

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 71); Coefficients(R!( x*(1+4*x^2-2*x^3+3*x^4)/((1-x)*(1-x^4)^2) )); // G. C. Greubel, Dec 12 2023
    
  • Mathematica
    LinearRecurrence[{1,0,0,2,-2,0,0,-1,1}, {1,1,5,3,8,8,16,12,21}, 70] (* G. C. Greubel, Dec 12 2023 *)
  • SageMath
    def A079810_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( x*(1+4*x^2-2*x^3+3*x^4)/((1-x)*(1-x^4)^2) ).list()
    a=A079810_list(71); a[1:] # G. C. Greubel, Dec 12 2023

Formula

a(4k) = 3k^2. a(4k+1) = a(4k+2) = 3k^2+4k+1. a(4k+3) = 3k^2+8k+5.
From Chai Wah Wu, Feb 03 2021: (Start)
a(n) = a(n-1) + 2*a(n-4) - 2*a(n-5) - a(n-8) + a(n-9) for n > 9.
G.f.: x*(1 + 4*x^2 - 2*x^3 + 3*x^4)/((1 - x)^3*(1 + x)^2*(1 + x^2)^2). (End)
From G. C. Greubel, Dec 12 2023: (Start)
a(n) = (1/32)*( (6*n^2 + 14*n + 5) - (-1)^n*(10*n + 9) + 2*((3 - i)*(-i)^n + (3 + i)*i^n) - 8*(-1)^floor(n/2)*floor((n+2)/2) ).
E.g.f.: 4*(1-x)*cos(x) - 4*(2-x)*sin(x) + 2*(3*x^2 + 15*x - 2)*cosh(x) 2*(3*x^2 + 5*x + 7)*sinh(x). (End)

Extensions

Edited by David Wasserman, May 11 2004

A079811 Sum of numbers read upward at a 45-degree angle in A079809.

Original entry on oeis.org

1, 2, 2, 6, 7, 10, 10, 18, 19, 24, 24, 36, 37, 44, 44, 60, 61, 70, 70, 90, 91, 102, 102, 126, 127, 140, 140, 168, 169, 184, 184, 216, 217, 234, 234, 270, 271, 290, 290, 330, 331, 352, 352, 396, 397, 420, 420, 468, 469, 494, 494, 546, 547, 574, 574, 630, 631
Offset: 1

Views

Author

Amarnath Murthy, Feb 10 2003

Keywords

Crossrefs

The two bisections are A309805 and twice A211538 (with leading zeros dropped).

Extensions

Terms a(8) and beyond from Andrey Zabolotskiy, Jan 18 2024

A354459 Lazy cutter's sequence (see Comments).

Original entry on oeis.org

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

Views

Author

Ivan N. Ianakiev, May 31 2022

Keywords

Comments

From the infinite sequence G of fractions that may be used to demonstrate the countability of rational numbers, where a(n) = A092542(n)/A092543(n), form a new sequence H by taking only those terms of G that are proper fractions unequal to a fraction that appears earlier in H (making H the list of all proper fractions without repetitions). Let b/c be the n-th term of H and b be the number of congruent pizzas that have to be equally divided between c people by means of radial cuts. a(n) is the minimum number of cuts to achieve such a division.
H can be directly calculated as its n-th term equals A182972(n)/A182973(n). H starts with 1/2, 1/3, 1/4, 2/3, 1/5, 1/6, 2/5, 3/4, 3/5, 1/7, 1/8, 2/7, 4/5, 3/7, 1/9.
As a(n) is equal for all proper fractions b/c such that b + c = n, counting the number of equal consecutive terms of this sequence gives A023022 from its third term onwards (see Geoffrey Critzer's and Reinhard Zumkeller's comments at A023022).

Examples

			To equally divide 4 pizzas between 7 people we can divide each pizza into 7 equal parts with 7 radial cuts making the total number of cuts 28 (far from minimal). Ancient Egyptians, representing 4/7 as 1/2 + 1/14, would cut all pizzas into halves (8 cuts) and one of the halves into 7 equal pieces (6 additional cuts), making the total number of cuts 8 + 6 = 14. We can do even better by cutting each pizza into two pieces (3/7 and 4/7), for a total of 8 cuts, and dividing one 3/7 piece to 3 equal pieces (2 additional cuts), minimizing the total number of cuts to 8 + 2 = 10. Since the 19th term of H sequence is 4/7, a(19) = 10.
		

Crossrefs

Programs

  • Mathematica
    a092542=Flatten[Table[Join[Range[2n-1],Reverse@Range[2n-2]],{n,12}]];
    a092543=Take[Cases[Import["https://oeis.org/A092543/b092543.txt","Table"],{,}][[All,2]],276];g=a092542/a092543; h=DeleteDuplicates[Select[g,#<1&]];
    a[n_]:=Module[{x=Floor[Denominator[n]/Numerator[n]],r=Mod[Denominator[n],
    Numerator[n]]},(x+1)*Numerator[n]+r-1];a/@h

Formula

h(n) = A182972(n)/A182973(n) = b/c, c = x*b + r and a(n) = (x+1)*b + r - 1.
Showing 1-7 of 7 results.