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 51-60 of 64 results. Next

A172176 Triangle T(n, k) = 1 + (n + k - n*k)*(2*n - k - n*(n-k)), read by rows.

Original entry on oeis.org

1, 2, 2, 1, 2, 1, -8, 0, 0, -8, -31, -4, 5, -4, -31, -74, -10, 22, 22, -10, -74, -143, -18, 57, 82, 57, -18, -143, -244, -28, 116, 188, 188, 116, -28, -244, -383, -40, 205, 352, 401, 352, 205, -40, -383, -566, -54, 330, 586, 714, 714, 586, 330, -54, -566
Offset: 0

Views

Author

Roger L. Bagula, Jan 28 2010

Keywords

Examples

			Triangle begins as:
     1;
     2,   2;
     1,   2,   1;
    -8,   0,   0,  -8;
   -31,  -4,   5,  -4,  -31;
   -74, -10,  22,  22,  -10,  -74;
  -143, -18,  57,  82,   57,  -18, -143;
  -244, -28, 116, 188,  188,  116,  -28, -244;
  -383, -40, 205, 352,  401,  352,  205,  -40, -383;
  -566, -54, 330, 586,  714,  714,  586,  330,  -54, -566;
  -799, -70, 497, 902, 1145, 1226, 1145,  902,  497,  -70, -799;
		

Crossrefs

Programs

  • Magma
    [1 + (n-(n-1)*k)*(n-(n-1)*(n-k)): k in [0..n], n in [0..12]]; // G. C. Greubel, Apr 26 2022
    
  • Maple
    A172176:= proc(n,m) 1+(n+m-n*m)*(2*n-m-n*(n-m)); end proc:
    seq(seq(A172176(n,m), m=0..n), n=0..12);
  • Mathematica
    T[n_, k_]= 1 + (n-(n-1)*k)*(n-(n-1)*(n-k));
    Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten
  • SageMath
    def A172176(n,k): return 1 + (n-(n-1)*k)*(n-(n-1)*(n-k))
    flatten([[A172176(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Apr 26 2022

Formula

T(n, k) = 1 + (n-(n-1)*k)*(n-(n-1)*(n-k)).
T(n, n-k) = T(n, k).
T(n, 0) = 1 - A027620(n-3).
T(n, 1) = -A028552(n-3).
T(n, 2) = A033445(n-2).
Sum_{k=0..n} T(n, k) = (n+1)*(n^4 - 9*n^3 + 15*n^2 - n + 6)/6.

A183570 a(n) = n + floor(sqrt(n + 1)).

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 109
Offset: 0

Views

Author

Clark Kimberling, Jan 05 2011

Keywords

Crossrefs

Cf. A028552 (complement, except for initial term).

Programs

Extensions

All terms corrected by R. J. Mathar, Jan 29 2011

A203553 Lodumo_2 of A118175, which is n 1's followed by n 0's.

Original entry on oeis.org

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

Views

Author

Philippe Deléham, Jan 02 2012

Keywords

Comments

Permutation of nonnegative numbers.
Lodumo_k of sequences is defined in A159970.
The sequence has a natural decomposition into irregular triangle (see example). The length of row n is A008619 (n). Row sums are the cubes (A000578) interspersed with A007531.

Examples

			Triangle begins :
1
0
3, 5
2, 4
7, 9, 11
6, 8, 10
13, 15, 17, 19
12, 14, 16, 18
21, 23, 25, 27, 29
20, 22, 24, 26, 28
31, 33, 35, 37, 39, 41
30, 32, 34, 36, 38, 40
43, 45, 47, 49, 51, 53, 55
42, 44, 46, 48, 50, 52, 54
57, 59, 61, 63, 65, 67, 69, 71
56, 58, 60, 62, 64, 66, 68, 70
73, 75, 77, 79, 81, 83, 85, 87, 89
72, 74, 76, 78, 80, 82, 84, 86, 88 ...
Row sums : 1 = 1^3 ; 0 = 1^3 - 1 ; 3 + 5 = 2^3 ; 2 + 4 = 2^3 - 2 = 6 ; 7 + 9 + 11 = 3^3 = 27 ; 6 + 8 + 10 = 3^3 - 3 = 24 ; 13 + 15 + 17 + 19 = 4^3 = 64 ; 12 + 14 + 16 + 18 = 4^4 - 4 = 60 ; ...
		

Crossrefs

Formula

a(n)= Lodumo_2(A118175(n)).

A203554 Lodumo_2 of A079813, which is n 0's followed by n 1's.

Original entry on oeis.org

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

Views

Author

Philippe Deléham, Jan 02 2012

Keywords

Comments

Permutation of nonnegative numbers.
Lodumo_k of sequences is defined in A159970.
The sequence has a natural decomposition into irregular triangle (see example). The length of row n is A008619(n). Rows sums are the cubes (A000578) interspersed with A007531. First column: A002378 interspersed with A002061.

Examples

			Triangle begins :
0
1
2, 4
3, 5
6, 8, 10
7, 9, 11
12, 14, 16, 18
13, 15, 17, 19
20, 22, 24, 26, 28
21, 23, 25, 27, 29
30, 32, 34, 36, 38, 40
31, 33, 35, 37, 39, 41
42, 44, 46, 48, 50, 52, 54
43, 45, 47, 49, 51, 53, 55
56, 58, 60, 62, 64, 66, 68, 70
57, 59, 61, 63, 65, 67, 69, 71
72, 74, 76, 78, 80, 82, 84, 86, 88
73, 75, 77, 79, 81, 83, 85, 87, 89...
Row sums : 0 = 1^3 -1 = 0 ; 1 = 1^3 = 1 ; 2 + 4 = 2^3 - 2 = 6 ; 3 + 5 = 2^3 = 8 ; 6 + 8 + 10 = 3^3 - 3 = 24 ; 7 + 9 + 11 = 3^3 = 27 ; 12 + 14 + 16 + 18 = 4^3 - 4 = 60 ; 13 + 15 + 17 + 19 = 4^3 = 64 ; 20 + 22 + 24 + 26 + 28 = 5^3 - 5 = 120 ; 21 + 23 + 25 + 27 + 29 = 5^3 = 125 ; etc...
		

Crossrefs

A214870 Natural numbers placed in table T(n,k) layer by layer. The order of placement: at the beginning filled odd places of layer clockwise, next - even places counterclockwise. T(n,k) read by antidiagonals.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 10, 9, 8, 13, 17, 16, 6, 14, 21, 26, 25, 11, 12, 22, 31, 37, 36, 18, 15, 20, 32, 43, 50, 49, 27, 24, 23, 30, 44, 57, 65, 64, 38, 35, 19, 33, 42, 58, 73, 82, 81, 51, 48, 28, 29, 45, 56, 74, 91, 101, 100, 66, 63, 39, 34, 41, 59, 72, 92, 111
Offset: 1

Views

Author

Boris Putievskiy, Mar 11 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.
Layer is pair of sides of square from T(1,n) to T(n,n) and from T(n,n) to T(n,1).
Enumeration table T(n,k) layer by layer. The order of the list:
T(1,1)=1;
T(1,2), T(2,1), T(2,2);
. . .
T(1,n), T(3,n), ... T(n,3), T(n,1); T(n,2), T(n,4), ... T(4,n), T(2,n);
. . .

Examples

			The start of the sequence as table:
   1   2   5  10  17  26 ...
   3   4   9  16  25  36 ...
   7   8   6  11  18  27 ...
  13  14  12  15  24  35 ...
  21  22  20  23  19  28 ...
  31  32  30  33  29  34 ...
  ...
The start of the sequence as triangle array read by rows:
   1;
   2,  3;
   5,  4,  7;
  10,  9,  8, 13;
  17, 16,  6, 14, 21;
  26, 25, 11, 12, 22, 31;
  ...
		

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
    if i > j:
       result=i*i-i+(j%2)*(2-(j+1)/2)+((j+1)%2)*(j/2+1)
    else:
       result=j*j-2*(i%2)*j + (i%2)*((i+1)/2+1) + ((i+1)%2)*(-i/2+1)

Formula

As table
T(n,k) = k*k-2*(n mod 2)*k+(n mod 2)*((n+1)/2+1)+((n+1) mod 2)*(-n/2+1), if n<=k;
T(n,k) = n*n-n+(k mod 2)*(2-(k+1)/2)+((k+1) mod 2)*(k/2+1), if n>k.
As linear sequence
a(n) = j*j-2*(i mod 2)*j+(i mod 2)*((i+1)/2+1)+((i+1) mod 2)*(-i/2+1), if i<=j;
a(n) = i*i-i+(j mod 2)*(2-(j+1)/2)+((j+1) mod 2)*(j/2+1), if i>j; where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).

A220588 a(n) = 2^n - n^2 - n.

Original entry on oeis.org

1, 0, -2, -4, -4, 2, 22, 72, 184, 422, 914, 1916, 3940, 8010, 16174, 32528, 65264, 130766, 261802, 523908, 1048156, 2096690, 4193798, 8388056, 16776616, 33553782, 67108162, 134216972, 268434644, 536870042, 1073740894, 2147482656, 4294966240, 8589933470, 17179867994
Offset: 0

Views

Author

Dario Piazzalunga, Dec 16 2012

Keywords

Examples

			a(3) = -4 because 2^3 - 3^2 - 3 = 8 - 9 - 3 = -4.
a(4) = -4 because 2^4 - 4^2 - 4 = 16 - 16 - 4 = -4.
a(5) = 2 because 2^5 - 5^2 - 5 = 32 - 25 - 5 = 2.
a(6) = 22 because 2^6 - 6^2 - 6 = 64 - 36 - 6 = 22.
		

Crossrefs

Programs

  • Mathematica
    Table[2^n - n^2 - n, {n, 0, 32}] (* Alonso del Arte, Dec 16 2012 *)
  • Maxima
    A220588(n):=2^n-n^2-n$ makelist(A220588(n),n,0,20); /* Martin Ettl, Dec 18 2012 */
    
  • PARI
    Vec((1 - 5*x + 7*x^2 - x^3) / ((1 - x)^3*(1 - 2*x)) + O(x^40)) \\ Colin Barker, Aug 16 2017

Formula

a(n) = 2*a(n - 1) + ((n - 3)^2 + 3(n - 3)) = 2*a(n - 1) + A028552(n - 3) for n > 4.
a(n) = (2*a(n-1) + 7*a(n-2))*2 = A015519/2 for n > 4.
From Colin Barker, Aug 16 2017: (Start)
G.f.: (1 - 5*x + 7*x^2 - x^3) / ((1 - x)^3*(1 - 2*x)).
a(n) = 5*a(n-1) - 9*a(n-2) + 7*a(n-3) - 2*a(n-4) for n>3.
(End)

Extensions

a(3) corrected by Charles A. Dagino, Aug 16 2017

A222963 a(n) = (p-3)*(p+3)/4 where p is the n-th prime.

Original entry on oeis.org

0, 4, 10, 28, 40, 70, 88, 130, 208, 238, 340, 418, 460, 550, 700, 868, 928, 1120, 1258, 1330, 1558, 1720, 1978, 2350, 2548, 2650, 2860, 2968, 3190, 4030, 4288, 4690, 4828, 5548, 5698, 6160, 6640, 6970, 7480, 8008, 8188
Offset: 2

Views

Author

Vincenzo Librandi, Apr 05 2013

Keywords

Comments

Old name was: Numbers n such that sqrt(4*n+9) is prime.

Crossrefs

Subsequence of A028552.

Programs

  • Magma
    [(p^2-9)/4: p in PrimesInInterval(3, 200)];
  • Mathematica
    Select[Range[0, 10000], PrimeQ[Sqrt[4 # + 9]]&]

Formula

4*a(n)+9 = A001248(n).
a(n) = A166011(n)/2. - Michel Marcus, Apr 22 2016

A222964 Numbers k such that 25*k+36 is a square.

Original entry on oeis.org

0, 13, 37, 76, 124, 189, 261, 352, 448, 565, 685, 828, 972, 1141, 1309, 1504, 1696, 1917, 2133, 2380, 2620, 2893, 3157, 3456, 3744, 4069, 4381, 4732, 5068, 5445, 5805, 6208, 6592, 7021, 7429, 7884, 8316, 8797, 9253, 9760, 10240, 10773, 11277, 11836, 12364, 12949, 13501, 14112, 14688
Offset: 1

Views

Author

Vincenzo Librandi, Apr 07 2013

Keywords

Comments

Also, numbers of the form 25m^2+12*m, where m = 0,-1,1,-2,2,-3,3,... - Bruno Berselli, Apr 07 2013

Crossrefs

Cf. numbers n such that k^2*n+(k+1)^2 is a square: A028552 (k=2), A218864 (k=3), A165717 (k=4).
Cf. numbers of the form k^2*m^2+floor(k^2/2)*m, where m=0,-1,1,-2,2,-3,3,...: A002378 (k=2), A185039 (k=3), A033996 (k=4), this sequence (k=5), A163758 (k=6).

Programs

  • Magma
    [n: n in [0..15000] | IsSquare(25*n+36)];
    
  • Magma
    I:=[0, 13, 37, 76, 124]; [n le 5 select I[n] else Self(n-1)+2*Self(n-2)-2*Self(n-3)-Self(n-4)+Self(n-5): n in [1..50]];
    
  • Magma
    [0] cat [25*m^2+12*m where m is n*t: t in [-1, 1], n in [1..20]]; // Bruno Berselli, Apr 07 2013
  • Mathematica
    Select[Range[0, 10000], IntegerQ[Sqrt[25 # + 36]]&] (* or *) CoefficientList[Series[x (13 + 24 x + 13 x^2)/((1+x)^2(1-x)^3), {x, 0, 40}], x]
    LinearRecurrence[{1,2,-2,-1,1},{0,13,37,76,124},50] (* Harvey P. Dale, Jan 23 2025 *)

Formula

G.f.: x^2*(13+24*x+13*x^2)/((1+x)^2*(1-x)^3).
a(n) = (50*n*(n-1)+(2*n-1)*(-1)^n+1)/8.
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5).
Sum_{n>=2} 1/a(n) = 25/144 - tan(Pi/50)*Pi/12. - Amiram Eldar, Feb 16 2023

A288994 a(n) = n*(n+3) when n is congruent to 0 or 3 (mod 4), and n*(n+3)/2 otherwise.

Original entry on oeis.org

0, 2, 5, 18, 28, 20, 27, 70, 88, 54, 65, 154, 180, 104, 119, 270, 304, 170, 189, 418, 460, 252, 275, 598, 648, 350, 377, 810, 868, 464, 495, 1054, 1120, 594, 629, 1330, 1404, 740, 779, 1638, 1720, 902, 945, 1978, 2068, 1080, 1127, 2350, 2448, 1274, 1325
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := n (n+3) Switch[Mod[n, 4], 0|3, 1, _, 1/2]; Table[a[n], {n, 0, 50}]
    Table[If[MemberQ[{0,3},Mod[n,4]],n(n+3),(n(n+3))/2],{n,0,50}] (* or *) LinearRecurrence[{3,-6,10,-12,12,-10,6,-3,1},{0,2,5,18,28,20,27,70,88},60] (* Harvey P. Dale, Jun 05 2021 *)
  • PARI
    concat(0, Vec(x*(2 - x + 15*x^2 - 16*x^3 + 18*x^4 - 9*x^5 + 5*x^6 - 2*x^7) / ((1 - x)^3*(1 + x^2)^3) + O(x^60))) \\ Colin Barker, Jun 21 2017
    
  • PARI
    i=I; a(n) = (1/8 + i/8)*(((3 - 3*i) - i*(-i)^n + i^n)*n*(3 + n)) \\ Colin Barker, Jun 21 2017

Formula

a(n) = n*(n+3)/2 * (2 - floor((n+1)/2) mod 2), where n*(n+3)/2 is A000096(n).
a(n) = A060819(n+3)*A145979(n-2).
a(n) = (2*n*(n+3))/(GCD(4, n+2)*GCD(4, n+3)).
a(n) = A227316(n+1) - (period 4 repeat 2,1,1,2).
From Colin Barker, Jun 21 2017: (Start)
G.f.: x*(2 - x + 15*x^2 - 16*x^3 + 18*x^4 - 9*x^5 + 5*x^6 - 2*x^7) / ((1 - x)^3*(1 + x^2)^3).
a(n) = (1/8 + i/8)*(((3 - 3*i) - i*(-i)^n + i^n)*n*(3 + n)), where i=sqrt(-1). (End)
Sum_{n>=1} 1/a(n) = 17/18 + log(2)/6. - Amiram Eldar, Aug 12 2022

A383641 a(n) is the difference between the sum of even composites and the sum of the odd composites in the first n positive integers.

Original entry on oeis.org

0, 0, 0, 4, 4, 10, 10, 18, 9, 19, 19, 31, 31, 45, 30, 46, 46, 64, 64, 84, 63, 85, 85, 109, 84, 110, 83, 111, 111, 141, 141, 173, 140, 174, 139, 175, 175, 213, 174, 214, 214, 256, 256, 300, 255, 301, 301, 349, 300, 350, 299, 351, 351, 405, 350, 406, 349, 407, 407
Offset: 1

Views

Author

Felix Huber, May 08 2025

Keywords

Examples

			Of the first 9 positive integers, 4, 6, and 8 are even composites and 9 is an odd composite, so a(9) = 4 + 6 + 8 - 9 = 9.
		

Crossrefs

Programs

  • Maple
    A383641:=n->`if`(n=1,0,floor((n-2)/2)-n*(n mod 2)+add(ithprime(i),i=2..NumberTheory:-pi(n)));seq(A383641(n),n=1..59);
  • Mathematica
    lim=59;cn=Select[Range[lim],CompositeQ];a[n_]:=Total[Select[cn,EvenQ[#]&&#<=n&]]-Total[Select[cn,OddQ[#]&&#<=n&]];Array[a,lim] (* James C. McMahon, May 14 2025 *)

Formula

a(n) = floor((n-2)/2) - n*(n mod 2) + Sum_{i=2..pi(n)} prime(i) for n > 1.
a(n) = A004526(n) - A193356(n) - A010701(n) + A034387(A000720(n)) for n > 1.
a(n) = Sum_{i=1..n} ((-1)^i*i*A066247(i)).
Previous Showing 51-60 of 64 results. Next