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.

Previous Showing 21-28 of 28 results.

A159915 a(n) = floor((n+1)/4)*floor(n/2).

Original entry on oeis.org

0, 0, 0, 1, 2, 2, 3, 6, 8, 8, 10, 15, 18, 18, 21, 28, 32, 32, 36, 45, 50, 50, 55, 66, 72, 72, 78, 91, 98, 98, 105, 120, 128, 128, 136, 153, 162, 162, 171, 190, 200, 200, 210, 231, 242, 242, 253, 276, 288, 288, 300, 325, 338, 338, 351, 378, 392, 392, 406, 435, 450, 450
Offset: 0

Views

Author

M. F. Hasler, May 01 2009, May 03 2009

Keywords

Comments

Half the number of (n-2)-element subsets of {1,...,n} with odd sum of the elements.
This is half the antepenultimate column of A159916, cf. formula.
The number of subsets of {1,...,n} with n-2 elements, adding up to an odd integer, is always even (cf. examples), so we divide it by 2.
We prefer to include a(0)=a(1)=a(2)=0, even if it might seem more natural to start only at n=2 or n=3.
From the rational g.f. it can be seen that the sequence is a linear recurrence with constant coefficients (3,-5,7,-7,5,-3,1) of order 7.
A quasipolynomial of order 4 and degree 2. - Charles R Greathouse IV, Sep 18 2024

Examples

			a(0)=a(1)=0 since there are no subsets with -2 or -1 elements.
a(2)=0 since the sum of the elements of a 0-element subset is zero.
a(3)=1 since for n=3 we have two singleton subsets of {1,2,3}, {1} and {3}, with odd sum of elements.
a(4)=2 since for n=4 we have four 2-element subsets of {1,2,3,4} with odd sum: {1,2}, {2,3}, {1,4}, {3,4}.
		

Crossrefs

Programs

  • Magma
    A159915:= func< n | Floor((n+1)/4)*Floor(n/2) >;
    [A159915(n): n in [0..70]]; // G. C. Greubel, Sep 18 2024
    
  • Mathematica
    Table[Floor[(n+1)/4]*Floor[n/2], {n,0,70}] (* G. C. Greubel, Sep 18 2024 *)
  • PARI
    A159915(n)= polcoeff( (1-x+x^2)/((1-x)^3*(1+x^2)^2) + O(x^(n-2)), n-3);
    a(n,t=[0,0,0,1,2,2,3],c=[1,-3,5,-7,7,-5,3]~)=while(n-->5,t=concat(vecextract(t,"^1"),t*c));t[n+2] /* Note: a(n+1,[0,0,0,0,1,2,2]) gives the same result as a(n) */
    
  • PARI
    A159915(n)=(n+1)\4*(n\2) \\ M. F. Hasler, May 03 2009
    
  • SageMath
    def A159915(n): return ((n+1)//4)*(n//2)
    [A159915(n) for n in range(71)] # G. C. Greubel, Sep 18 2024

Formula

G.f.: x^3*(1 - x + x^2)/(1 - 3*x + 5*x^2 - 7*x^3 + 7*x^4 - 5*x^5 + 3*x^6 - x^7) = x^3*(1-x+x^2)/((1-x)^3*(1+x^2)^2).
a(n) = 3*a(n-1) - 5*a(n-2) + 7*a(n-3) - 7*a(n-4) + 5*a(n-5) - 3*a(n-6) + a(n-7) for n > 7.
For n > 2, a(n) = A159916(n*(n-1)/2 + n - 2)/2 = T(n,n-2)/2 as defined there.
From M. F. Hasler, May 03 2009: (Start)
a(n) = floor((n+1)/4)*floor(n/2).
a(2n+1) = A093005(n).
a(2n) = A093353(n-1) = floor(n/2)*n. (End)
a(n) ~ n^2/8. - Charles R Greathouse IV, Sep 18 2024

A182455 a(0)=1, a(n) = (a(n-1) mod (n+2))*(n+2).

Original entry on oeis.org

1, 3, 12, 10, 24, 21, 40, 36, 60, 55, 84, 78, 112, 105, 144, 136, 180, 171, 220, 210, 264, 253, 312, 300, 364, 351, 420, 406, 480, 465, 544, 528, 612, 595, 684, 666, 760, 741, 840, 820, 924, 903, 1012, 990, 1104, 1081, 1200, 1176, 1300, 1275, 1404
Offset: 0

Views

Author

Alex Ratushnyak, Apr 30 2012

Keywords

Examples

			a(5) = (a(4) mod 7)*7 = (24 mod 7)*7 = 3*7 = 21.
		

Crossrefs

Cf. A093005 (a(n)=(a(n-1) mod (n+1))*(n+1)).

Programs

  • Haskell
    a182455 n = a182455_list !! n
    a182455_list = 1 : zipWith (*) (zipWith mod a182455_list [3..]) [3..]
    -- Reinhard Zumkeller, May 01 2012
  • Python
    a=1
    for n in range(1,55):
        print(a, end=', ')
        a = (a%(n+2)) * (n+2)
    

Formula

a(0)=1, a(n) = (a(n-1) mod (n+2))*(n+2).
For k>0, a(2*k)=(k+1)*(2*k+4), a(2*k+1)=(k+1)*(2*k+3).

A024930 a(n) = sum of remainders of n mod 1,3,5,...,2k-1, where k = [ (n+1)/2 ].

Original entry on oeis.org

0, 0, 0, 1, 2, 1, 3, 6, 6, 5, 9, 11, 16, 15, 13, 20, 27, 23, 31, 35, 34, 33, 43, 51, 57, 56, 56, 62, 75, 66, 80, 95, 96, 95, 99, 104, 121, 120, 122, 136, 155, 144, 164, 174, 163, 162, 184, 204, 220, 214, 218, 230, 255, 242, 252, 272, 277, 276, 304, 310, 339, 338, 328, 359, 372, 357
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Formula

a(n) = A093005(n) - A078471(n). - Robert Israel, May 13 2019

A113171 Short legs 'A' of exactly 7 primitive Pythagorean triangles.

Original entry on oeis.org

660, 1092, 1140, 1155, 1260, 1320, 1365, 1380, 1428, 1540, 1560, 1740, 1785, 1820, 1860, 1980, 1995, 2184, 2220, 2340, 2380, 2415, 2436, 2460, 2508, 2580, 2604, 2660, 2805, 2820, 2856, 2860, 2940, 3003, 3036, 3060, 3108, 3120, 3135, 3180, 3192, 3220, 3300
Offset: 1

Views

Author

Keywords

Examples

			Examples of triples: 660.779.1021, 660.989.1189, 660.2989.3061, 660.4331.4381, 660.12091.12109, 660.27221.27229, 660.108899.108901
1092.1325.1717, 1092.1595.1933, 1092.6035.6133, 1092.8245.8317, 1092.33115.33133, 1092.74525.74533, 1092.298115.298117
		

Crossrefs

Cf. A056866 Orders of non-solvable groups. A093006 Referring to the triangle in A093005, sequence contains the least term with maximal number of divisors. A138605 Short legs of more than 3 primitive Pythagorean triangles. A033993 Numbers that are divisible by exactly four different primes.

Programs

  • Mathematica
    PythagoreanAs[a_]:=(q={};k=0;Do[y=(a^2+b^2)^0.5;c=IntegerPart[y];If[c==y,p=0;If[GCD[a,b,c]==1,AppendTo[q,a.b.c];k++ ]],{b,a+1,a^2}];PrependTo[q,k];q);lst={};Do[If[PythagoreanAs[n][[1]]==7,Print[n];AppendTo[lst,n]],{n,6*10^2,2*10^3}];lst

Formula

a^2+b^2=c^2

Extensions

More terms from Ray Chandler, Jan 22 2020

A199855 Inverse permutation to A210521.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 04 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(2,1), T(2,2), T(1,2), T(1,3), T(3,1),
...
T(2,n-1), T(4,n-3), T(6,n-5), ..., T(n,1),
T(2,n), T(4,n-2), T(6,n-4), ..., T(n,2),
T(1,n), T(3,n-2), T(5,n-4), ..., T(n-1,2),
T(1,n+1), T(3,n-1), T(5,n-3), ..., T(n+1,1),
...
The order of the list elements of adjacent antidiagonals. Let m be a positive integer.
Movement by antidiagonal {T(1,2*m), T(2*m,1)} from T(2,2*m-1) to T(2*m,1) length of step is 2,
movement by antidiagonal {T(1,2*m+1), T(2*m+1,1)} from T(2,2*m) to T(2*m,2) length of step is 2,
movement by antidiagonal {T(1,2*m), T(2*m,1)} from T(1,2*m) to T(2*m-1,2) length of step is 2,
movement by antidiagonal {T(1,2*m+1), T(2*m+1,1)} from T(1,2*m+1) to T(2*m+1,1) length of step is 2.
Table contains:
row 1 is alternation of elements A001844 and A084849,
row 2 is alternation of elements A130883 and A058331,
row 3 is alternation of elements A051890 and A096376,
row 4 is alternation of elements A033816 and A005893,
row 6 is alternation of elements A100037 and A093328;
row 5 accommodates elements A097080 in odd places,
row 7 accommodates elements A137882 in odd places,
row 10 accommodates elements A100038 in odd places,
row 14 accommodates elements A100039 in odd places;
column 1 is A093005 and alternation of elements A000384 and A001105,
column 2 is alternation of elements A046092 and A014105,
column 3 is A105638 and alternation of elements A014106 and A056220,
column 4 is alternation of elements A142463 and A014107,
column 5 is alternation of elements A091823 and A054000,
column 6 is alternation of elements A090288 and |A168244|,
column 8 is alternation of elements A059993 and A033537;
column 7 accommodates elements A071355 in odd places,
column 9 accommodates elements |A147973| in even places,
column 10 accommodates elements A139570 in odd places,
column 13 accommodates elements A130861 in odd places.

Examples

			The start of the sequence as table:
   1,  4,  5,  11,  13,  22,  25,  37,  41,  56,  61, ...
   2,  3,  7,   9,  16,  19,  29,  33,  46,  51,  67, ...
   6, 12, 14,  23,  26,  38,  42,  57,  62,  80,  86, ...
   8, 10, 17,  20,  30,  34,  47,  52,  68,  74,  93, ...
  15, 24, 27,  39,  43,  58,  63,  81,  87, 108, 115, ...
  18, 21, 31,  35,  48,  53,  69,  75,  94, 101. 123, ...
  28, 40, 44,  59,  64,  82,  88, 109, 116, 140, 148, ...
  32, 36, 49,  54,  70,  76,  95, 102, 124, 132, 157, ...
  45, 60, 65,  83,  89, 110, 117, 141, 149, 176, 185, ...
  50, 55, 71,  77,  96, 103, 125, 133, 158, 167, 195, ...
  66, 84, 90, 111, 118, 142, 150, 177, 186, 216, 226, ...
  ...
The start of the sequence as triangle array read by rows:
   1;
   4,  2;
   5,  3,  6;
  11,  7, 12,  8;
  13,  9, 14, 10, 15;
  22, 16, 23, 17, 24, 18;
  25, 19, 26, 20, 27, 21, 28;
  37, 29, 38, 30, 39, 31, 40, 32;
  41, 33, 42, 34, 43, 35, 44, 36, 45;
  56, 46, 57, 47, 58, 48, 59, 49, 60, 50;
  61, 51, 62, 52, 63, 53, 64, 54, 65, 55, 66;
  ...
The start of the sequence as array read by rows, the length of row r is 4*r-3.
First 2*r-2 numbers are from the row number 2*r-2 of  triangle array, located above.
Last  2*r-1 numbers are from the row number 2*r-1 of  triangle array, located above.
   1;
   4, 2, 5, 3, 6;
  11, 7,12, 8,13, 9,14,10,15;
  22,16,23,17,24,18,25,19,26,20,27,21,28;
  37,29,38,30,39,31,40,32,41,33,42,34,43,35,44,36,45;
  56,46,57,47,58,48,59,49,60,50,61,51,62,52,63,53,64,54,65,55,66;
  ...
Row number r contains permutation numbers 4*r-3 from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-3*r+2,2*r*r-5*r+4, 2*r*r-3*r+3, 2*r*r-5*r+5, 2*r*r-3*r+4, 2*r*r-5*r+6, ..., 2*r*r-3*r+1, 2*r*r-r.
...
		

Crossrefs

Programs

  • 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=(2*j**2+(4*i-5)*j+2*i**2-3*i+2+(2+(-1)**j)*((1-(t+1)*(-1)**i)))/4

Formula

T(n,k) = (2*k^2+(4*n-5)*k+2*n^2-3*n+2+(2+(-1)^k)*((1-(k+n-1)*(-1)^i)))/4.
a(n) = (2*j^2+(4*i-5)*j+2*i^2-3*i+2+(2+(-1)^j)*((1-(t+1)*(-1)^i)))/4, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((sqrt(8*n-7) - 1)/2).

A329965 a(n) = ((1+n)*floor(1+n/2))*(n!/floor(1+n/2)!)^2.

Original entry on oeis.org

1, 2, 6, 72, 240, 7200, 25200, 1411200, 5080320, 457228800, 1676505600, 221298739200, 821966745600, 149597947699200, 560992303872000, 134638152929280000, 508633022177280000, 155641704786247680000, 591438478187741184000, 224746621711341649920000
Offset: 0

Views

Author

Peter Luschny, Dec 04 2019

Keywords

Crossrefs

Programs

  • Maple
    A329965 := n -> ((1+n)*floor(1+n/2))*(n!/floor(1+n/2)!)^2:
    seq(A329965(n), n=0..19);
  • Mathematica
    ser := Series[(1 - Sqrt[1 - 4 x^2] - 4 x^2 (1 - x - Sqrt[1 - 4 x^2]))/(2 x^2 (1 - 4 x^2)^(3/2)), {x, 0, 22}]; Table[n! Coefficient[ser, x, n], {n, 0, 20}]
    Table[(1+n)Floor[1+n/2](n!/Floor[1+n/2]!)^2,{n,0,30}] (* Harvey P. Dale, Oct 01 2023 *)
  • Python
    from fractions import Fraction
    def A329965():
        x, n = 1, Fraction(1)
        while True:
            yield int(x)
            m = n if n % 2 else 4/(n+2)
            n += 1
            x *= m * n
    a = A329965(); [next(a) for i in range(36)]

Formula

a(n) = n!*A212303(n+1).
a(n) = (n+1)!*A057977(n).
a(n) = A093005(n+1)*A262033(n)^2.
a(n) = A093005(n+1)*A329964(n).
a(2*n) = A052510(n) (n >= 0).
a(2*n+1) = A123072(n+1) (n >= 0).
a(n) = n! [x^n] (1 - sqrt(1 - 4*x^2) - 4*x^2*(1 - x - sqrt(1 - 4*x^2)))/(2*x^2*(1 - 4*x^2)^(3/2)).

A329970 a(n) = (-1)^(n + 1) * n * ceiling(n/2) + Sum_{k=1..n} (-1)^k * k^2 * floor(n/k).

Original entry on oeis.org

0, 0, -2, 3, 0, -3, -7, 16, 2, -15, -21, 31, 24, -15, -57, 34, 25, -17, -27, 77, 8, -99, -111, 155, 117, -36, -140, 40, 25, -80, -96, 259, 112, -157, -249, 202, 183, -156, -354, 224, 203, -40, -62, 342, -21, -524, -548, 562, 488, -34, -358, 194, 167, -262
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 26 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Table[(-1)^(n + 1) n Ceiling[n/2] + Sum[(-1)^k k^2 Floor[n/k], {k, 1, n}], {n, 1, 54}]
    nmax = 54; CoefficientList[Series[x (1 - x + 2 x^2)/((1 - x)^2 (1 + x)^3) + 1/(1 - x) Sum[(-1)^k k^2 x^k/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    Table[Sum[(-1)^(k + 1) Mod[n, k] k, {k, 1, n}], {n, 1, 54}]
  • PARI
    a(n) = (-1)^(n + 1)*n*ceil(n/2) + sum(k=1, n, (-1)^k * k^2 * (n\k)); \\ Michel Marcus, Sep 20 2021

Formula

G.f.: x * (1 - x + 2*x^2) / ((1 - x)^2 * (1 + x)^3) + (1/(1 - x)) * Sum_{k>=1} (-1)^k * k^2 * x^k / (1 - x^k).
a(n) = Sum_{k=1..n} (-1)^(k + 1) * (n mod k) * k.

A356288 Sum of numbers in n-th upward diagonal of triangle the sum of {1; 2,3; 4,5,6; 7,8,9,10; ...} and {1; 2,3; 3,4,5; 4,5,6,7; ...}.

Original entry on oeis.org

2, 4, 13, 20, 40, 55, 90, 116, 170, 210, 287, 344, 448, 525, 660, 760, 930, 1056, 1265, 1420, 1672, 1859, 2158, 2380, 2730, 2990, 3395, 3696, 4160, 4505, 5032, 5424, 6018, 6460, 7125, 7620, 8360, 8911, 9730, 10340, 11242, 11914, 12903, 13640, 14720, 15525, 16700
Offset: 1

Views

Author

Torlach Rush, Aug 02 2022

Keywords

Examples

			   2 = A079824(1) + A093005(1) =  1 + 1.
   4 = A079824(2) + A093005(2) =  2 + 2.
  13 = A079824(3) + A093005(3) =  7 + 6.
  20 = A079824(4) + A093005(4) = 12 + 8.
		

Crossrefs

Programs

  • Python
    def a(n): return (n * ((n + n % 2) // 2)) + (15 + 25*n + 15*(n**2) + 14*(n**3) - 3*(((-1)**n))*(5 + n*(3 + n))) // 96

Formula

a(n) = (n * ceiling(n/2)) + ((15 + 25*n + 15*n^2 + 14*n^3 - 3*(((-1)^n))*(5 + n*(3 + n))) / 96).
a(n) = A079824(n) + A093005(n).
G.f.: x*(2 + 2*x + 3*x^2 + x^3 - x^4)/((1 - x)^4*(1 + x)^3). - Stefano Spezia, Aug 19 2022
Previous Showing 21-28 of 28 results.