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-10 of 155 results. Next

A344534 For any number n with binary expansion Sum_{k = 1..m} 2^e_k (where 0 <= e_1 < ... < e_m), a(n) = Product_{k = 1..m} prime(1+A002262(e_k))^2^A025581(e_k) (where prime(k) denotes the k-th prime number).

Original entry on oeis.org

1, 2, 4, 8, 3, 6, 12, 24, 16, 32, 64, 128, 48, 96, 192, 384, 9, 18, 36, 72, 27, 54, 108, 216, 144, 288, 576, 1152, 432, 864, 1728, 3456, 5, 10, 20, 40, 15, 30, 60, 120, 80, 160, 320, 640, 240, 480, 960, 1920, 45, 90, 180, 360, 135, 270, 540, 1080, 720, 1440
Offset: 0

Views

Author

Rémy Sigrist, May 22 2021

Keywords

Comments

The ones in the binary expansion of n encode the Fermi-Dirac factors of a(n).
The following table gives the rank of the bit corresponding to the Fermi-Dirac factor p^2^k:
...
7| 9
5| 5 8
3| 2 4 7
2| 0 1 3 6
---+--------
p/k| 0 1 2 3 ...
This sequence is a bijection from the nonnegative integers to the positive integers with inverse A344536.
This sequence establishes a bijection from A261195 to A225547.
This sequence and A344535 each map between two useful choices for encoding sets of elements drawn from a 2-dimensional array. To give a very specific example, each mapping is an isomorphism between two alternative integer representations of the polynomial ring GF2[x,y]. The relevant set is {x^i*y^j : i, j >= 0}. The mappings between the two representations of the ring's addition operation are from XOR (A003987) to A059897(.,.) and for the multiplication operation, they are from A329331(.,.) to A329329(.,.). - Peter Munn, May 31 2021

Examples

			For n = 42:
- 42 = 2^5 + 2^3 + 2^1,
- so we have the following Fermi-Dirac factors p^2^k:
      5| X
      3|
      2|   X X
    ---+------
    p/k| 0 1 2
- a(42) = 2^2^1 * 2^2^2 * 5^2^0 = 320.
		

Crossrefs

Comparable mappings that also use Fermi-Dirac factors: A052330, A059900.
Maps binary operations A003987 to A059897, A329331 to A329329.

Programs

  • PARI
    A002262(n)=n-binomial(round(sqrt(2+2*n)), 2)
    A025581(n)=binomial(1+floor(1/2+sqrt(2+2*n)), 2)-(n+1)
    a(n) = { my (v=1, e); while (n, n-=2^e=valuation(n, 2); v* = prime(1 + A002262(e))^2^A025581(e)); v }

Formula

a(n) = A344535(A344531(n)).
a(n) = A344535(n) iff n belongs to A261195.
A064547(a(n)) = A000120(n).
a(A036442(n)) = prime(n).
a(A006125(n+1)) = 2^2^n for any n >= 0.
a(m + n) = a(m) * a(n) when m AND n = 0 (where AND denotes the bitwise AND operator).
From Peter Munn, Jun 06 2021: (Start)
a(n) = A225546(A344535(n)).
a(n XOR k) = A059897(a(n), a(k)), where XOR denotes bitwise exclusive-or, A003987.
a(A329331(n, k)) = A329329(a(n), a(k)).
(End)

A344535 For any number n with binary expansion Sum_{k = 1..m} 2^e_k (where 0 <= e_1 < ... < e_m), a(n) = Product_{k = 1..m} prime(1+A025581(e_k))^2^A002262(e_k) (where prime(k) denotes the k-th prime number).

Original entry on oeis.org

1, 2, 3, 6, 4, 8, 12, 24, 5, 10, 15, 30, 20, 40, 60, 120, 9, 18, 27, 54, 36, 72, 108, 216, 45, 90, 135, 270, 180, 360, 540, 1080, 16, 32, 48, 96, 64, 128, 192, 384, 80, 160, 240, 480, 320, 640, 960, 1920, 144, 288, 432, 864, 576, 1152, 1728, 3456, 720, 1440
Offset: 0

Views

Author

Rémy Sigrist, May 22 2021

Keywords

Comments

The ones in the binary expansion of n encode the Fermi-Dirac factors of a(n).
The following table gives the rank of the bit corresponding to the Fermi-Dirac factor p^2^k:
...
7| 6
5| 3 7
3| 1 4 8
2| 0 2 5 9
---+--------
p/k| 0 1 2 3 ...
This sequence is a bijection from the nonnegative integers to the positive integers with inverse A344537.
This sequence establishes a bijection from A261195 to A225547.

Examples

			For n = 42:
- 42 = 2^5 + 2^3 + 2^1,
- so we have the following Fermi-Dirac factors p^2^k:
      5| X
      3| X
      2|     X
    ---+------
    p/k| 0 1 2
- a(42) = 3^2^0 * 5^2^0 * 2^2^2 = 240.
		

Crossrefs

Programs

  • PARI
    A002262(n)=n-binomial(round(sqrt(2+2*n)), 2)
    A025581(n)=binomial(1+floor(1/2+sqrt(2+2*n)), 2)-(n+1)
    a(n) = { my (v=1, e); while (n, n-=2^e=valuation(n, 2); v *= prime(1 + A025581(e))^2^A002262(e)); v }

Formula

a(n) = A344534(A344531(n)).
a(n) = A344534(n) iff n belongs to A261195.
A064547(a(n)) = A000120(n).
a(A006125(n)) = prime(n) for any n > 0.
a(A036442(n+1)) = 2^2^n for any n >= 0.
a(m + n) = a(m) * a(n) when m AND n = 0 (where AND denotes the bitwise AND operator).

A182245 Integers n such that either (a) A186053(n) does not equal A002024(n) + A182298(A025581(n)) or (b) A182298(n) does not equal 1 + A002024(n) + A186053(A025581(n)).

Original entry on oeis.org

0, 2, 4, 7, 8, 11, 16, 17, 29, 92, 125, 154, 155, 174, 361, 390, 441, 473, 529, 564, 601, 637, 704, 742, 743, 783, 837, 1003, 1147, 1184, 1340, 1341, 1380, 1394, 1548, 1549, 1606, 1665, 1771, 1772, 1833, 1896
Offset: 1

Views

Author

Patrick Devlin, Apr 23 2012

Keywords

Comments

Comprehensive list of the 177 terms can be found in the paper. The link proves this list of counterexamples is comprehensive, but there is nothing currently known that explains the behavior of this list.

Crossrefs

Cf. A186053.

Extensions

Missing term 1548 added by Michel Marcus, May 27 2015

A182246 Integers n such that A186053(n) does not equal A002024(n) + A182298(A025581(n)).

Original entry on oeis.org

2, 4, 7, 8, 11, 16, 17, 29, 125, 154, 155, 174, 390, 473, 564, 601, 637, 704, 742, 743, 783, 1147, 1340, 1341, 1394, 1549, 1606, 1665, 1771, 1772, 1833, 1896
Offset: 1

Views

Author

Patrick Devlin, Apr 23 2012

Keywords

Comments

A comprehensive list of the 114 counterexamples can be found in the Devlin paper.

A182321 Number of iterations of A025581(n) required to reach 0.

Original entry on oeis.org

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

Views

Author

Patrick Devlin, Apr 24 2012

Keywords

Comments

Following the notation in the link, for n >= 0, let n = (0 + 1 + 2 + ... + f(n)) - g(n) be the representation of n with f(n) and g(n) minimal such that 0 <= g(n) <= f(n). Then f(n) = A002024(n) = round(sqrt(2n)), and g(n) = A025581(n) = f(n)*(f(n)+1)/2 - n.
With this notation, a(n) is the number of iterations of g(n) needed to reach 0.
The sequence a(n) is essentially the function phi(n) of the link.
The sequence a(n) has a high degree of fractal-like symmetry. Consider, for instance, the sequence in the triangular array (read left to right then top to bottom, with the term for a(0) on top):
0
1
2 1
3 2 1
2 3 2 1
Then the rows of this triangle (read from right to left) are simply 1+a(n).
a(n) is related to the recurrence between A186053 and A182298.
For n >= 1, a(n) is the number of terms in the minimal alternating triangular-number representation of n+1, defined at A255974. - Clark Kimberling, Apr 10 2015

Examples

			g(8) = 2, g(2) = 1, g(1) = 0.  Therefore a(8) = 3.
		

Crossrefs

Programs

  • Maple
    # With this code, the n-th term of the sequence is given by a call to a(n)
    f:=n->round(sqrt(2*n)): g:=n->f(n)*(f(n)+1)/2-n:
    a:=proc(n) option remember:
      if n < 1 then return 0: fi: return 1 + a(g(n)):
    end proc:
  • Mathematica
    (* This program computes the sequence as the number of terms in the minimal alternative triangular-number representation of n+1. *)
    b[n_] := n (n + 1)/2; bb = Table[b[n], {n, 0, 1000}];
    s[n_] := Table[b[n], {k, 1, n}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]]; g = h[100]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Join[{0}, Rest[Table[Length[r[n]], {n, 0, 100}]]] (* A182321 for n >= 1 *)
    (* Clark Kimberling, Apr 10 2015 *)

Formula

The Devlin link shows a(n) < log_2(log_2(n/2)) + 2.

A359393 a(n) is the number of times A025581(n-1) (runs of k..0) occur among terms a(1..n-1).

Original entry on oeis.org

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

Views

Author

Tamas Sandor Nagy, Dec 29 2022

Keywords

Comments

An inventory sequence variation.

Examples

			The recorded terms of the sequence:
                Zero 0's thus far
                |    Zero 1's thus far
                |    |  Two 0's thus far
                |    |  |    One 2's thus far
                |    |  |    |  One 1's thus far
                |    |  |    |  |  Two 0's thus far
                |    |  |    |  |  |
This sequence:  0,   0, 2,   1, 1, 2, ...
      A025581:  0,   1, 0,   2, 1, 0, ...
		

Crossrefs

Cf. A032531 (with runs increasing), A025581, A342585.

Programs

  • PARI
    \\ See links.

A182266 Integers n such that A182298(n) does not equal 1 + A002024(n) + A186053(A025581(n)).

Original entry on oeis.org

0, 92, 154, 174, 361, 441, 473, 529, 564, 637, 742, 743, 783, 837, 1003, 1147, 1184, 1340, 1380, 1394, 1606, 1665, 1771, 1833, 1896, 2173, 2241, 2279, 2508, 2581, 2867, 2945, 3250, 3333, 3336, 3503, 3588, 3657, 3745, 3925
Offset: 1

Views

Author

Patrick Devlin, Apr 23 2012

Keywords

Comments

Comprehensive list of the 139 numbers are in the link. The link proves this list of counterexamples is comprehensive, but there is nothing currently known that explains the behavior of this list.

A002260 Triangle read by rows: T(n,k) = k for n >= 1, k = 1..n.

Original entry on oeis.org

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

Views

Author

Angele Hamel (amh(AT)maths.soton.ac.uk)

Keywords

Comments

Old name: integers 1 to k followed by integers 1 to k+1 etc. (a fractal sequence).
Start counting again and again.
This is a "doubly fractal sequence" - see the Franklin T. Adams-Watters link.
The PARI functions t1, t2 can be used to read a square array T(n,k) (n >= 1, k >= 1) by antidiagonals downwards: n -> T(t1(n), t2(n)). - Michael Somos, Aug 23 2002
Reading this sequence as the antidiagonals of a rectangular array, row n is (n,n,n,...); this is the weight array (Cf. A144112) of the array A127779 (rectangular). - Clark Kimberling, Sep 16 2008
The upper trim of an arbitrary fractal sequence s is s, but the lower trim of s, although a fractal sequence, need not be s itself. However, the lower trim of A002260 is A002260. (The upper trim of s is what remains after the first occurrence of each term is deleted; the lower trim of s is what remains after all 0's are deleted from the sequence s-1.) - Clark Kimberling, Nov 02 2009
Eigensequence of the triangle = A001710 starting (1, 3, 12, 60, 360, ...). - Gary W. Adamson, Aug 02 2010
The triangle sums, see A180662 for their definitions, link this triangle of natural numbers with twenty-three different sequences, see the crossrefs. The mirror image of this triangle is A004736. - Johannes W. Meijer, Sep 22 2010
A002260 is the self-fission of the polynomial sequence (q(n,x)), where q(n,x) = x^n + x^(n-1) + ... + x + 1. See A193842 for the definition of fission. - Clark Kimberling, Aug 07 2011
Sequence B is called a reluctant sequence of sequence A, if B is triangle array read by rows: row number k coincides with first k elements of the sequence A. Sequence A002260 is reluctant sequence of sequence 1,2,3,... (A000027). - Boris Putievskiy, Dec 12 2012
This is the maximal sequence of positive integers, such that once an integer k has occurred, the number of k's always exceeds the number of (k+1)'s for the remainder of the sequence, with the first occurrence of the integers being in order. - Franklin T. Adams-Watters, Oct 23 2013
A002260 are the k antidiagonal numerators of rationals in Cantor's proof of 1-to-1 correspondence between rationals and naturals; the denominators are k-numerator+1. - Adriano Caroli, Mar 24 2015
T(n,k) gives the distance to the largest triangular number < n. - Ctibor O. Zizka, Apr 09 2020

Examples

			First six rows:
  1
  1   2
  1   2   3
  1   2   3   4
  1   2   3   4   5
  1   2   3   4   5   6
		

References

  • Clark Kimberling, "Fractal sequences and interspersions," Ars Combinatoria 45 (1997) 157-168. (Introduces upper trimming, lower trimming, and signature sequences.)
  • M. Myers, Smarandache Crescendo Subsequences, R. H. Wilde, An Anthology in Memoriam, Bristol Banner Books, Bristol, 1998, p. 19.
  • F. Smarandache, Sequences of Numbers Involved in Unsolved Problems, Hexis, Phoenix, 2006.

Crossrefs

Cf. A140756 (alternating signs).
Triangle sums (see the comments): A000217 (Row1, Kn11); A004526 (Row2); A000096 (Kn12); A055998 (Kn13); A055999 (Kn14); A056000 (Kn15); A056115 (Kn16); A056119 (Kn17); A056121 (Kn18); A056126 (Kn19); A051942 (Kn110); A101859 (Kn111); A132754 (Kn112); A132755 (Kn113); A132756 (Kn114); A132757 (Kn115); A132758 (Kn116); A002620 (Kn21); A000290 (Kn3); A001840 (Ca2); A000326 (Ca3); A001972 (Gi2); A000384 (Gi3).
Cf. A108872.

Programs

  • Haskell
    a002260 n k = k
    a002260_row n = [1..n]
    a002260_tabl = iterate (\row -> map (+ 1) (0 : row)) [1]
    -- Reinhard Zumkeller, Aug 04 2014, Jul 03 2012
    
  • Maple
    at:=0; for n from 1 to 150 do for i from 1 to n do at:=at+1; lprint(at,i); od: od: # N. J. A. Sloane, Nov 01 2006
    seq(seq(i,i=1..k),k=1..13); # Peter Luschny, Jul 06 2009
  • Mathematica
    FoldList[{#1, #2} &, 1, Range[2, 13]] // Flatten (* Robert G. Wilson v, May 10 2011 *)
    Flatten[Table[Range[n],{n,20}]] (* Harvey P. Dale, Jun 20 2013 *)
  • Maxima
    T(n,k):=sum((i+k)*binomial(i+k-1,i)*binomial(k,n-i-k+1)*(-1)^(n-i-k+1),i,max(0,n+1-2*k),n-k+1); /* Vladimir Kruchinin, Oct 18 2013 */
    
  • PARI
    t1(n)=n-binomial(floor(1/2+sqrt(2*n)),2) /* this sequence */
    
  • PARI
    A002260(n)=n-binomial((sqrtint(8*n)+1)\2,2) \\ M. F. Hasler, Mar 10 2014
    
  • Python
    from math import isqrt, comb
    def A002260(n): return n-comb((m:=isqrt(k:=n<<1))+(k>m*(m+1)),2) # Chai Wah Wu, Nov 08 2024

Formula

a(n) = 1 + A002262(n).
n-th term is n - m*(m+1)/2 + 1, where m = floor((sqrt(8*n+1) - 1) / 2).
The above formula is for offset 0; for offset 1, use a(n) = n-m*(m+1)/2 where m = floor((-1+sqrt(8*n-7))/2). - Clark Kimberling, Jun 14 2011
a(k * (k + 1) / 2 + i) = i for k >= 0 and 0 < i <= k + 1. - Reinhard Zumkeller, Aug 14 2001
a(n) = (2*n + round(sqrt(2*n)) - round(sqrt(2*n))^2)/2. - Brian Tenneson, Oct 11 2003
a(n) = n - binomial(floor((1+sqrt(8*n))/2), 2). - Paul Barry, May 25 2004
T(n,k) = A001511(A118413(n,k)); T(n,k) = A003602(A118416(n,k)). - Reinhard Zumkeller, Apr 27 2006
a(A000217(n)) = A000217(n) - A000217(n-1), a(A000217(n-1) + 1) = 1, a(A000217(n) - 1) = A000217(n) - A000217(n-1) - 1. - Alexander R. Povolotsky, May 28 2008
a(A169581(n)) = A038566(n). - Reinhard Zumkeller, Dec 02 2009
T(n,k) = Sum_{i=1..k} i*binomial(k,i)*binomial(n-k,n-i) (regarded as triangle, see the example). - Mircea Merca, Apr 11 2012
T(n,k) = Sum_{i=max(0,n+1-2*k)..n-k+1} (i+k)*binomial(i+k-1,i)*binomial(k,n-i-k+1)*(-1)^(n-i-k+1). - Vladimir Kruchinin, Oct 18 2013
G.f.: x*y / ((1 - x) * (1 - x*y)^2) = Sum_{n,k>0} T(n,k) * x^n * y^k. - Michael Somos, Sep 17 2014
a(n) = n - S(n) where S(n) = sum of distinct terms in {a(1), a(2), ..., a(n-1)}. - David James Sycamore, Mar 10 2025

Extensions

More terms from Reinhard Zumkeller, Apr 27 2006
Incorrect program removed by Franklin T. Adams-Watters, Mar 19 2010
New name from Omar E. Pol, Jul 15 2012

A004736 Triangle read by rows: row n lists the first n positive integers in decreasing order.

Original entry on oeis.org

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

Views

Author

R. Muller

Keywords

Comments

Old name: Triangle T(n,k) = n-k, n >= 1, 0 <= k < n. Fractal sequence formed by repeatedly appending strings m, m-1, ..., 2, 1.
The PARI functions t1 (this sequence), t2 (A002260) can be used to read a square array T(n,k) (n >= 1, k >= 1) by antidiagonals upwards: n -> T(t1(n), t2(n)). - Michael Somos, Aug 23 2002, edited by M. F. Hasler, Mar 31 2020
A004736 is the mirror of the self-fission of the polynomial sequence (q(n,x)) given by q(n,x) = x^n+ x^(n-1) + ... + x + 1. See A193842 for the definition of fission. - Clark Kimberling, Aug 07 2011
Seen as flattened list: a(A000217(n)) = 1; a(A000124(n)) = n and a(m) <> n for m < A000124(n). - Reinhard Zumkeller, Jul 22 2012
Sequence B is called a reverse reluctant sequence of sequence A, if B is triangle array read by rows: row number k lists first k elements of the sequence A in reverse order. Sequence A004736 is the reverse reluctant sequence of sequence 1,2,3,... (A000027). - Boris Putievskiy, Dec 13 2012
The row sums equal A000217(n). The alternating row sums equal A004526(n+1). The antidiagonal sums equal A002620(n+1) respectively A008805(n-1). - Johannes W. Meijer, Sep 28 2013
From Peter Bala, Jul 29 2014: (Start)
Riordan array (1/(1-x)^2,x). Call this array M and for k = 0,1,2,... define M(k) to be the lower unit triangular block array
/I_k 0\
\ 0 M/
having the k X k identity matrix I_k as the upper left block; in particular, M(0) = M. Then the infinite matrix product M(0)*M(1)*M(2)*... is equal to A078812. (End)
T(n, k) gives the number of subsets of [n] := {1, 2, ..., n} with k consecutive numbers (consecutive k-subsets of [n]). - Wolfdieter Lang, May 30 2018
a(n) gives the distance from (n-1) to the smallest triangular number > (n-1). - Ctibor O. Zizka, Apr 09 2020
To construct the sequence, start from 1,2,,3,,,4,,,,5,,,,,6... where there are n commas after each "n". Then fill the empty places by the sequence itself. - Benoit Cloitre, Aug 17 2021
T(n,k) is the number of cycles of length 2*(k+1) in the (n+1)-ladder graph. There are no cycles of odd length. - Mohammed Yaseen, Jan 14 2023
The first 77 entries are also the signature sequence of log(3)=A002391. Then the two sequences start to differ. - R. J. Mathar, May 27 2024

Examples

			The triangle T(n, k) starts:
   n\k  1  2  3  4  5  6  7  8  9 10 11 12 ...
   1:   1
   2:   2  1
   3:   3  2  1
   4:   4  3  2  1
   5:   5  4  3  2  1
   6:   6  5  4  3  2  1
   7:   7  6  5  4  3  2  1
   8:   8  7  6  5  4  3  2  1
   9:   9  8  7  6  5  4  3  2  1
  10:  10  9  8  7  6  5  4  3  2  1
  11:  11 10  9  8  7  6  5  4  3  2  1
  12:  12 11 10  9  8  7  6  5  4  3  2  1
  ... Reformatted. - _Wolfdieter Lang_, Feb 04 2015
T(6, 3) = 4 because the four consecutive 3-subsets of [6] = {1, 2, ..., 6} are {1, 2, 3}, {2, 3, 4}, {3, 4, 5} and {4, 5, 6}. - _Wolfdieter Lang_, May 30 2018
		

References

  • H. S. M. Coxeter, Regular Polytopes, 3rd ed., Dover, NY, 1973, pp 159-162.

Crossrefs

Ordinal transform of A002260. See also A078812.
Cf. A141419 (partial sums per row).
Cf. A134546 (T * A051731, matrix product).
See A001511 for definition of ordinal transform.
Cf. A128174 (parity).

Programs

  • Excel
    =if(row()>=column();row()-column()+1;"") [Mats Granvik, Jan 19 2009]
    
  • Haskell
    a004736 n k = n - k + 1
    a004736_row n = a004736_tabl !! (n-1)
    a004736_tabl = map reverse a002260_tabl
    -- Reinhard Zumkeller, Aug 04 2014, Jul 22 2012
    
  • Maple
    A004736 := proc(n,m) n-m+1 ; end:
    T := (n, k) -> n-k+1: seq(seq(T(n,k), k=1..n), n=1..13); # Johannes W. Meijer, Sep 28 2013
  • Mathematica
    Flatten[ Table[ Reverse[ Range[n]], {n, 12}]] (* Robert G. Wilson v, Apr 27 2004 *)
    Table[Range[n,1,-1],{n,20}]//Flatten (* Harvey P. Dale, May 27 2020 *)
  • PARI
    {a(n) = 1 + binomial(1 + floor(1/2 + sqrt(2*n)), 2) - n}
    
  • PARI
    {t1(n) = binomial( floor(3/2 + sqrt(2*n)), 2) - n + 1} /* A004736 */
    
  • PARI
    {t2(n) = n - binomial( floor(1/2 + sqrt(2*n)), 2)} /* A002260 */
    
  • PARI
    apply( A004736(n)=1-n+(n=sqrtint(8*n)\/2)*(n+1)\2, [1..99]) \\ M. F. Hasler, Mar 31 2020
    
  • Python
    def agen(rows):
        for n in range(1, rows+1): yield from range(n, 0, -1)
    print([an for an in agen(13)]) # Michael S. Branicky, Aug 17 2021
    
  • Python
    from math import comb, isqrt
    def A004736(n): return comb((m:=isqrt(k:=n<<1))+(k>m*(m+1))+1,2)+1-n # Chai Wah Wu, Nov 08 2024

Formula

a(n+1) = 1 + A025581(n).
a(n) = (2 - 2*n + round(sqrt(2*n)) + round(sqrt(2*n))^2)/2. - Brian Tenneson, Oct 11 2003
G.f.: 1 / ((1-x)^2 * (1-x*y)). - Ralf Stephan, Jan 23 2005
Recursion: e(n,k) = (e(n - 1, k)*e(n, k - 1) + 1)/e(n - 1, k - 1). - Roger L. Bagula, Mar 25 2009
a(n) = (t*t+3*t+4)/2-n, where t = floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 13 2012
From Johannes W. Meijer, Sep 28 2013: (Start)
T(n, k) = n - k + 1, n >= 1 and 1 <= k <= n.
T(n, k) = A002260(n+k-1, n-k+1). (End)
a(n) = A000217(A002024(n)) - n + 1. - Enrique Pérez Herrero, Aug 29 2016

Extensions

New name from Omar E. Pol, Jul 15 2012

A002024 k appears k times; a(n) = floor(sqrt(2n) + 1/2).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Integer inverse function of the triangular numbers A000217. The function trinv(n) = floor((1+sqrt(1+8n))/2), n >= 0, gives the values 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, ..., that is, the same sequence with offset 0. - N. J. A. Sloane, Jun 21 2009
Array T(k,n) = n+k-1 read by antidiagonals.
Eigensequence of the triangle = A001563. - Gary W. Adamson, Dec 29 2008
Can apparently also be defined via a(n+1)=b(n) for n >= 2 where b(0)=b(1)=1 and b(n) = b(n-b(n-2))+1. Tested to be correct for all n <= 150000. - José María Grau Ribas, Jun 10 2011
For any n >= 0, a(n+1) is the least integer m such that A000217(m)=m(m+1)/2 is larger than n. This is useful when enumerating representations of n as difference of triangular numbers; see also A234813. - M. F. Hasler, Apr 19 2014
Number of binary digits of A023758, i.e., a(n) = ceiling(log_2(A023758(n+2))). - Andres Cicuttin, Apr 29 2016
a(n) and A002260(n) give respectively the x(n) and y(n) coordinates of the sorted sequence of points in the integer lattice such that x(n) > 0, 0 < y(n) <= x(n), and min(x(n), y(n)) < max(x(n+1), y(n+1)) for n > 0. - Andres Cicuttin, Dec 25 2016
Partial sums (A060432) are given by S(n) = (-a(n)^3 + a(n)*(1+6n))/6. - Daniel Cieslinski, Oct 23 2017
As an array, T(k,n) is the number of digits columns used in carryless multiplication between a k-digit number and an n-digit number. - Stefano Spezia, Sep 24 2022
a(n) is the maximum number of possible solutions to an n-statement Knights and Knaves Puzzle, where each statement is of the form "x of us are knights" for some 1 <= x <= n, knights can only tell the truth and knaves can only lie. - Taisha Charles and Brittany Ohlinger, Jul 29 2023

Examples

			From _Clark Kimberling_, Sep 16 2008: (Start)
As a rectangular array, a northwest corner:
  1 2 3 4 5 6
  2 3 4 5 6 7
  3 4 5 6 7 8
  4 5 6 7 8 9
This is the weight array (cf. A144112) of A107985 (formatted as a rectangular array). (End)
G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 3*x^5 + 3*x^6 + 4*x^7 + 4*x^9 + 4*x^9 + 4*x^10 + ...
		

References

  • Edward S. Barbeau, Murray S. Klamkin, and William O. J. Moser, Five Hundred Mathematical Challenges, Prob. 441, pp. 41, 194. MAA 1995.
  • R. L. Graham, D. E. Knuth, and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 97.
  • K. Hardy and K. S. Williams, The Green Book of Mathematical Problems, p. 59, Solution to Prob. 14, Dover NY, 1985
  • R. Honsberger, Mathematical Morsels, pp. 133-134, MAA 1978.
  • J. F. Hurley, Litton's Problematical Recreations, pp. 152; 313-4 Prob. 22, VNR Co., NY, 1971.
  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 1, p. 43.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.

Crossrefs

a(n+1) = 1+A003056(n), A022846(n)=a(n^2), a(n+1)=A002260(n)+A025581(n).
A123578 is an essentially identical sequence.

Programs

  • Haskell
    a002024 n k = a002024_tabl !! (n-1) !! (k-1)
    a002024_row n = a002024_tabl !! (n-1)
    a002024_tabl = iterate (\xs@(x:_) -> map (+ 1) (x : xs)) [1]
    a002024_list = concat a002024_tabl
    a002024' = round . sqrt . (* 2) . fromIntegral
    -- Reinhard Zumkeller, Jul 05 2015, Feb 12 2012, Mar 18 2011
    
  • Haskell
    a002024_list = [1..] >>= \n -> replicate n n
    
  • Haskell
    a002024 = (!!) $ [1..] >>= \n -> replicate n n
    -- Sascha Mücke, May 10 2016
    
  • Magma
    [Floor(Sqrt(2*n) + 1/2): n in [1..80]]; // Vincenzo Librandi, Nov 19 2014
    
  • Maple
    A002024 := n-> ceil((sqrt(1+8*n)-1)/2); seq(A002024(n), n=1..100);
  • Mathematica
    a[1] = 1; a[n_] := a[n] = a[n - a[n - 1]] + 1 (* Branko Curgus, May 12 2009 *)
    Table[n, {n, 13}, {n}] // Flatten (* Robert G. Wilson v, May 11 2010 *)
    Table[PadRight[{},n,n],{n,15}]//Flatten (* Harvey P. Dale, Jan 13 2019 *)
  • PARI
    t1(n)=floor(1/2+sqrt(2*n)) /* A002024 = this sequence */
    
  • PARI
    t2(n)=n-binomial(floor(1/2+sqrt(2*n)),2) /* A002260(n-1) */
    
  • PARI
    t3(n)=binomial(floor(3/2+sqrt(2*n)),2)-n+1 /* A004736 */
    
  • PARI
    t4(n)=n-1-binomial(floor(1/2+sqrt(2*n)),2) /* A002260(n-1)-1 */
    
  • PARI
    A002024(n)=(sqrtint(n*8)+1)\2 \\ M. F. Hasler, Apr 19 2014
    
  • PARI
    a(n)=(sqrtint(8*n-7)+1)\2
    
  • PARI
    a(n)=my(k=1);while(binomial(k+1,2)+1<=n,k++);k \\ R. J. Cano, Mar 17 2014
    
  • Python
    from math import isqrt
    def A002024(n): return (isqrt(8*n)+1)//2 # Chai Wah Wu, Feb 02 2022
  • Sage
    [floor(sqrt(2*n) +1/2) for n in (1..80)] # G. C. Greubel, Dec 10 2018
    

Formula

a(n) = floor(1/2 + sqrt(2n)). Also a(n) = ceiling((sqrt(1+8n)-1)/2). [See the Liu link for a large collection of explicit formulas. - N. J. A. Sloane, Oct 30 2019]
a((k-1)*k/2 + i) = k for k > 0 and 0 < i <= k. - Reinhard Zumkeller, Aug 30 2001
a(n) = a(n - a(n-1)) + 1, with a(1)=1. - Ian M. Levitt (ilevitt(AT)duke.poly.edu), Aug 18 2002
a(n) = round(sqrt(2n)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Nov 01 2002
T(n,k) = A003602(A118413(n,k)); = T(n,k) = A001511(A118416(n,k)). - Reinhard Zumkeller, Apr 27 2006
G.f.: (x/(1-x))*Product_{k>0} (1-x^(2*k))/(1-x^(2*k-1)). - Vladeta Jovovic, Oct 06 2003
Equals A127899 * A004736. - Gary W. Adamson, Feb 09 2007
Sum_{i=1..n} Sum_{j=i..n+i-1} T(j,i) = A000578(n); Sum_{i=1..n} T(n,i) = A000290(n). - Reinhard Zumkeller, Jun 24 2007
a(n) + n = A014132(n). - Vincenzo Librandi, Jul 08 2010
a(n) = ceiling(-1/2 + sqrt(2n)). - Branko Curgus, May 12 2009
a(A169581(n)) = A038567(n). - Reinhard Zumkeller, Dec 02 2009
a(n) = round(sqrt(2*n)) = round(sqrt(2*n-1)); there exist a and b greater than zero such that 2*n = 2+(a+b)^2 -(a+3*b) and a(n)=(a+b-1). - Fabio Civolani (civox(AT)tiscali.it), Feb 23 2010
A005318(n+1) = 2*A005318(n) - A205744(n), A205744(n) = A005318(A083920(n)), A083920(n) = n - a(n). - N. J. A. Sloane, Feb 11 2012
Expansion of psi(x) * x / (1 - x) in powers of x where psi() is a Ramanujan theta function. - Michael Somos, Mar 19 2014
G.f.: (x/(1-x)) * Product_{n>=1} (1 + x^n) * (1 - x^(2*n)). - Paul D. Hanna, Feb 27 2016
a(n) = 1 + Sum_{i=1..n/2} ceiling(floor(2(n-1)/(i^2+i))/(2n)). - José de Jesús Camacho Medina, Jan 07 2017
a(n) = floor((sqrt(8*n-7)+1)/2). - Néstor Jofré, Apr 24 2017
a(n) = floor((A000196(8*n)+1)/2). - Pontus von Brömssen, Dec 10 2018
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/4 (A003881). - Amiram Eldar, Oct 01 2022
G.f. as array: (x^2*(1 - y)^2 + y^2 + x*y*(1 - 2*y))/((1 - x)^2*(1 - y)^2). - Stefano Spezia, Apr 22 2024
Showing 1-10 of 155 results. Next