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 11 results. Next

A271865 Recursive sequence based on the central polygonal numbers (A000124) and A004738.

Original entry on oeis.org

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

Views

Author

Max Barrentine, Apr 16 2016

Keywords

Comments

Conjectured to be a permutation of the natural numbers.
The central polygonal numbers can be constructed by starting with the natural numbers, setting A000124(0)=1 and obtaining A000124(n+1) by reversing the order of the next A000124(n) numbers after A000124(n). This procedure doesn't produce a permutation of the natural numbers for A000124 because the sequence is strictly increasing. The present sequence is constructed by the same procedure, except that a(n+1) is obtained by reversing the next a(A004738(n)) numbers.

Examples

			Start with the natural numbers:
1, 2, 3, 4, 5, 6, 7, 8, 9...
a(A004738(1))=1, so reverse the order of the next term, leaving the sequence unchanged:
   (1)
1, (2), 3, 4, 5, 6, 7, 8, 9...
a(A004738(2))=2, so reverse the order of the next 2 terms:
      (2)
1, 2, (4, 3), 5, 6, 7, 8, 9...
a(A004738(3))=1, so reverse the order of the next term, leaving the sequence unchanged:
         (1)
1, 2, 4, (3), 5, 6, 7, 8, 9...
a(A004738(4))=2, so reverse the order of the next 2 terms:
            (2)
1, 2, 4, 3, (6, 5), 7, 8, 9...
a(A004738(5))=4, so reverse the order of the next 4 terms:
               (4)
1, 2, 4, 3, 6, (9, 8, 7, 5)...
a(A004738(6))=2, so reverse the order of the next 2 terms:
                  (2)
1, 2, 4, 3, 6, 9, (7, 8), 5...
a(A004738(7))=1, so reverse the order of the next term, leaving the sequence unchanged:
                     (1)
1, 2, 4, 3, 6, 9, 7, (8), 5...
		

Crossrefs

A206492 Sums of rows of the sequence of triangles with nonnegative integers and row widths defined by A004738.

Original entry on oeis.org

0, 3, 3, 9, 21, 19, 11, 25, 45, 74, 66, 49, 26, 55, 90, 134, 190, 170, 138, 97, 50, 103, 162, 230, 310, 405, 365, 310, 243, 167, 85, 173, 267, 370, 485, 615, 763, 693, 605, 502, 387, 263, 133, 269, 411, 562, 725, 903, 1099, 1316, 1204, 1071, 920, 754, 576, 389
Offset: 1

Views

Author

Alex Ratushnyak, Jun 28 2012

Keywords

Comments

Row widths: A004738(n): 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 2, 1, 2, 3, 4, 5...
Pits: A051925(n+1): 0, 3, 11, 26, 50, 85, 133, 196, 276, 375, 495, 638...
Peak tops: A007290(n+3): 2, 8, 20, 40, 70, 112, 168, 240, 330, 440, 572...
Peak bases: A084990(n+1): 1, 6, 17, 36, 65, 106, 161, 232, 321, 430, 561...

Examples

			The sequence of triangles begins:
0
1 2
3
4 5
6 7 8
9 10
11
12 13
14 15 16
17 18 19 20
21 22 23
24 25
26
27 28
29 30 31
32 33 34 35
36 37 38 39 40
41 42 43 44
45 46 47
48 49
50
51 52
		

Crossrefs

Cf. A027480: sums of rows of a triangle with increasing row widths: 0; 1,2; 3,4,5; 6,7,8,9; ...

Programs

  • Python
    curSign=-1
    curLength=sum=0
    rowLength=topLength=1
    for n in range(1232):
        sum += n
        curLength += 1
        if curLength==rowLength:
            print(sum, end=',')
            curLength = sum = 0
            if rowLength==1 or rowLength==topLength:
                curSign = -curSign
            topLength += (rowLength==1)
            rowLength += curSign

A082742 Indices of occurrences of 2 in A004738.

Original entry on oeis.org

2, 4, 6, 8, 12, 14, 20, 22, 30, 32, 42, 44, 56, 58, 72, 74, 90, 92, 110, 112, 132, 134, 156, 158, 182, 184, 210, 212, 240, 242, 272, 274, 306, 308, 342, 344, 380, 382, 420, 422, 462, 464, 506, 508, 552, 554, 600, 602, 650, 652, 702, 704, 756, 758, 812, 814, 870, 872, 930, 932, 992, 994, 1056, 1058, 1122, 1124, 1190, 1192, 1260, 1262, 1332, 1334, 1406, 1408, 1482, 1484, 1560, 1562
Offset: 1

Views

Author

Amarnath Murthy, Apr 15 2003

Keywords

Comments

Indices of occurrences of 1 in A004738 are given by A002061, b(n) = n^2 - n + 1 (the central polygonal numbers). All entries are even.

Crossrefs

Cf. A004738.

Programs

  • Maple
    A004738 := proc(n)
        local f ;
        f := floor(sqrt(n)+1/2) ;
        f+1-abs(n-1-f^2) ;
    end proc:
    for n from 1 to 1600 do
        if A004738(n) = 2 then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Feb 03 2013
  • Mathematica
    LinearRecurrence[{1,2,-2,-1,1},{2,4,6,8,12},80] (* Harvey P. Dale, Jun 16 2017 *)
  • PARI
    a(n)=(n^2+2*n+8+if(n%2,2*n-5))/4 \\ Charles R Greathouse IV, Feb 03 2013

Formula

G.f.: 2*x*(1+x-x^2-x^3+x^4)/((1+x)^2*(1-x)^3). - Charles R Greathouse IV, Feb 03 2013
a(n) = 2*A134519(n). - R. J. Mathar, Feb 03 2013

Extensions

More terms from R. J. Mathar, Feb 03 2013

A213040 Partial sums of A004738, leftmost column of the sequence of triangles defined in A206492.

Original entry on oeis.org

1, 3, 4, 6, 9, 11, 12, 14, 17, 21, 24, 26, 27, 29, 32, 36, 41, 45, 48, 50, 51, 53, 56, 60, 65, 71, 76, 80, 83, 85, 86, 88, 91, 95, 100, 106, 113, 119, 124, 128, 131, 133, 134, 136, 139, 143, 148, 154, 161, 169, 176, 182, 187, 191, 194, 196, 197, 199, 202
Offset: 0

Views

Author

Alex Ratushnyak, Jun 28 2012

Keywords

Crossrefs

Formula

a(n) = Sum_{k=0..n} A004738(k).
For n>0, a(n) = a(n-1) + A004738(n).

A004737 Concatenation of sequences (1,2,...,n-1,n,n-1,...,1) for n >= 1.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 4, 3, 2, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 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, 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
Offset: 1

Views

Author

R. Muller

Keywords

Comments

The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446. - Jeremy Gardiner, Mar 16 2003
The ordinal transform of a sequence b_0, b_1, b_2, ... is the sequence a_0, a_1, a_2, ... where a_n is the number of times b_n has occurred in {b_0 ... b_n}.
From Artur Jasinski, Mar 07 2010: (Start)
This sequence is the even subset of A003983 for odd p=2,4,6,8,....
For the odd subset of A003983 see A004739. (End)
From Gary W. Adamson, Mar 30 2010: (Start)
Given the triangle rows: (1; 1,2,1; 1,2,3,2,1; ...) as polcoeff with offset 0:
q = (1 + 2x + x^2), r = (1 + 2x + 3x^2 + 2x^3 +x^4), etc.; then
(1 + 2x + 3x^2 + ...) = q(x) * q(x^2) * q(x^4) * q(x^8) * ...
..................... = r(x) * r(x^3) * r(x^9) * r(x^27) * ...
..................... = s(x) * s(x^4) * s(x^16)* s(x^64) * ...
... (End)
From L. Edson Jeffery, Jan 13 2012: (Start)
Let U_1(t)=1, U_2(t)=2*t, and U_r(t)=2*t*U_(r-1)(t)-U(r-2)(t), r>2, be Chebyshev polynomials of the second kind. For q>1 an integer, let N=2*q and x_k=cos((2*k-1)*Pi/N), and define the ordered column vectors V_k=[U_k(x_1), U_k(x_2), ..., U_k(x_q)]^T, k=1,...,q, where A^T denotes the transpose of matrix A. Let E_N=[V_1, V_2, ..., V_q] be the q X q matrix formed from the ordered components of the V_k. E_N contains the joint spectra of the Danzer basis (see [Jeffery]) associated with N. Let M_N=(1/q)*[E_N]^T*E_N. For the trivial case q=1, let M_2=[1]. CONJECTURE: E_N and M_N are always integral and symmetric, with M_N having diagonal entries {1,2,...} beginning at entries 1,j (j odd) in the first row and i,1 (i odd) in the first column and with zeros elsewhere. If N is allowed to increase without bound, and assuming the conjecture is true, then triangle A004737 emerges in its entirety from the successive antidiagonals containing those entries [M_N]_(i,j) such that i+j=2*v, for each v in {1,2,...,floor((q+1)/2)}. For example, for N=18 and q=9 (omitting the zeros for clarity),
M_18=[
(1 1 1 1 1);
( 2 2 2 2 );
(1 3 3 3 3);
( 2 4 4 4 );
(1 3 5 5 5);
( 2 4 6 6 );
(1 3 5 7 7);
( 2 4 6 8 );
(1 3 5 7 9)],
from which the first five rows of the sequence can be read off in succession. (End)
T(n,k) = min(n,k). The order of the list T(n,k) is by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1). - Boris Putievskiy, Jan 13 2013
Expanded form of T(2,k) k=0,1,...,2m for ascending m-nomial triangles. - Bob Selcoe, Feb 07 2014
Terms in the first nine rows of the triangle can be duplicated by performing (111...)^2 with <= nine ones. By way of example, (11111)^2 = 123454321. - Gary W. Adamson, Mar 27 2015

Examples

			From _Boris Putievskiy_, Jan 13 2013: (Start)
The start of the sequence as a table:
  1 1 1 1 1 1 ...
  1 2 2 2 2 2 ...
  1 2 3 3 3 3 ...
  1 2 3 4 4 4 ...
  1 2 3 4 5 5 ...
  1 2 3 4 5 6 ...
  ...
The start of the sequence as an irregular triangle array read by rows:
  1;
  1,2,1;
  1,2,3,2,1;
  1,2,3,4,3,2,1;
  1,2,3,4,5,4,3,2,1;
  1,2,3,4,5,6,5,4,3,2,1;
  ...
Row number k contains 2*k-1 numbers: 1,2,...,k-1,k,k-1,...,1. (End)
The sequence of fractions A196199/A004737 = 0/1, -1/1, 0/2, 1/1, -2/1, -1/2, 0/3, 1/2, 2/1, -3/1, -2/2, -1/3, 0/4, 1/3, 2/2, 3/1, -4/4. -3/2, ... contains every rational number (infinitely often) [Laczkovich]. - _N. J. A. Sloane_, Oct 09 2013
		

References

  • Miklós Laczkovich, Conjecture and Proof, TypoTex, Budapest, 1998. See Chapter 10.
  • F. Smarandache, "Numerical Sequences", University of Craiova, 1975.

Crossrefs

Cf. A242357, A000290 (row sums).

Programs

  • Haskell
    import Data.List (inits)
    a004737 n = a004737_list !! (n-1)
    a004737_list = concatMap f $ tail $ inits [1..]
       where f xs = xs ++ tail (reverse xs)
    -- Reinhard Zumkeller, May 11 2014, Mar 26 2011
    
  • Mathematica
    Table[Min[n - #^2, (# + 1)^2 - n + 1] &@ Floor[Sqrt[n - 1]], {n, 105}] (* or *)
    Table[Floor@ # - Abs[n - Floor[#]^2 - Floor@ # - 1] + 1 &@ Sqrt[n - 1], {n, 105}] (* Michael De Vlieger, Oct 21 2016 *)
    Table[Join[Range[n],Range[n-1,1,-1]],{n,20}]//Flatten (* Harvey P. Dale, Dec 27 2019 *)
  • PARI
    a(n) = n--;my(m=sqrtint(n));m+1-abs(n-m^2-m) \\ David A. Corneth, Oct 18 2016

Formula

a(A002061(n)) = n; a(A000290(n)) = a(A002522(n)) = 1. - Reinhard Zumkeller, Mar 10 2006
a(n) = if n<3 then 1 else (if a(n-1)=1 then 1 + 0^(a(n-2)-1) else a(n-1) - 0^X + (a(n-1)-a(n-2))*(1 - 0^X)), where X = A003059(n-1)-a(n-1). - Reinhard Zumkeller, Mar 10 2006
Let b(n) = floor(sqrt(n-1)). Then a(n) = min(n - b(n)^2, (b(n)+1)^2 - n + 1). - Franklin T. Adams-Watters, Jun 09 2006
Ordinal transform of A004741. - Franklin T. Adams-Watters, Aug 28 2006
If the sequence is read as a triangular array, beginning [1]; [1,2,1]; [1,2,3,2,1]; ..., then the o.g.f. is (1+qx)/((1-x)(1-qx)(1-q^2x)) = 1 + x(1 + 2q + q^2) + x^2(1 + 2q + 3q^2 + 2q^3 +q^4) + .... The row polynomials for this triangle are (1 + q + ... + q^n)^2 =[n,2]A008967).%20-%20_Peter%20Bala">q + q[n-1,2]_q, where [n,2]_q are Gaussian polynomials (see A008967). - _Peter Bala, Sep 23 2007
a(n) = floor(sqrt(n-1)) - |n - floor(sqrt(n-1))^2 - floor(sqrt(n-1)) - 1| + 1. - Boris Putievskiy, Jan 13 2013
Read as a triangular array, then T(n,k) = n - |n-k-1|; T(n,0) = 1; T(n,n-1) = n. - Juan Pablo Herrera P., Oct 17 2016

Extensions

More terms from Patrick De Geest, Jun 15 1998

A053615 Pyramidal sequence: distance to nearest product of two consecutive integers (promic or heteromecic numbers).

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Mar 20 2000

Keywords

Comments

a(A002378(n)) = 0; a(n^2) = n.
Table A049581 T(n,k) = |n-k| read by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1). - Boris Putievskiy, Jan 29 2013

Examples

			a(10) = |10 - 3*4| = 2.
From _Boris Putievskiy_, Jan 29 2013: (Start)
The start of the sequence as table:
  0, 1, 2, 3, 4, 5, 6, 7, ...
  1, 0, 1, 2, 3, 4, 5, 6, ...
  2, 1, 0, 1, 2, 3, 4, 5, ...
  3, 2, 1, 0, 1, 2, 3, 4, ...
  4, 3, 2, 1, 0, 1, 2, 3, ...
  5, 4, 3, 2, 1, 0, 1, 2, ...
  6, 5, 4, 3, 2, 1, 0, 1, ...
  ...
The start of the sequence as triangle array read by rows:
  0;
  1, 0, 1;
  2, 1, 0, 1, 2;
  3, 2, 1, 0, 1, 2, 3;
  4, 3, 2, 1, 0, 1, 2, 3, 4;
  5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5;
  6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6;
  7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7;
  ...
Row number r contains 2*r-1 numbers: r-1, r-2, ..., 0, 1, 2, ..., r-1. (End)
		

Crossrefs

Programs

  • Maple
    A053615 := proc(n)
        A004738(n+1)-1 ; # reuses code of A004738
    end proc:
    seq(A053615(n),n=0..30) ; # R. J. Mathar, Feb 14 2019
  • Mathematica
    a[0] = 0; a[n_] := Floor[Sqrt[n]] - a[n - Floor[Sqrt[n]]]; Table[a[n], {n, 0, 103}] (* Jean-François Alcover, Dec 16 2011, after Benoit Cloitre *)
    Join[{0},Module[{nn=150,ptci},ptci=Times@@@Partition[Range[nn/2+1],2,1];Table[Abs[n-Nearest[ptci,n]],{n,nn}][[All,1]]]] (* Harvey P. Dale, Aug 29 2020 *)
  • PARI
    a(n)=sqrtint(n)-a(n-sqrtint(n))
    
  • PARI
    apply( {A053615(n)=(t=sqrt(n)\/1)-abs(t^2-n)}, [0..99]) \\ M. F. Hasler, Feb 01 2025
    
  • Python
    A053615 = lambda n: (t := round(n**.5)) - abs(t**2 - n) # M. F. Hasler, Feb 01 2025
    
  • Python
    from math import isqrt
    def A053615(n): return abs((t:=isqrt(n))*(t+1)-n) # Chai Wah Wu, Mar 01 2025

Formula

a(n) = A004738(n+1) - 1.
Let u(1)=1, u(n) = n - u(n-sqrtint(n)) (cf. A037458); then a(0)=0 and for n > 0 a(n) = 2*u(n) - n. - Benoit Cloitre, Dec 22 2002
a(0)=0 then a(n) = floor(sqrt(n)) - a(n - floor(sqrt(n))). - Benoit Cloitre, May 03 2004
a(n) = |A196199(n)|. a(n) = |n - t^2 - t|, where t = floor(sqrt(n)). - Boris Putievskiy, Jan 29 2013 [corrected by Ridouane Oudra, May 11 2019]
a(n) = A000194(n) - A053188(n) = t - |t^2 - n|, where t = floor(sqrt(n)+1/2). - Ridouane Oudra, May 11 2019

A004739 Concatenation of sequences (1,2,2,...,n-1,n-1,n,n,n-1,n-1,...,2,2,1) for n >= 1.

Original entry on oeis.org

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

Views

Author

R. Muller

Keywords

Comments

From Artur Jasinski, Mar 07 2010: (Start)
Zeta(2, k/p) + Zeta(2, (p-k)/p) = (Pi/sin((Pi*a(n))/p))*2, where p=2,3,4, k=1..p-1.
This sequence is the odd subset of A003983 for odd p=3,5,7,9,....
For the even subset of A003983 see A004737. (End)
Table T(n,k) n, k > 0, T(n,k) = n-k+1, if n >= k, T(n,k) = k-n, if n < k. Table read by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1). General case A209301. Let m be a natural number. The first column of the table T(n,1) is the sequence of the natural numbers A000027. In all columns with number k (k > 1) the segment with the length of (k-1): {m+k-2, m+k-3, ..., m} shifts the sequence A000027. For m=1 the result is A004739, for m=2 the result is A004738, for m=3 the result is A209301. - Boris Putievskiy, Jan 24 2013

Examples

			From _Boris Putievskiy_, Jan 24 2013: (Start)
The start of the sequence as table:
  1, 1, 2, 3, 4, 5, 6, ...
  2, 1, 1, 2, 3, 4, 5, ...
  3, 2, 1, 1, 2, 3, 4, ...
  4, 3, 2, 1, 1, 2, 3, ...
  5, 4, 3, 2, 1, 1, 2, ...
  6, 5, 4, 3, 2, 1, 1, ...
  7, 6, 5, 4, 3, 2, 1, ...
  ...
The start of the sequence as triangle array read by rows:
  1;
  1, 1, 2;
  2, 1, 1, 2, 3;
  3, 2, 1, 1, 2, 3, 4;
  4, 3, 2, 1, 1, 2, 3, 4, 5;
  5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6;
  6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7;
  ...
Row number r contains 2*r - 1 numbers: r-1, r-2, ..., 1, 1, 2, ..., r. (End)
		

Crossrefs

Programs

  • Haskell
    a004739 n = a004739_list !! (n-1)
    a004739_list = concat $ map (\n -> [1..n] ++ [n,n-1..1]) [1..]
    -- Reinhard Zumkeller, Mar 26 2011
  • Mathematica
    aa = {}; Do[Do[AppendTo[aa, (p/Pi) ArcSin[Sqrt[1/((1/Pi^2) (Zeta[2, k/p] + Zeta[2, (p - k)/p]))]]], {k, 1, p - 1}], {p, 3, 50, 2}]; Round[N[aa, 50]] (* Artur Jasinski, Mar 07 2010 *)

Formula

From Boris Putievskiy, Jan 24 2013: (Start)
For the general case,
a(n) = m*v + (2*v-1)*(t*t-n) + t, where t = floor(sqrt(n) - 1/2) + 1 and v = floor((n-1)/t) - t + 1.
For m=1,
a(n) = v + (2*v-1)*(t*t-n) + t, where t = floor(sqrt(n) - 1/2) + 1 and v = floor((n-1)/t) - t + 1. (End)

Extensions

More terms from Patrick De Geest, Jun 15 1998

A082693 Pyramidal sequence built with powers of 2.

Original entry on oeis.org

1, 2, 1, 2, 4, 2, 1, 2, 4, 8, 4, 2, 1, 2, 4, 8, 16, 8, 4, 2, 1, 2, 4, 8, 16, 32, 16, 8, 4, 2, 1, 2, 4, 8, 16, 32, 64, 32, 16, 8, 4, 2, 1, 2, 4, 8, 16, 32, 64, 128, 64, 32, 16, 8, 4, 2, 1, 2, 4, 8, 16, 32, 64, 128, 256, 128, 64, 32, 16, 8, 4, 2, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 256, 128
Offset: 1

Views

Author

Benoit Cloitre, Apr 12 2003

Keywords

Examples

			Triangle begins:
                                 1
                               2 1 2
                             4 2 1 2 4
                           8 4 2 1 2 4 8
                        16 8 4 2 1 2 4 8 16
                     32 16 8 4 2 1 2 4 8 16 32
                  64 32 16 8 4 2 1 2 4 8 16 32 64
              128 64 32 16 8 4 2 1 2 4 8 16 32 64 128
          256 128 64 32 16 8 4 2 1 2 4 8 16 32 64 128 256
      512 256 128 64 32 16 8 4 2 1 2 4 8 16 32 64 128 256 512
1024 512 256 128 64 32 16 8 4 2 1 2 4 8 16 32 64 128 256 512 1024
... - _Philippe Deléham_, Mar 20 2013
		

Crossrefs

Cf. A004738, A082693 (partial sums), A036563 (row sums).

Programs

  • Mathematica
    pow2Pyram[row_] := Module[{st = 2^Range[0, row]}, Join[st, Reverse[Most[Rest[st]]]]]; Flatten[Array[pow2Pyram, 10]] (* Harvey P. Dale, May 09 2012 *)
    Flatten[Table[Table[2^Abs[col], {col, -row, row}], {row, 0, 7}]] (* Alonso del Arte, Apr 15 2017 *)
  • PARI
    for(i=0,9,forstep(j=i,0,-1,print1(1<Charles R Greathouse IV, Mar 20 2013

A209301 Table T(n,k) n, k > 0, T(n,k)=n-k+1, if n>=k, T(n,k)=k-n+2, if n < k. Table read by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1).

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Jan 18 2013

Keywords

Comments

In general, let m be natural number. The first column of the table T(n,1) is the sequence of the natural numbers A000027. In all columns with number k (k > 1) the segment with the length of (k-1): {m+k-2, m+k-3, ..., m} shifts the sequence A000027. For m=1 the result is A004739, for m=2 the result is A004738. This sequence is result for m=3.

Examples

			The start of the sequence as table for the general case:
  1,   m, m+1, m+2, m+3, m+4, m+5, ...
  2,   1,   m, m+1, m+2, m+3, m+4, ...
  3,   2,   1,   m, m+1, m+2, m+3, ...
  4,   3,   2,   1,   m, m+1, m+2, ...
  5,   4,   3,   2,   1,   m, m+1, ...
  6,   5,   4,   3,   2,   1,   m, ...
  7,   6,   5,   4,   3,   2,   1, ...
  ...
The start of the sequence as triangle array read by rows for the general case:
  1;
  m,1,2;
  m+1,m,1,2,3;
  m+2,m+1,m,1,2,3,4;
  m+3,m+2,m+1,m,1,2,3,4,5;
  m+4, m+3,m+2,m+1,m,1,2,3,4,5,6;
  m+5, m+4, m+3,m+2,m+1,m,1,2,3,4,5,6,7;
  ...
Row number r contains 2*r -1 numbers: m+r-2, m+r-1,...m,1,2,...r.
The start of the sequence as triangle array read by rows for m=3:
  1;
  3,1,2;
  4,3,1,2,3;
  5,4,3,1,2,3,4;
  6,5,4,3,1,2,3,4,5;
  7,6,5,4,3,1,2,3,4,5,6;
  8,7,6,5,4,3,1,2,3,4,5,6,7;
  ...
		

Crossrefs

Programs

  • Python
    t=int((math.sqrt(n))-0.5)+1
    v=int((n-1)/t)-t+1
    result=k*v+(2*v-1)*(t**2-n)+t

Formula

For the general case
a(n) = m*v+(2*v-1)*(t*t-n)+t,
where
t = floor(sqrt(n)-1/2)+1,
v = floor((n-1)/t)-t+1.
For m=3
a(n) = 3*v+(2*v-1)*(t*t-n)+t,
where
t = floor(sqrt(n)-1/2)+1,
v = floor((n-1)/t)-t+1.

A119557 a(1)=0,a(2)=0,a(3)=1 then a(n)=abs(a(n-1)-a(n-2))-a(n-3).

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, May 30 2006

Keywords

Comments

See A104156 for an order 2 example.
b(n) = a(2n)-floor(sqrt(n))+1 is an infinite binary word consisting of a sequence of block (0,1) and single 0's where 0's occur when n is of form k^2-1, k>=2 i.e. b(n) begins for n>=1 : (0,1),0,(0,1),(0,1),0,(0,1),(0,1),(0,1),0,(0,1),... and single 0's occur at n=3,8,15,...

References

  • B. Cloitre, On strange predictible recursions, preprint 2006

Crossrefs

Cf. A104156.

Programs

  • PARI
    an=vector(10000); an[1]=0; an[2]=0; an[3]=1; a(n)=if(n<0, 0, an[n]);
    for(n=4, 10000, an[n]=abs(a(n-1)-a(n-2))-a(n-3))
    an

Formula

abs(a(2n-1)) = A004738(n)-1 where sign(a(2*n-1)) alternates between 2 consecutive zeros.
Showing 1-10 of 11 results. Next