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 10 results.

A176271 The odd numbers as a triangle read by rows.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 13 2010

Keywords

Comments

A108309(n) = number of primes in n-th row.

Examples

			From _Philippe Deléham_, Oct 03 2011: (Start)
Triangle begins:
   1;
   3,  5;
   7,  9, 11;
  13, 15, 17, 19;
  21, 23, 25, 27, 29;
  31, 33, 35, 37, 39, 41;
  43, 45, 47, 49, 51, 53, 55;
  57, 59, 61, 63, 65, 67, 69, 71;
  73, 75, 77, 79, 81, 83, 85, 87, 89; (End)
		

Crossrefs

Programs

  • Haskell
    a176271 n k = a176271_tabl !! (n-1) !! (k-1)
    a176271_row n = a176271_tabl !! (n-1)
    a176271_tabl = f 1 a005408_list where
       f x ws = us : f (x + 1) vs where (us, vs) = splitAt x ws
    -- Reinhard Zumkeller, May 24 2012
    
  • Magma
    [n^2-n+2*k-1: k in [1..n], n in [1..15]]; // G. C. Greubel, Mar 10 2024
    
  • Maple
    A176271 := proc(n,k)
        n^2-n+2*k-1 ;
    end proc: # R. J. Mathar, Jun 28 2013
  • Mathematica
    Table[n^2-n+2*k-1, {n,15}, {k,n}]//Flatten (* G. C. Greubel, Mar 10 2024 *)
  • SageMath
    flatten([[n^2-n+2*k-1 for k in range(1,n+1)] for n in range(1,16)]) # G. C. Greubel, Mar 10 2024

Formula

T(n, k) = n^2 - n + 2*k - 1 for 1 <= k <= n.
T(n, k) = A005408(n*(n-1)/2 + k - 1).
T(2*n-1, n) = A016754(n-1) (main diagonal).
T(2*n, n) = A000466(n).
T(2*n, n+1) = A053755(n).
T(n, k) + T(n, n-k+1) = A001105(n), 1 <= k <= n.
T(n, 1) = A002061(n), central polygonal numbers.
T(n, 2) = A027688(n-1) for n > 1.
T(n, 3) = A027690(n-1) for n > 2.
T(n, 4) = A027692(n-1) for n > 3.
T(n, 5) = A027694(n-1) for n > 4.
T(n, 6) = A048058(n-1) for n > 5.
T(n, n-3) = A108195(n-2) for n > 3.
T(n, n-2) = A082111(n-2) for n > 2.
T(n, n-1) = A014209(n-1) for n > 1.
T(n, n) = A028387(n-1).
Sum_{k=1..n} T(n, k) = A000578(n) (Nicomachus's theorem).
Sum_{k=1..n} (-1)^(k-1)*T(n, k) = (-1)^(n-1)*A065599(n) (alternating sign row sums).
Sum_{j=1..n} (Sum_{k=1..n} T(j, k)) = A000537(n) (sum of first n rows).

A267370 Partial sums of A140091.

Original entry on oeis.org

0, 6, 21, 48, 90, 150, 231, 336, 468, 630, 825, 1056, 1326, 1638, 1995, 2400, 2856, 3366, 3933, 4560, 5250, 6006, 6831, 7728, 8700, 9750, 10881, 12096, 13398, 14790, 16275, 17856, 19536, 21318, 23205, 25200, 27306, 29526, 31863, 34320, 36900, 39606, 42441, 45408, 48510
Offset: 0

Views

Author

Bruno Berselli, Jan 13 2016

Keywords

Comments

After 0, this sequence is the third column of the array in A185874.
Sequence is related to A051744 by A051744(n) = n*a(n)/3 - Sum_{i=0..n-1} a(i) for n>0.

Examples

			The sequence is also provided by the row sums of the following triangle (see the fourth formula above):
.  0;
.  1,  5;
.  4,  7, 10;
.  9, 11, 13, 15;
. 16, 17, 18, 19, 20;
. 25, 25, 25, 25, 25, 25;
. 36, 35, 34, 33, 32, 31, 30;
. 49, 47, 45, 43, 41, 39, 37, 35;
. 64, 61, 58, 55, 52, 49, 46, 43, 40;
. 81, 77, 73, 69, 65, 61, 57, 53, 49, 45, etc.
First column is A000290.
Second column is A027690.
Third column is included in A189834.
Main diagonal is A008587; other parallel diagonals: A016921, A017029, A017077, A017245, etc.
Diagonal 1, 11, 25, 43, 65, 91, 121, ... is A161532.
		

Crossrefs

Cf. similar sequences of the type n*(n+1)*(n+k)/2: A002411 (k=0), A006002 (k=1), A027480 (k=2), A077414 (k=3, with offset 1), A212343 (k=4, without the initial 0), this sequence (k=5).

Programs

  • Magma
    [n*(n+1)*(n+5)/2: n in [0..50]];
  • Mathematica
    Table[n (n + 1) (n + 5)/2, {n, 0, 50}]
    LinearRecurrence[{4,-6,4,-1},{0,6,21,48},50] (* Harvey P. Dale, Jul 18 2019 *)
  • PARI
    vector(50, n, n--; n*(n+1)*(n+5)/2)
    
  • Sage
    [n*(n+1)*(n+5)/2 for n in (0..50)]
    

Formula

O.g.f.: 3*x*(2 - x)/(1 - x)^4.
E.g.f.: x*(12 + 9*x + x^2)*exp(x)/2.
a(n) = n*(n + 1)*(n + 5)/2.
a(n) = Sum_{i=0..n} n*(n - i) + 5*i, that is: a(n) = A002411(n) + A028895(n). More generally, Sum_{i=0..n} n*(n - i) + k*i = n*(n + 1)*(n + k)/2.
a(n) = 3*A005581(n+1).
a(n+1) - 3*a(n) + 3*a(n-1) = 3*A105163(n) for n>0.
From Amiram Eldar, Jan 06 2021: (Start)
Sum_{n>=1} 1/a(n) = 163/600.
Sum_{n>=1} (-1)^(n+1)/a(n) = 4*log(2)/5 - 253/600. (End)

A027718 Numbers k such that k^2+k+5 is a palindrome.

Original entry on oeis.org

0, 1, 2, 8, 12, 26, 74, 127, 224, 230, 2751, 3462, 4012, 4067, 12752, 22424, 27548, 28168, 105322, 107422, 2358150, 2724718, 2775383, 4063892, 7569245, 85125933, 87579753, 106617617, 2237334999, 2426472519, 2765569146, 2781875716, 2815069131, 4029203527
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    palQ[n_] := Block[{d = IntegerDigits[n]}, d == Reverse[d]]; f[n_] := n^2 + n + 5; Select[Range[0, 10^5], palQ@ f@ # &] (* Giovanni Resta, Aug 29 2018 *)

Extensions

More terms from Giovanni Resta, Aug 28 2018

A027728 Palindromes of form k^2 + k + 5.

Original entry on oeis.org

5, 7, 11, 77, 161, 707, 5555, 16261, 50405, 53135, 7570757, 11988911, 16100161, 16544561, 162626261, 502858205, 758919857, 793464397, 11092829011, 11539593511, 5560873780655, 7424090904247, 7702753572077, 16515222251561, 57293477439275, 7246424554246427
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    palQ[n_] := Block[{d = IntegerDigits[n]}, d == Reverse[d]]; f[n_] := n^2 + n + 5; Select[f@ Range[0, 10^5], palQ] (* Giovanni Resta, Aug 29 2018 *)
    Select[Table[k^2+k+5,{k,0,852*10^5}],PalindromeQ] (* Harvey P. Dale, Aug 04 2025 *)

Extensions

More terms from Giovanni Resta, Aug 28 2018

A213921 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 clockwise. Table T(n,k) read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Mar 05 2013

Keywords

Comments

A 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) is 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(2,n), T(4,n), ... T(n,4), T(n,2);
...

Examples

			The start of the sequence as table:
   1   2   5  10  17  26 ...
   3   4   8  14  22  32 ...
   7   9   6  11  18  27 ...
  13  16  12  15  23  33 ...
  21  25  20  24  19  28 ...
  31  36  30  35  29  34 ...
  ...
The start of the sequence as triangle array read by rows:
   1;
   2,  3;
   5,  4,  7;
  10,  8,  9, 13;
  17, 14,  6, 16, 21;
  26, 22, 11, 12, 25, 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-(j%2)*i+2-int((j+2)/2)
    else:
       result=j*j-((i%2)+1)*j + int((i+3)/2)

Formula

As a table:
T(n,k) = n*n - (k mod 2)*n + 2 - floor((k+2)/2), if n>k;
T(n,k) = k*k - ((n mod 2)+1)*k + floor((n+3)/2), if n<=k.
As a linear sequence:
a(n) = i*i - (j mod 2)*i + 2 - floor((j+2)/2), if i>j;
a(n) = j*j - ((i mod 2)+1)*j + floor((i+3)/2), 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).

A034115 Fractional part of square root of a(n) starts with 9: first term of runs.

Original entry on oeis.org

35, 48, 63, 80, 99, 119, 142, 167, 194, 223, 253, 286, 321, 358, 397, 437, 480, 525, 572, 621, 671, 724, 779, 836, 895, 955, 1018, 1083, 1150, 1219, 1289, 1362, 1437, 1514, 1593, 1673, 1756, 1841, 1928, 2017, 2107, 2200, 2295, 2392, 2491, 2591, 2694
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1998

Keywords

Comments

How is this different from A034105? - N. J. A. Sloane, Mar 30 2007
Answer: A034115 has the starts of runs of consecutive values of A034105. That is, frac{sqrt[a(n)]} >= 0.9, but frac{sqrt[a(n)-1]} < 0.9. - Don Reble, Jul 17 2020

Examples

			358, 359 and 360 are a run of 3 numbers in A034105, so 358 is in this sequence, but 359 and 360 are not. - _R. J. Mathar_, Jul 21 2020
		

Crossrefs

Programs

  • Mathematica
    Join[{35},Select[Partition[Select[Range[3000],NumberDigit[Sqrt[#],-1] == 9&],2,1],(#[[2]]-#[[1]]!=1&)][[All,2]]] (* or *) LinearRecurrence[{2,-1,0,0,1,-2,1},{35,48,63,80,99,119,142},50] (* Harvey P. Dale, Aug 14 2021 *)

Formula

a(n) = n^2 + 9*n + 25 + floor(4*n / 5) = A027690(n+4)+A090223(n). - Don Reble, Jul 17 2020

A171746 Let f(n) = n + floor(sqrt(n)). Then a(n) is the smallest number of iterations of f on n such that a perfect square is obtained.

Original entry on oeis.org

3, 2, 1, 5, 2, 4, 1, 3, 7, 2, 4, 6, 1, 3, 5, 9, 2, 4, 6, 8, 1, 3, 5, 7, 11, 2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 13, 2, 4, 6, 8, 10, 12, 1, 3, 5, 7, 9, 11, 15, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 17, 2, 4, 6, 8, 10, 12, 14, 16, 1, 3, 5, 7, 9, 11, 13, 15, 19, 2, 4, 6, 8, 10, 12, 14, 16, 18, 1, 3, 5
Offset: 1

Views

Author

Neven Juric (neven.juric(AT)apis-it.hr), Oct 07 2010

Keywords

Comments

Iterate A028392, starting with n: a(n) is the number of steps until a square will be reached. - Reinhard Zumkeller, Feb 23 2012

Examples

			f(9)=12, f(12)=15, f(15)=18, f(18)=22, f(22)=26, f(26)=31, f(31)=36. The first square number in this sequence 12,15,18,22,26,31,36 is on the seventh place and therefore a(9)=7.
		

References

  • Matematicko-fizicki list 1/144, problem 2-2, page 29, (1985-1986).

Crossrefs

Programs

  • Haskell
    a171746 = (+ 1) . length . takeWhile (== 0) .
                               map a010052 . tail . iterate a028392
    -- Reinhard Zumkeller, Feb 23 2012, Oct 14 2010
    
  • Mathematica
    f[n_] := Length@ NestWhileList[ # + Floor@Sqrt@# &, n, ! IntegerQ@Sqrt@# || # == n &] - 1; Array[f, 93] (* Robert G. Wilson v, Oct 08 2010 *)
  • PARI
    f(n) = n + sqrtint(n); \\ A028392
    a(n) = my(k=1); while (!issquare(n=f(n)), k++); k; \\ Michel Marcus, Nov 06 2022

Formula

From Robert G. Wilson v, Oct 08 2010: (Start)
a(k)=1 for A002061(n): n^2 - n + 1 for n>1;
a(k)=2 for A002522(n): n^2 + 1 for n>1;
a(k)=3 for A014206(n): n^2 + n + 2 for n>1;
a(k)=4 for A059100(n): n^2 + 2 for n>1;
a(k)=5 for A027688(n): n^2 + n + 3 for n>2;
a(k)=6 for A117950(n): n^2 + 3 for n>2;
a(k)=7 for A027689(n): n^2 + n + 4 for n>4;
a(k)=8 for A087475(n): n^2 + 4 for n>3;
a(k)=9 for A027690(n): n^2 + n + 5 for n>4; ... (End)
a(n^2) = 2*n + 1: a(A000290(n)) = A005408(n). - Reinhard Zumkeller, Oct 14 2010

A217776 a(n) = n*(n+1) + (n+2)*(n+3) + (n+4)*(n+5) + (n+6)*(n+7).

Original entry on oeis.org

68, 100, 140, 188, 244, 308, 380, 460, 548, 644, 748, 860, 980, 1108, 1244, 1388, 1540, 1700, 1868, 2044, 2228, 2420, 2620, 2828, 3044, 3268, 3500, 3740, 3988, 4244, 4508, 4780, 5060, 5348, 5644, 5948, 6260, 6580, 6908, 7244, 7588, 7940, 8300, 8668, 9044, 9428
Offset: 0

Views

Author

Jon Perry, Mar 24 2013

Keywords

Examples

			a(1) = 1*2 + 3*4 + 5*6 + 7*8 = 2 + 12 + 30 + 56 = 100.
		

Crossrefs

Cf. A020742, A027690, A051890 (two pairs), A217775 (3 pairs).

Programs

  • GAP
    List([0..50], n-> (2*n+7)^2+19); # G. C. Greubel, Aug 27 2019
  • JavaScript
    for (j=0;j<50;j++) {
    a=j*(j+1)+(j+2)*(j+3)+(j+4)*(j+5)+(j+6)*(j+7);
    document.write(a+", ");
    }
    
  • Magma
    [(2*n+7)^2+19: n in [0..50]]; // G. C. Greubel, Aug 27 2019
    
  • Maple
    seq((2*n+7)^2+19, n=0..50); # G. C. Greubel, Aug 27 2019
  • Mathematica
    (2*Range[50] +5)^2 +19 (* G. C. Greubel, Aug 27 2019 *)
    Table[4n^2+28n+68,{n,0,50}] (* or *) LinearRecurrence[{3,-3,1},{68,100,140},50] (* Harvey P. Dale, Jan 15 2020 *)
  • PARI
    a(n)=4*n^2+28*n+68 \\ Charles R Greathouse IV, Jun 17 2017
    
  • Sage
    [(2*n+7)^2+19 for n in (0..50)] # G. C. Greubel, Aug 27 2019
    

Formula

From Bruno Berselli, Mar 29 2013: (Start)
G.f.: 4*(17-26*x+11*x^2)/(1-x)^3.
a(n) = 4*n^2 + 28*n + 68.
a(n) = 4*A027690(n+3) = A020742(n)^2 + 19. (End)
E.g.f.: 4*(17 +8*x +x^2)*exp(x). - G. C. Greubel, Aug 27 2019

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).

A268101 Smallest prime p such that some polynomial of the form a*x^2 - b*x + p generates distinct primes in absolute value for x = 1 to n, where 0 < a < p and 0 <= b < p.

Original entry on oeis.org

2, 3, 5, 5, 7, 7, 11, 11, 11, 11, 13, 13, 17, 17, 17, 17, 19, 19, 23, 23, 23, 23, 29, 29, 29, 29, 29, 29, 31, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 647, 1277, 1979, 2753
Offset: 1

Views

Author

Arkadiusz Wesolowski, Jan 26 2016

Keywords

Examples

			a(1) = 2 (a prime), x^2 + 2 gives a prime for x = 1.
a(2) = 3 (a prime), 2*x^2 + 3 gives distinct primes for x = 1 to 2.
a(4) = 5 (a prime), 2*x^2 + 5 gives distinct primes for x = 1 to 4.
a(6) = 7 (a prime), 4*x^2 + 7 gives distinct primes for x = 1 to 6.
a(10) = 11 (a prime), 2*x^2 + 11 gives distinct primes for x = 1 to 10.
a(12) = 13 (a prime), 6*x^2 + 13 gives distinct primes for x = 1 to 12.
a(16) = 17 (a prime), 6*x^2 + 17 gives distinct primes for x = 1 to 16.
a(18) = 19 (a prime), 10*x^2 + 19 gives distinct primes for x = 1 to 18.
a(22) = 23 (a prime), 3*x^2 - 3*x + 23 gives distinct primes for x = 1 to 22.
a(28) = 29 (a prime), 2*x^2 + 29 gives distinct primes for x = 1 to 28.
a(29) = 31 (a prime), 2*x^2 - 4*x + 31 gives distinct primes for x = 1 to 29.
a(40) = 41 (a prime), x^2 - x + 41 gives distinct primes for x = 1 to 40.
a(41) = 647 (a prime), abs(36*x^2 - 594*x + 647) gives distinct primes for x = 1 to 41.
a(42) = 1277 (a prime), abs(36*x^2 - 666*x + 1277) gives distinct primes for x = 1 to 42.
a(43) = 1979 (a prime), abs(36*x^2 - 738*x + 1979) gives distinct primes for x = 1 to 43.
a(44) = 2753 (a prime), abs(36*x^2 - 810*x + 2753) gives distinct primes for x = 1 to 44.
		

Crossrefs

Showing 1-10 of 10 results.