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

A054556 a(n) = 4*n^2 - 9*n + 6.

Original entry on oeis.org

1, 4, 15, 34, 61, 96, 139, 190, 249, 316, 391, 474, 565, 664, 771, 886, 1009, 1140, 1279, 1426, 1581, 1744, 1915, 2094, 2281, 2476, 2679, 2890, 3109, 3336, 3571, 3814, 4065, 4324, 4591, 4866, 5149, 5440, 5739, 6046, 6361, 6684, 7015, 7354, 7701, 8056, 8419, 8790
Offset: 1

Views

Author

Keywords

Comments

Move in 1-4 direction in a spiral organized like A068225 etc.
Equals binomial transform of [1, 3, 8, 0, 0, 0, ...]. - Gary W. Adamson, Apr 30 2008
Ulam's spiral (N spoke). - Robert G. Wilson v, Oct 31 2011
Also, numbers of the form m*(4*m+1)+1 for nonpositive m. - Bruno Berselli, Jan 06 2016

Crossrefs

Cf. A266883: m*(4*m+1)+1 for m = 0,-1,1,-2,2,-3,3,...
Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
Sequences on the four diagonals of the square spiral: Starting at 0: A002939 = 2*A000384, A016742 = 4*A000290, A002943 = 2*A014105, A033996 = 8*A000217; starting at 1: A054554, A053755, A054569, A016754.
Sequences obtained by reading alternate terms on the X and Y axes and the two main diagonals of the square spiral: Starting at 0: A035608, A156859, A002378 = 2*A000217, A137932 = 4*A002620; starting at 1: A317186, A267682, A002061, A080335.

Programs

Formula

a(n)^2 = Sum_{i = 0..2*(4*n-5)} (4*n^2-13*n+9+i)^2*(-1)^i = ((n-1)*(4*n-5)+1)^2. - Bruno Berselli, Apr 29 2010
From Harvey P. Dale, Aug 21 2011: (Start)
a(0)=1, a(1)=4, a(2)=15; for n > 2, a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f.: -x*(6*x^2+x+1)/(x-1)^3. (End)
From Franck Maminirina Ramaharo, Mar 09 2018: (Start)
a(n) = binomial(2*n - 2, 2) + 2*(n - 1)^2 + 1.
a(n) = A000384(n-1) + A058331(n-1).
a(n) = A130883(n-1) + A001105(n-1). (End)
E.g.f.: exp(x)*(6 - 5*x + 4*x^2) - 6. - Stefano Spezia, Apr 24 2024

Extensions

Edited by Frank Ellermann, Feb 24 2002
Incorrect formula deleted by N. J. A. Sloane, Aug 02 2009

A048268 Smallest palindrome greater than n in bases n and n+1.

Original entry on oeis.org

6643, 10, 46, 67, 92, 121, 154, 191, 232, 277, 326, 379, 436, 497, 562, 631, 704, 781, 862, 947, 1036, 1129, 1226, 1327, 1432, 1541, 1654, 1771, 1892, 2017, 2146, 2279, 2416, 2557, 2702, 2851, 3004, 3161, 3322, 3487, 3656, 3829, 4006, 4187, 4372, 4561
Offset: 2

Views

Author

Ulrich Schimke (ulrschimke(AT)aol.com)

Keywords

Comments

From A.H.M. Smeets, Jun 19 2019: (Start)
In the following, dig(expr) stands for the digit that represents the value of expression expr, and . stands for concatenation.
As for the naming of this sequence, the trivial 1 digit palindromes 0..dig(n-1) are excluded.
If a number m is palindromic in bases n and n+1, then m has an odd number of digits when represented in base n.
All three digit numbers in base n, that are palindromic in bases n and n+1 are given by:
101_3 22_4 for n = 3,
232_n 1.dig(n).1_(n+1)
343_n 2.dig(n-1).2_(n+1)
up to and including
dig(n-2).dig(n-1).dig(n-2)n dig(n-3).4.dig(n-3)(n+1) for n > 3, and
dig(n-1).0.dig(n-1)n dig(n-3).5.dig(n-3)(n+1) for n > 4.
Let d_L(n) be the number of integers with L digits in base n (L being odd), being palindromic in bases n and n+1, then:
d_1(n) = n for n >= 2 (see above),
d_3(n) = n-2 for n >= 5 (see above),
d_5(n) = n-1 for n >= 7 and n == 1 (mod 3),
d_5(n) = n-4 for n >= 7 and n in {0, 2} (mod 3), and
it seems that d_7(n) is of order O(n^2*log(n)) for n large enough. (End)

Examples

			a(14) = 2*14^2 + 3*14 + 2 = 436, which is 232_14 and 1e1_15.
		

Crossrefs

Programs

  • Mathematica
    Do[ k = n + 2; While[ RealDigits[ k, n + 1 ][ [ 1 ] ] != Reverse[ RealDigits[ k, n + 1 ][ [ 1 ] ] ] || RealDigits[ k, n ][ [ 1 ] ] != Reverse[ RealDigits[ k, n ][ [ 1 ] ] ], k++ ]; Print[ k ], {n, 2, 75} ]
    palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; f[n_] := Block[{k = n + 2}, While[ !palQ[k, n] || !palQ[k, n + 1], k++ ]; k]; Table[ f[n], {n, 2, 48}] (* Robert G. Wilson v, Sep 29 2004 *)
  • PARI
    isok(j, n) = my(da=digits(j,n), db=digits(j,n+1)); (Vecrev(da)==da) && (Vecrev(db)==db);
    a(n) = {my(j = n); while(! isok(j, n), j++); j;} \\ Michel Marcus, Nov 16 2017
    
  • PARI
    Vec(x^2*(6643 - 19919*x + 19945*x^2 - 6684*x^3 + 19*x^4) / (1 - x)^3 + O(x^50)) \\ Colin Barker, Jun 30 2019

Formula

a(n) = 2n^2 + 3n + 2 for n >= 4 (which is 232_n and 1n1_(n+1)).
a(n) = A130883(n+1) for n > 3. - Robert G. Wilson v, Oct 08 2014
From Colin Barker, Jun 30 2019: (Start)
G.f.: x^2*(6643 - 19919*x + 19945*x^2 - 6684*x^3 + 19*x^4) / (1 - x)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n>6.
(End)

Extensions

More terms from Robert G. Wilson v, Aug 14 2000

A007607 Skip 1, take 2, skip 3, etc.

Original entry on oeis.org

2, 3, 7, 8, 9, 10, 16, 17, 18, 19, 20, 21, 29, 30, 31, 32, 33, 34, 35, 36, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130
Offset: 1

Views

Author

Keywords

Comments

Numbers k with the property that the smallest Dyck path of the symmetric representation of sigma(k) has a central peak. (Cf. A237593.) - Omar E. Pol, Aug 28 2018
Union of A317303 and A014105. - Omar E. Pol, Aug 29 2018

Examples

			From _Omar E. Pol_, Aug 29 2018: (Start)
Written as an irregular triangle in which the row lengths are the nonzero even numbers the sequence begins:
    2,   3;
    7,   8,   9,  10;
   16,  17,  18,  19,  20,  21;
   29,  30,  31,  32,  33,  34,  35,  36;
   46,  47,  48,  49,  50,  51,  52,  53,  54,  55;
   67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78;
   92,  93,  94,  95,  96,  97,  98,  99, 100, 101, 102, 103, 104, 105;
  121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136;
...
Row sums give the nonzero terms of A317297.
Column 1 gives A130883, n >= 1.
Right border gives A014105, n >= 1.
(End)
		

References

  • R. Honsberger, Mathematical Gems III, M.A.A., 1985, p. 177.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Complement of A007606.
Similar to A360418.

Programs

  • Haskell
    a007607 n = a007607_list !! (n-1)
    a007607_list = skipTake 1 [1..] where
       skipTake k xs = take (k + 1) (drop k xs)
                       ++ skipTake (k + 2) (drop (2*k + 1) xs)
    -- Reinhard Zumkeller, Feb 12 2011
    
  • Haskell
    a007607_list' = f $ tail $ scanl (+) 0 [1..] where
       f (t:t':t'':ts) = [t+1..t'] ++ f (t'':ts)
    -- Reinhard Zumkeller, Feb 12 2011
  • Mathematica
    Flatten[ Table[i, {j, 2, 16, 2}, {i, j(j - 1)/2 + 1, j(j + 1)/2}]] (* Robert G. Wilson v, Mar 11 2004 *)
    With[{t=20},Flatten[Take[TakeList[Range[(t(t+1))/2],Range[t]],{2,-1,2}]]] (* Harvey P. Dale, Sep 26 2021 *)
  • PARI
    for(m=0,10,for(n=2*m^2+3*m+2,2*m^2+5*m+3,print1(n", "))) \\ Charles R Greathouse IV, Feb 12 2011
    

Formula

G.f.: 1/(1-x) * (1/(1-x) + x*Sum_{k>=1} (2k+1)*x^(k*(k+1))). - Ralf Stephan, Mar 03 2004
a(A000290(n)) = A001105(n). - Reinhard Zumkeller, Feb 12 2011
A057211(a(n)) = 0. - Reinhard Zumkeller, Dec 30 2011
a(n) = floor(sqrt(n) + 1/2)^2 + n = A053187(n) + n. - Ridouane Oudra, May 04 2019

A128918 a(n) = n*(n+1)/2 if n is odd, otherwise (n-1)*n/2 + 1.

Original entry on oeis.org

1, 1, 2, 6, 7, 15, 16, 28, 29, 45, 46, 66, 67, 91, 92, 120, 121, 153, 154, 190, 191, 231, 232, 276, 277, 325, 326, 378, 379, 435, 436, 496, 497, 561, 562, 630, 631, 703, 704, 780, 781, 861, 862, 946, 947, 1035, 1036, 1128, 1129, 1225, 1226, 1326, 1327, 1431, 1432, 1540
Offset: 0

Views

Author

N. J. A. Sloane, Sep 26 2007

Keywords

Crossrefs

Programs

  • Haskell
    a128918 n = (n + m - 1) * n' + m * n - m + 1  where (n', m) = divMod n 2
    -- Reinhard Zumkeller, Oct 12 2013
    
  • Maple
    A128918:=n->`if`((n mod 2) = 1, n*(n+1)/2, (n-1)*n/2+1): seq(A128918(n), n=0..100); # Wesley Ivan Hurt, Feb 03 2017
  • Mathematica
    Table[If[OddQ[n],(n(n+1))/2,(n(n-1))/2+1],{n,0,60}] (* or *)
    LinearRecurrence[{1,2,-2,-1,1},{1,1,2,6,7},60] (* Harvey P. Dale, Mar 31 2012 *)
    CoefficientList[ Series[(-4x^3 + x^2 -1)/((x -1)^3 (x + 1)^2), {x, 0, 55}], x] (* Robert G. Wilson v, Jan 20 2018 *)
  • PARI
    a(n)=if(n%2,n*(n+1),(n-1)*n+2)/2 \\ Charles R Greathouse IV, Oct 16 2015
    
  • PARI
    Vec((1 - x^2 + 4*x^3) / ((1 - x)^3*(1 + x)^2) + O(x^40)) \\ Colin Barker, Jan 20 2018
    
  • Python
    def A128918(n): return n*(n-1)//2 + 1 + (n-1)*(n%2) # Chai Wah Wu, May 24 2022

Formula

a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5), with a(0)=1, a(1)=1, a(2)=2, a(3)=6, a(4)=7. - Harvey P. Dale, Mar 31 2012
a(n) = (1/2)*(-1)^n*(n+(-1)^n*((n-2)*n+2)-2). - Harvey P. Dale, Mar 31 2012
a(2*n) = A130883(n); a(2*n+1) = A000384(n+1). - Reinhard Zumkeller, Oct 12 2013
G.f.: (1 - x^2 + 4*x^3) / ((1 - x)^3*(1 + x)^2). - Colin Barker, Jan 20 2018

A140064 a(n) = (9*n^2 - 5*n + 2)/2.

Original entry on oeis.org

1, 3, 14, 34, 63, 101, 148, 204, 269, 343, 426, 518, 619, 729, 848, 976, 1113, 1259, 1414, 1578, 1751, 1933, 2124, 2324, 2533, 2751, 2978, 3214, 3459, 3713, 3976, 4248, 4529, 4819, 5118, 5426, 5743, 6069, 6404, 6748, 7101, 7463, 7834, 8214, 8603, 9001, 9408, 9824, 10249, 10683, 11126, 11578, 12039, 12509, 12988, 13476, 13973
Offset: 0

Views

Author

Gary W. Adamson, May 03 2008

Keywords

Comments

Originally this entry was defined by a(n) = (9*n^2 - 23*n + 16)/2 and had offset 1. The current, simpler definition seems preferable, since it matches the following two geometrical applications. This change will also require several changes to the rest of the entry. - N. J. A. Sloane, Jun 26 2025
The letter Wu, ᗐ, is like a V but with three arms instead of two. Wu is included in the Unified Canadian Aboriginal Syllabics section of Unicode. The Unicode symbol for Wu is 0x2a5b. Wu is also called a "Boolean OR with middle stem", and is also the alchemical symbol Dissolve-2.
The long-legged Wu is a pencil of three semi-infinite lines originating from a point (the "tip"). The angles between the three lines are arbitrary.
Theorem 1 (Edward Xiong, Jonathan Pei, and David Cutler, Jun 24 2025): a(n) is the maximum number of regions in the plane that can be formed from n copies of a long-legged Wu.
Theorem 2: a(n) is also the maximum number of regions in the plane that can be formed from n copies of a long-legged letter A.
For proofs of Theorems 1 and 2 see "The Pancake, Hatpin, and Wu Planar Graphs".
For analogous sequences for long-legged letters V and Z see A130883 and A117625.

Crossrefs

A row of the array in A386478.

Programs

  • Magma
    [ n eq 1 select 1 else Self(n-1)+9*n-16: n in [1..50] ];
    
  • Maple
    seq((16-23*n+9*n^2)*1/2,n=1..40); # Emeric Deutsch, May 07 2008
  • Mathematica
    Table[(9n^2-23n+16)/2,{n,40}] (* or *) LinearRecurrence[{3,-3,1},{1,3,14},40] (* Harvey P. Dale, Oct 01 2011 *)
  • PARI
    x='x+O('x^50); Vec(x*(1+8*x^2)/(1-x)^3) \\ G. C. Greubel, Feb 18 2017

Formula

Binomial transform of [1, 2, 9, 0, 0, 0, ...].
a(n) = A000217(n) + 8*A000217(n-2). - R. J. Mathar, May 06 2008
O.g.f.: x*(1+8*x^2)/(1-x)^3. - R. J. Mathar, May 06 2008
a(n) = A064226(n-2), n>1. - R. J. Mathar, Jul 31 2008
a(n) = a(n-1) + 9*n - 16, a(1)=1. - Vincenzo Librandi, Nov 24 2010
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3); a(1)=1, a(2)=3, a(3)=14. - Harvey P. Dale, Oct 01 2011
E.g.f.: exp(x)*(16 - 14*x + 9*x^2)/2. - Stefano Spezia, Dec 25 2022

Extensions

More terms from R. J. Mathar and Emeric Deutsch, May 06 2008
Edited by N. J. A. Sloane, Jun 21 2025 and Jun 26 2025

A211377 T(n,k) = ((k + n)^2 - 4*k + 3 + (-1)^k - (k + n - 2)*(-1)^(k + n))/2; n, k > 0, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 07 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Enumeration table T(n,k). The order of the list:
T(1,1)=1;
T(1,3), T(1,2), T(2,1), T(2,2), T(3,1);
...
T(1,n), T(1,n-1), T(2,n-2), T(2,n-1), T(3,n-2), T(3,n-3)...T(n,1);
...
Descent by snake along two adjacent antidiagonal - step to the west, step to the southwest, step to the east, step to the southwest and so on. The length of each step is 1.
Table contains:
row 1 is alternation of elements A130883 and A033816,
row 2 accommodates elements A100037 in odd places;
column 1 is alternation of elements A000384 and A091823,
column 2 is alternation of elements A071355 and A014106,
column 3 accommodates elements A130861 in even places;
main diagonal accommodates elements A188135 in odd places,
diagonal 1, located above the main diagonal, is alternation of elements A033567 and A033566,
diagonal 2, located above the main diagonal, is alternation of elements A139271 and A033585.

Examples

			The start of the sequence as a table:
   1,  3,  2,   8,   7,  17,  16,  30,  29,  47,  46, ...
   4,  5,  9,  10,  18,  19,  31,  32,  48,  49,  69, ...
   6, 12, 11,  21,  20,  34,  33,  51,  50,  72,  71, ...
  13, 14, 22,  23,  35,  36,  52,  53,  73,  74,  98, ...
  15, 25, 24,  38,  37,  55,  54,  76,  75, 101, 100, ...
  26, 27, 39,  40,  56,  57,  77,  78, 102, 103, 131, ...
  28, 42, 41,  59,  58,  80,  79, 105, 104, 134, 133, ...
  43, 44, 60,  61,  81,  82, 106, 107, 135, 136, 168, ...
  45, 63, 62,  84,  83, 109, 108, 138, 137, 171, 170, ...
  64, 65, 85,  86, 110, 111, 139, 140, 172, 173, 209, ...
  66, 88, 87, 113, 112, 142, 141, 175, 174, 212, 211, ...
  ...
The start of the sequence as triangle array read by rows:
   1;
   3,  4;
   2,  5,  6;
   8,  9, 12, 13;
   7, 10, 11, 14, 15;
  17, 18, 21, 22, 25, 26;
  16, 19, 20, 23, 24, 27, 28;
  30, 31, 34, 35, 38, 39, 42, 43;
  29, 32, 33, 36, 37, 40, 41, 44, 45;
  47, 48, 51, 52, 55, 56, 59, 60, 63, 64;
  46, 49, 50, 53, 54, 57, 58, 61, 62, 65, 66;
  ...
The start of the sequence as an array read by rows, the length of row r is 4*r-3.
First 2*r-2 numbers are from row number 2*r-2 of the triangular array above.
Last  2*r-1 numbers are from row number 2*r-1 of the triangular array above.
   1;
   3,  4,  2,  5,  6;
   8,  9, 12, 13,  7, 10, 11, 14, 15;
  17, 18, 21, 22, 25, 26, 16, 19, 20, 23, 24, 27, 28;
  30, 31, 34, 35, 38, 39, 42, 43, 29, 32, 33, 36, 37, 40, 41, 44, 45;
  47, 48, 51, 52, 55, 56, 59, 60, 63, 64, 46, 49, 50, 53, 54, 57, 58, 61, 62, 65, 66;
  ...
Row number r contains permutation 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-5*r+5, 2*r*r-5*r+6,...2*r*r-r-4, 2*r*r-r-1, 2*r*r-r.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := ((k+n)^2 - 4k + 3 + (-1)^k - (k+n-2)(-1)^(k+n))/2;
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Nov 29 2018 *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result=((t+2)**2-4*j+3+(-1)**j-t*(-1)**(t+2))/2

Formula

As a table:
T(n,k) = ((k + n)^2 - 4*k + 3 + (-1)^k - (k + n - 2)*(-1)^(k + n))/2.
As a linear sequence:
a(n) = ((t + 2)^2 - 4*j + 3 + (-1)^j - t*(-1)^t)/2, where j = (t*t + 3*t + 4)/2 - n and t = int((sqrt(8*n - 7) - 1)/ 2).

A386478 Array read by upward antidiagonals: T(k,n) = 1 (k = 0, n >= 0), T(k,n) = k^2*n^2/2 - (3*k-4)*n/2 + 1 (k >= 1, n >= 0).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 4, 1, 1, 3, 7, 7, 1, 1, 5, 14, 16, 11, 1, 1, 8, 25, 34, 29, 16, 1, 1, 12, 40, 61, 63, 46, 22, 1, 1, 17, 59, 97, 113, 101, 67, 29, 1, 1, 23, 82, 142, 179, 181, 148, 92, 37, 1, 1, 30, 109, 196, 261, 286, 265, 204, 121, 46, 1, 1, 38, 140, 259, 359, 416, 418, 365, 269, 154, 56, 1, 1, 47, 175, 331, 473, 571, 607, 575, 481, 343, 191, 67, 1
Offset: 0

Views

Author

N. J. A. Sloane, Jul 24 2025

Keywords

Comments

A k-chain is a planar graph consisting of a continuous path made up of k straight segments. T(k,n) is the maximum number of regions the plane can be divided into by drawing n k-chains.
The array is almost symmetric: the difference between T(k,n) and T(n,k) is 2*|k-n| (which is exactly the difference between the numbers of infinite regions). All the rows and columns satisfy the recurrence u(n) = 3*u(n-1) - 3*u(n-2) + u(n-3).

Examples

			Array begins (the rows are T(0,n>=0),, T(1,n>=0), T(2,n>=0), ...):
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 2, 4, 7, 11, 16, 22, 29, 37, ...
  1, 2, 7, 16, 29, 46, 67, 92, 121, ...
  1, 3, 14, 34, 63, 101, 148, 204, 269, ...
  1, 5, 25, 61, 113, 181, 265, 365, 481, ...
  1, 8, 40, 97, 179, 286, 418, 575, 757, ...
  1, 12, 59, 142, 261, 416, 607, 834, 1097, ...
  1, 17, 82, 196, 359, 571, 832, 1142, 1501, ...
  1, 23, 109, 259, 473, 751, 1093, 1499, 1969, ...
  ...
The first few antidiagonals are:
  1,
  1, 1,
  1, 2, 1,
  1, 2, 4, 1,
  1, 3, 7, 7, 1,
  1, 5, 14, 16, 11, 1,
  1, 8, 25, 34, 29, 16, 1,
  1, 12, 40, 61, 63, 46, 22, 1,
  ...
		

References

  • David O. H. Cutler and N. J. A. Sloane, paper in preparation, August 1 2025.

Crossrefs

The first few rows are A000124, A130883, A140064, A080856, A383465.
The n=1 and 2 columns are A152948 and A386479.

Programs

  • Mathematica
    A386478[k_, n_] := If[k == 0, 1, ((k*n - 3)*k + 4)*n/2 + 1];
    Table[A386478[k - n, n], {k, 0, 12}, {n, 0, k}] (* Paolo Xausa, Jul 26 2025 *)

Extensions

Row 0 added by N. J. A. Sloane, Jul 26 2025

A270109 a(n) = n^3 + (n+1)*(n+2).

Original entry on oeis.org

2, 7, 20, 47, 94, 167, 272, 415, 602, 839, 1132, 1487, 1910, 2407, 2984, 3647, 4402, 5255, 6212, 7279, 8462, 9767, 11200, 12767, 14474, 16327, 18332, 20495, 22822, 25319, 27992, 30847, 33890, 37127, 40564, 44207, 48062, 52135, 56432, 60959, 65722, 70727, 75980, 81487, 87254
Offset: 0

Views

Author

Bruno Berselli, Mar 11 2016, at the suggestion of Giuseppe Amoruso in BASE Cinque forum

Keywords

Comments

For n>1, many consecutive terms of the sequence are generated by floor(sqrt(n^2 + 2)^3) + n^2 + 2.
It appears that this is a subsequence of A000037 (the nonsquares).
The primes in the sequence belong to A045326.
Inverse binomial transform is 2, 5, 8, 6, 0, 0, 0, ... (0 continued).

Crossrefs

Subsequence of A001651, A047212.
Cf. A027444: numbers of the form n^3+n*(n+1); A085490: numbers of the form n^3+(n-1)*n.
Cf. A008865: numbers of the form n+(n+1)*(n+2); A130883: numbers of the form n^2+(n+1)*(n+2).

Programs

  • Magma
    [n^3+(n+1)*(n+2): n in [0..50]];
  • Mathematica
    Table[n^3 + (n + 1) (n + 2), {n, 0, 50}]
  • Maxima
    makelist(n^3+(n+1)*(n+2), n, 0, 50);
    
  • PARI
    vector(50, n, n--; n^3+(n+1)*(n+2))
    
  • Sage
    [n^3+(n+1)*(n+2) for n in (0..50)]
    

Formula

O.g.f.: (2 - x + 4*x^2 + x^3)/(1 - x)^4.
E.g.f.: (2 + x)*(1 + x)^2*exp(x).
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4), n>3.
a(n+h) - a(n) + a(n-h) = n^3 + n^2 + (6*h^2+3)*n + (2*h^2+2) for any h. This identity becomes a(n) = n^3 + n^2 + 3*n + 2 if h=0.
a(h*a(n) + n) = (h*a(n))^3 + (3*n+1)*(h*a(n))^2 + (3*n^2+2*n+3)*(h*a(n)) + a(n) for any h, therefore a(h*a(n) + n) is always a multiple of a(n).
a(n) + a(-n) = 2*A059100(n) = A255843(n).
a(n) - a(-n) = 4*A229183(n).

A317303 Numbers k such that both Dyck paths of the symmetric representation of sigma(k) have a central peak.

Original entry on oeis.org

2, 7, 8, 9, 16, 17, 18, 19, 20, 29, 30, 31, 32, 33, 34, 35, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 154, 155, 156, 157, 158, 159, 160
Offset: 1

Views

Author

Omar E. Pol, Aug 27 2018

Keywords

Comments

Also triangle read by rows which gives the odd-indexed rows of triangle A014132.
There are no triangular number (A000217) in this sequence.
For more information about the symmetric representation of sigma see A237593 and its related sequences.
Equivalently, numbers k with the property that both Dyck paths of the symmetric representation of sigma(k) have an odd number of peaks. - Omar E. Pol, Sep 13 2018

Examples

			Written as an irregular triangle in which the row lengths are the odd numbers, the sequence begins:
    2;
    7,   8,   9;
   16,  17,  18,  19,  20;
   29,  30,  31,  32,  33,  34,  35;
   46,  47,  48,  49,  50,  51,  52,  53,  54;
   67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77;
   92,  93,  94,  95,  96,  97,  98,  99, 100, 101, 102, 103, 104;
  121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135;
...
Illustration of initial terms:
-----------------------------------------------------------
   k   sigma(k)   Diagram of the symmetry of sigma
-----------------------------------------------------------
                    _         _ _ _             _ _ _ _ _
                  _| |       | | | |           | | | | | |
   2      3      |_ _|       | | | |           | | | | | |
                             | | | |           | | | | | |
                            _|_| | |           | | | | | |
                          _|  _ _|_|           | | | | | |
                  _ _ _ _|  _| |               | | | | | |
   7      8      |_ _ _ _| |_ _|               | | | | | |
   8     15      |_ _ _ _ _|              _ _ _| | | | | |
   9     13      |_ _ _ _ _|             |  _ _ _|_| | | |
                                        _| |    _ _ _|_| |
                                      _|  _|   |  _ _ _ _|
                                  _ _|  _|  _ _| |
                                 |  _ _|  _|    _|
                                 | |     |     |
                  _ _ _ _ _ _ _ _| |  _ _|  _ _|
  16     31      |_ _ _ _ _ _ _ _ _| |  _ _|
  17     18      |_ _ _ _ _ _ _ _ _| | |
  18     39      |_ _ _ _ _ _ _ _ _ _| |
  19     20      |_ _ _ _ _ _ _ _ _ _| |
  20     42      |_ _ _ _ _ _ _ _ _ _ _|
.
For the first nine terms of the sequence we can see in the above diagram that both Dyck path (the smallest and the largest) of the symmetric representation of sigma(k) have a central peak.
Compare with A317304.
		

Crossrefs

Column 1 gives A130883, n >= 1.
Column 2 gives A033816, n >= 1.
Row sums give the odd-indexed terms of A006002.
Right border gives the positive terms of A014107, also the odd-indexed terms of A000096.
The union of A000217, A317304 and this sequence gives A001477.
Some other sequences related to the central peak or the central valley of the symmetric representation of sigma are A000217, A000384, A007606, A007607, A014105, A014132, A162917, A161983, A317304. See also A317306.

A114113 a(n) = sum{k=1 to n} (A114112(k)). (For n>=2, a(n) = sum{k=1 to n} (A014681(k)) =sum{k=1 to n} (A103889(k)).).

Original entry on oeis.org

1, 3, 7, 10, 16, 21, 29, 36, 46, 55, 67, 78, 92, 105, 121, 136, 154, 171, 191, 210, 232, 253, 277, 300, 326, 351, 379, 406, 436, 465, 497, 528, 562, 595, 631, 666, 704, 741, 781, 820, 862, 903, 947, 990, 1036, 1081, 1129, 1176, 1226, 1275, 1327, 1378, 1432
Offset: 1

Views

Author

Leroy Quet, Nov 13 2005

Keywords

Comments

a(n) is not divisible by (A114112(n+1)).
Sequence is A130883 union A014105 - {0,2}. - Anthony Hernandez, Sep 08 2016

Crossrefs

Programs

  • Magma
    I:=[1,3,7,10,16]; [n le 5 select I[n] else 2*Self(n-1)-2*Self(n-3)+Self(n-4): n in [1..60]]; // Vincenzo Librandi, Mar 13 2018
    
  • Mathematica
    Join[{1}, LinearRecurrence[{2, 0, -2, 1}, {3, 7, 10, 16}, 52]] (* Jean-François Alcover, Sep 22 2017 *)
    CoefficientList[Series[(1 + x + x^2 -2 x^3 + x^4)/((1 + x) (1 - x)^3), {x, 0, 60}], x] (* Vincenzo Librandi, Mar 13 2018 *)
  • Python
    def A114113(n): return 1 if n == 1 else (m:=n//2)*(n+1) + (n+1-m)*(n-2*m) # Chai Wah Wu, May 24 2022

Formula

a(1)=1. a(2n) = n*(2n+1). a(2n+1) = 2n^2 +3n +2.
From R. J. Mathar, Nov 04 2008: (Start)
a(n) = A026035(n+1) - A026035(n), n>1.
G.f.: x(1+x+x^2-2x^3+x^4)/((1+x)(1-x)^3).
a(n) = 2*a(n-1)-2*a(n-3)+a(n-4), n>5. (End)
This is (essentially) 1 + A084265, - N. J. A. Sloane, Mar 12 2018

Extensions

More terms from R. J. Mathar, Aug 31 2007
Showing 1-10 of 35 results. Next