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

A079825 Sum of numbers in n-th upward diagonal of triangle in A079826.

Original entry on oeis.org

1, 3, 6, 15, 26, 41, 62, 92, 129, 169, 224, 287, 366, 443, 548, 656, 793, 919, 1090, 1255, 1466, 1653, 1906, 2140, 2441, 2701, 3052, 3367, 3774, 4119, 4584, 4992, 5521, 5963, 6558, 7071, 7738, 8289, 9030, 9660, 10481, 11153, 12056, 12815, 13806, 14611, 15692, 16592
Offset: 1

Views

Author

Amarnath Murthy, Feb 11 2003

Keywords

Crossrefs

Programs

  • Magma
    m:=35; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1+2*x+2*x^2+7*x^3+6*x^4+2*x^5+6*x^6+x^7+x^8)/((x^2+1)^2*(1+x)^3*(x-1)^4))); // Bruno Berselli, Sep 05 2012
    
  • Magma
    [((2*n+1)*(7*n^2+7*n+12) -3*(-1)^n*n*(n-7) +6*(-1)^Binomial(n,2)*(2*n-3*(-1)^n+1))/96: n in [1..41]]; // G. C. Greubel, Dec 10 2023
    
  • Maple
    A079825 := proc(n)
            local a, k;
            a := 0 ;
            for k from 1 to (n+1)/2 do
                    a := a+A056011(n-k+1,k) ;
            end do:
            a ;
    end proc: # R. J. Mathar, Sep 05 2012
  • Mathematica
    LinearRecurrence[{1, 1, -1, 2, -2, -2, 2, -1, 1, 1, -1}, {1, 3, 6, 15, 26, 41, 62, 92, 129, 169, 224}, 35] (* Bruno Berselli, Sep 05 2012 *)
  • Maxima
    makelist(expand(((2*n+1)*(7*n^2+7*n+12)-3*n*(n-7)*(-1)^n+6*(2*n-3*(-1)^n+1)*%i^(n*(n-1)))/96), n, 1, 35); /* Bruno Berselli, Sep 05 2012 */
    
  • SageMath
    [((2*n+1)*(7*n^2+7*n+12)-3*(-1)^n*n*(n-7)+6*(-1)^binomial( n,2)*(2*n-3*(-1)^n+1))/96 for n in range(1,41)] # G. C. Greubel, Dec 10 2023

Formula

G.f.: x*( 1+2*x+2*x^2+7*x^3+6*x^4+2*x^5+6*x^6+x^7+x^8 ) / ( (1+x)^3*(1-x)^4*(1+x^2)^2 ). - R. J. Mathar, Sep 05 2012
a(n) = ( (2*n+1)*(7*n^2+7*n+12) -3*n*(n-7)*(-1)^n +6*(2*n-3*(-1)^n+1)*i^(n*(n-1)) )/96, where i=sqrt(-1). - Bruno Berselli, Sep 05 2012
E.g.f.: (1/48)*( (6+24*x+30*x^2+7*x^3)*cosh(x) + (6+42*x+33*x^2+7*x^3)* sinh(x) + 6*(x-1)*cos(x) - 6*(x-2)*sin(x) ). - G. C. Greubel, Dec 10 2023

A056011 Enumeration of natural numbers by the boustrophedonic diagonal method.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Aug 01 2000

Keywords

Comments

A triangle such that (1) every positive integer occurs exactly once; (2) row n consists of n consecutive numbers; (3) odd-numbered rows are increasing; and (4) even-numbered rows are decreasing.
Self-inverse permutation of the natural numbers.
Mirror image of triangle in A056023. - Philippe Deléham, Apr 04 2009
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. - Boris Putievskiy, Dec 24 2012
For generalizations see A218890, A213927. - Boris Putievskiy, Mar 10 2013

Examples

			The start of the sequence as a table:
   1,  3,  4, 10, 11, 21, ...
   2,  5,  9, 12, 20, 23, ...
   6,  8, 13, 19, 24, 34, ...
   7, 14, 18, 25, 33, 40, ...
  15, 17, 26, 32, 41, 51, ...
  ...
Enumeration by boustrophedonic ("ox-plowing") diagonal method. - _Boris Putievskiy_, Dec 24 2012
The start of the sequence as triangle array read by rows:
   1;
   3,  2;
   4,  5,  6;
  10,  9,  8,  7;
  11, 12, 13, 14, 15;
  ...
		

Crossrefs

Cf. A079826, A131179 (first column), A218890, A213927.

Programs

  • Haskell
    a056011 n = a056011_tabl !! (n-1)
    a056011_list = concat a056011_tabl
    a056011_tabl = ox False a000027_tabl where
      ox turn (xs:xss) = (if turn then reverse xs else xs) : ox (not turn) xss
    a056011_row n = a056011_tabl !! (n-1)
    -- Reinhard Zumkeller, Nov 08 2013
  • Maple
    A056011 := proc(n,k)
            if type(n,'even') then
                    A131179(n)-k+1 ;
            else
                    A131179(n)+k-1 ;
            end if;
    end proc: # R. J. Mathar, Sep 05 2012
  • Mathematica
    Flatten[If[EvenQ[Length[#]],Reverse[#],#]&/@Table[c=(n(n+1))/2;Range[ c-n+1,c],{n,20}]] (* Harvey P. Dale, Mar 25 2012 *)
    With[{nn=20},{#[[1]],Reverse[#[[2]]]}&/@Partition[ TakeList[ Range[ (nn(nn+1))/2],Range[nn]],2]//Flatten] (* Harvey P. Dale, Oct 05 2021 *)

Formula

a(n) = ((i+j-1)*(i+j-2)+((-1)^t+1)*i - ((-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

Extensions

New name from Peter Luschny, Apr 15 2023, based on Boris Putievskiy's comment
Showing 1-2 of 2 results.