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 11-20 of 20 results.

A086273 Rectangular array T(n,k) of central polygonal numbers, by antidiagonals.

Original entry on oeis.org

1, 1, 3, 1, 4, 7, 1, 5, 10, 13, 1, 6, 13, 19, 21, 1, 7, 16, 25, 31, 31, 1, 8, 19, 31, 41, 46, 43, 1, 9, 22, 37, 51, 61, 64, 57, 1, 10, 25, 43, 61, 76, 85, 85, 73, 1, 11, 28, 49, 71, 91, 106, 113, 109, 91, 1, 12, 31, 55, 81, 106, 127, 141, 145, 136, 111, 1, 13, 34, 61, 91, 121, 148
Offset: 1

Views

Author

Clark Kimberling, Jul 14 2003

Keywords

Comments

Transpose of the array at A086272.

Examples

			Northwest corner:
  1    1    1    1    1    1    1    1    1    1
  3    4    5    6    7    8    9   10   11   12 A000027
  7   10   13   16   19   22   25   28   31   34 A112414, A016777
  13   19   25   31   37   43   49   55   61   67 A016921
  21   31   41   51   61   71   81   91  101  111 A017281
  31   46   61   76   91  106  121  136  151  166
  43   64   85  106  127  148  169  190  211  232
  57   85  113  141  169  197  225  253  281  309
  73  109  145  181  217  253  289  325  361  397
  91  136  181  226  271  316  361  406  451  496
111  166  221  276  331  386  441  496  551  606
133  199  265  331  397  463  529  595  661  727
157  235  313  391  469  547  625  703  781  859
183  274  365  456  547  638  729  820  911 1002
211  316  421  526  631  736  841  946 1051 1156
241  361  481  601  721  841  961 1081 1201 1321
		

Crossrefs

Programs

Formula

T(n, k)=(k+1)*binomial(n, 2)+1.

A358863 a(n) is the smallest n-gonal number with exactly n prime factors (counted with multiplicity).

Original entry on oeis.org

4, 28, 16, 176, 4950, 8910, 1408, 346500, 277992, 7542080, 326656, 544320, 120400000, 145213440, 48549888, 4733575168, 536813568, 2149576704, 3057500160, 938539560960, 1358951178240, 36324805836800, 99956555776, 49212503949312, 118747221196800, 59461613912064, 13749193801728
Offset: 2

Views

Author

Ilya Gutkovskiy, Dec 03 2022

Keywords

Comments

The corresponding indices of n-gonal numbers are 7, 4, 11, 50, 60, 22, 315, 264, 1295, 256, 315, 4480, 4727, 2634, 25123, 8192, 15903, 18432, 314315, 368640, ...
a(n) is the first n-gonal number k such that A001222(k)= n. - Robert Israel, Jan 15 2023

Examples

			a(3) = 28, because 28 is a triangular number with 3 prime factors (counted with multiplicity) {2, 2, 7} and this is the smallest such number.
		

Crossrefs

Programs

  • Maple
    g:= proc(s) local n, p, F;
      for n from 1 to 10^7 do
        p:= (s-2)*n*(n-1)/2 + n;
        if numtheory:-bigomega(p) = s then return p fi;
      od
    end proc:
    map(g, [$2..30]); # Robert Israel, Jan 15 2023
  • Mathematica
    sng[n_]:=Module[{k=1},While[PrimeOmega[PolygonalNumber[n,k]]!=n,k++];PolygonalNumber[ n,k]]; Array[sng,21,2] (* The program generates the first 20 terms of the sequence. *) (* Harvey P. Dale, Feb 19 2023 *)
  • PARI
    a(n) = if(n<3, return()); for(k=1, oo, my(t=(k*(n*k - n - 2*k + 4))\2); if(bigomega(t) == n, return(t))); \\ Daniel Suteu, Dec 04 2022
    
  • PARI
    bigomega_polygonals(A, B, n, k) = A=max(A, 2^n); (f(m, p, n) = my(list=List()); if(n==1, forprime(q=max(p,ceil(A/m)), B\m, my(t=m*q); if(ispolygonal(t,k), listput(list, t))), forprime(q = p, sqrtnint(B\m, n), my(t=m*q); if(ceil(A/t) <= B\t, list=concat(list, f(t, q, n-1))))); list); vecsort(Vec(f(1, 2, n)));
    a(n, k=n) = if(k < 3, return()); my(x=2^n, y=2*x); while(1, my(v=bigomega_polygonals(x, y, n, k)); if(#v >= 1, return(v[1])); x=y+1; y=2*x); \\ Daniel Suteu, Dec 04 2022

Formula

A001222(a(n)) = n. - Robert Israel, Jan 15 2023

Extensions

a(23)-a(28) from Daniel Suteu, Dec 04 2022
a(2)=4 prepended by Robert Israel, Jan 15 2023

A125764 Array of partial sums of rows of array in A086271, read by antidiagonals.

Original entry on oeis.org

1, 3, 2, 6, 7, 3, 10, 15, 12, 4, 15, 26, 27, 18, 5, 21, 40, 48, 42, 25, 6, 28, 57, 75, 76, 60, 33, 7, 36, 77, 108, 120, 110, 81, 42, 8, 45, 100, 147, 174, 175, 150, 105, 52, 9, 55, 126, 192, 238, 255, 240, 196, 132, 63, 10, 66, 155, 243, 312, 350, 351, 315, 248, 162, 75, 11
Offset: 1

Views

Author

Jonathan Vos Post and Joshua Zucker, Feb 03 2007

Keywords

Comments

Row 3 is = 3rd triangular number + 3rd square + 3rd pentagonal number + 3rd hexagonal number + ... + 3rd k-gonal number. First column is triangular numbers. A086271 Rectangular array T(n,k) of polygonal numbers, by diagonals.

Examples

			Partial row sum array begins:
1 | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ... n.
2 | 3, 7, 12, 18, 25, 33, 42, 52, (n(n+1)/2)-3.
3 | 6, 15, 27, 42, 60, 81, 105, ... (3/2)n^2 + (9/2) n.
4 | 10, 26, 48, 76, 110, 150, ... 3n^2 + 7n.
5 | 15, 40, 75, ... 5n^2 + 10n.
6 | 21, 57, 108, ... (15/2)n^2 + (27/2)n.
		

Crossrefs

Programs

  • Maple
    A086271 := proc(n,k) k*binomial(n,2)+n ; end: A125764 := proc(n,k) add(A086271(n,i),i=1..k) ; end: for d from 1 to 15 do for k from 1 to d do printf("%d, ",A125764(d-k+1,k)) ; od: od: # R. J. Mathar, Nov 02 2007

Formula

a(k,n) = (k*(k-1)/2)n^2 + (k*(k+3)/4)n. a(k,n) = row k of array of partial sums = k-th triangular number + k-th square + k-th pentagonal number + k-th hexagonal number + ... = A000217(k) + A000290(k) + A000326(k) + A000384(k) + ... a(1,n) = n. a(2,n) = (n(n+1)/2)-3 = A000217(n) - 3. a(3,n) = 3*n(n+3)/2 = A000096 with offset 3.

Extensions

More terms from R. J. Mathar, Nov 02 2007
Keyword tabl added by Michel Marcus, Apr 08 2013

A183225 Array: row r is the complement of the (r+2)-gonal numbers; by antidiagonals.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jan 01 2011

Keywords

Comments

The n-th non k-gonal number is given by n+round(sqrt(2n/(k-2))) for k <= 10 and given by n+round(sqrt((2n-2+floor((k+1)/4))/(k-2))) for k > 10. - Chai Wah Wu, Oct 06 2024

Examples

			Northwest corner:
2...4...5...7...8...9...11...12...13 (A014132)
2...3...5...6...7...8...10...11...12 (A000037)
2...3...4...6...7...8....9...10...11 (A183217)
2...3...4...5...7...8....9...10...11 (A183218)
2...3...4...5...6...8....9...10...11 (A183219)
2...3...4...5...6...7....9...10...11 (A183220)
2...3...4...5...6...7....8...10...11 (A183221)
		

Crossrefs

Cf. A086270 (array of the r-gonal numbers by rows),
A014132 (complement of the triangular numbers),
A000037 (complement of the squares),
A183217 (complement of the pentagonal numbers).

Programs

  • Python
    from itertools import count, islice
    from math import isqrt
    def A183225_T(n,k): return n+(isqrt(((n<<3)+(-8+(k+1&-4) if k>10 else 0))//(k-2))+1>>1)
    def A183225_gen(): # generator of terms
        return (A183225_T(m-k+3,k) for m in count(1) for k in range(3,m+3))
    A183225_list = list(islice(A183225_gen(),100)) # Chai Wah Wu, Oct 06 2024

A141534 Derived from the centered polygonal numbers: start with the first triangular number, then the sum of the first square number and the second triangular number, then the sum of first pentagonal number, the second square number and the third triangular number, and so on and so on...

Original entry on oeis.org

1, 4, 11, 26, 55, 105, 184, 301, 466, 690, 985, 1364, 1841, 2431, 3150, 4015, 5044, 6256, 7671, 9310, 11195, 13349, 15796, 18561, 21670, 25150, 29029, 33336, 38101, 43355, 49130, 55459, 62376, 69916, 78115, 87010, 96639, 107041, 118256, 130325
Offset: 1

Views

Author

Dan Graybill (clopen(AT)comcast.net), Aug 12 2008

Keywords

Comments

Consider the array of triangular, square and centered polygonal numbers (irregular variant of A086272 and A086273):
1 3 6 10 15 21 28 36 45 55 A000217
1 4 9 16 25 36 49 64 81 100 A000290
1 6 16 31 51 76 106 141 181 226 A005891
1 7 19 37 61 91 127 169 217 271 A003215
1 8 22 43 71 106 148 197 253 316 A069099
1 9 25 49 81 121 169 225 289 361 A016754
1 10 28 55 91 136 190 253 325 406 A060544
1 11 31 61 101 151 211 281 361 451 A062786
1 12 34 67 111 166 232 309 397 496 A069125
1 13 37 73 121 181 253 337 433 541 A003154
1 14 40 79 131 196 274 365 469 586 A069126
1 15 43 85 141 211 295 393 505 631 A069127
etc. The sequence contains the antidiagonal sums of this array. - R. J. Mathar, Jun 05 2011
For comparison, the antidiagonal sums of A086270 are essentially A006522 starting at the 4th term. - R. J. Mathar, Sep 20 2008

Crossrefs

Cf. A000217.

Formula

a(n) = (n-1)*(n^3+11*n^2-38*n+120)/24, n>1. - R. J. Mathar, Sep 12 2008
G.f.: x*(1-x+x^2+x^3-x^5)/(1-x)^5. - Alexander R. Povolotsky, Jun 06 2011

A303273 Array T(n,k) = binomial(n, 2) + k*n + 1 read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 3, 4, 4, 1, 4, 6, 7, 7, 1, 5, 8, 10, 11, 11, 1, 6, 10, 13, 15, 16, 16, 1, 7, 12, 16, 19, 21, 22, 22, 1, 8, 14, 19, 23, 26, 28, 29, 29, 1, 9, 16, 22, 27, 31, 34, 36, 37, 37, 1, 10, 18, 25, 31, 36, 40, 43, 45, 46, 46, 1, 11, 20, 28, 35, 41
Offset: 0

Views

Author

Keywords

Comments

Columns are linear recurrence sequences with signature (3,-3,1).
8*T(n,k) + A166147(k-1) are squares.
Columns k are binomial transforms of [1, k, 1, 0, 0, 0, ...].
Antidiagonals sums yield A116731.

Examples

			The array T(n,k) begins
1    1    1    1    1    1    1    1    1    1    1    1    1  ...  A000012
1    2    3    4    5    6    7    8    9   10   11   12   13  ...  A000027
2    4    6    8   10   12   14   16   18   20   22   24   26  ...  A005843
4    7   10   13   16   19   22   25   28   31   34   37   40  ...  A016777
7   11   15   19   23   27   31   35   39   43   47   51   55  ...  A004767
11  16   21   26   31   36   41   46   51   56   61   66   71  ...  A016861
16  22   28   34   40   46   52   58   64   70   76   82   88  ...  A016957
22  29   36   43   50   57   64   71   78   85   92   99  106  ...  A016993
29  37   45   53   61   69   77   85   93  101  109  117  125  ...  A004770
37  46   55   64   73   82   91  100  109  118  127  136  145  ...  A017173
46  56   66   76   86   96  106  116  126  136  146  156  166  ...  A017341
56  67   78   89  100  111  122  133  144  155  166  177  188  ...  A017401
67  79   91  103  115  127  139  151  163  175  187  199  211  ...  A017605
79  92  105  118  131  144  157  170  183  196  209  222  235  ...  A190991
...
The inverse binomial transforms of the columns are
1    1    1    1    1    1    1    1    1    1    1    1    1  ...
0    1    2    3    4    5    6    7    8    9   10   11   12  ...
1    1    1    1    1    1    1    1    1    1    1    1    1  ...
0    0    0    0    0    0    0    0    0    0    0    0    0  ...
0    0    0    0    0    0    0    0    0    0    0    0    0  ...
0    0    0    0    0    0    0    0    0    0    0    0    0  ...
...
T(k,n-k) = A087401(n,k) + 1 as triangle
1
1   1
1   2   2
1   3   4   4
1   4   6   7   7
1   5   8  10  11  11
1   6  10  13  15  16  16
1   7  12  16  19  21  22  22
1   8  14  19  23  26  28  29  29
1   9  16  22  27  31  34  36  37  37
1  10  18  25  31  36  40  43  45  46  46
...
		

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics: A Foundation for Computer Science, Addison-Wesley, 1994.

Crossrefs

Programs

  • Maple
    T := (n, k) -> binomial(n, 2) + k*n + 1;
    for n from 0 to 20 do seq(T(n, k), k = 0 .. 20) od;
  • Mathematica
    Table[With[{n = m - k}, Binomial[n, 2] + k n + 1], {m, 0, 11}, {k, m, 0, -1}] // Flatten (* Michael De Vlieger, Apr 21 2018 *)
  • Maxima
    T(n, k) := binomial(n, 2)+ k*n + 1$
    for n:0 thru 20 do
        print(makelist(T(n, k), k, 0, 20));
    
  • PARI
    T(n,k) = binomial(n, 2) + k*n + 1;
    tabl(nn) = for (n=0, nn, for (k=0, nn, print1(T(n, k), ", ")); print); \\ Michel Marcus, May 17 2018

Formula

G.f.: (3*x^2*y - 3*x*y + y - 2*x^2 + 2*x - 1)/((x - 1)^3*(y - 1)^2).
E.g.f.: (1/2)*(2*x*y + x^2 + 2)*exp(y + x).
T(n,k) = 3*T(n-1,k) - 3*T(n-2,k) + T(n-3,k), with T(0,k) = 1, T(1,k) = k + 1 and T(2,k) = 2*k + 2.
T(n,k) = T(n-1,k) + n + k - 1.
T(n,k) = T(n,k-1) + n, with T(n,0) = 1.
T(n,0) = A152947(n+1).
T(n,1) = A000124(n).
T(n,2) = A000217(n).
T(n,3) = A034856(n+1).
T(n,4) = A052905(n).
T(n,5) = A051936(n+4).
T(n,6) = A246172(n+1).
T(n,7) = A302537(n).
T(n,8) = A056121(n+1) + 1.
T(n,9) = A056126(n+1) + 1.
T(n,10) = A051942(n+10) + 1, n > 0.
T(n,11) = A101859(n) + 1.
T(n,12) = A132754(n+1) + 1.
T(n,13) = A132755(n+1) + 1.
T(n,14) = A132756(n+1) + 1.
T(n,15) = A132757(n+1) + 1.
T(n,16) = A132758(n+1) + 1.
T(n,17) = A212427(n+1) + 1.
T(n,18) = A212428(n+1) + 1.
T(n,n) = A143689(n) = A300192(n,2).
T(n,n+1) = A104249(n).
T(n,n+2) = T(n+1,n) = A005448(n+1).
T(n,n+3) = A000326(n+1).
T(n,n+4) = A095794(n+1).
T(n,n+5) = A133694(n+1).
T(n+2,n) = A005449(n+1).
T(n+3,n) = A115067(n+2).
T(n+4,n) = A133694(n+2).
T(2*n,n) = A054556(n+1).
T(2*n,n+1) = A054567(n+1).
T(2*n,n+2) = A033951(n).
T(2*n,n+3) = A001107(n+1).
T(2*n,n+4) = A186353(4*n+1) (conjectured).
T(2*n,n+5) = A184103(8*n+1) (conjectured).
T(2*n,n+6) = A250657(n-1) = A250656(3,n-1), n > 1.
T(n,2*n) = A140066(n+1).
T(n+1,2*n) = A005891(n).
T(n+2,2*n) = A249013(5*n+4) (conjectured).
T(n+3,2*n) = A186384(5*n+3) = A186386(5*n+3) (conjectured).
T(2*n,2*n) = A143689(2*n).
T(2*n+1,2*n+1) = A143689(2*n+1) (= A030503(3*n+3) (conjectured)).
T(2*n,2*n+1) = A104249(2*n) = A093918(2*n+2) = A131355(4*n+1) (= A030503(3*n+5) (conjectured)).
T(2*n+1,2*n) = A085473(n).
a(n+1,5*n+1)=A051865(n+1) + 1.
a(n,2*n+1) = A116668(n).
a(2*n+1,n) = A054569(n+1).
T(3*n,n) = A025742(3*n-1), n > 1 (conjectured).
T(n,3*n) = A140063(n+1).
T(n+1,3*n) = A069099(n+1).
T(n,4*n) = A276819(n).
T(4*n,n) = A154106(n-1), n > 0.
T(2^n,2) = A028401(n+2).
T(1,n)*T(n,1) = A006000(n).
T(n*(n+1),n) = A211905(n+1), n > 0 (conjectured).
T(n*(n+1)+1,n) = A294259(n+1).
T(n,n^2+1) = A081423(n).
T(n,A000217(n)) = A158842(n), n > 0.
T(n,A152947(n+1)) = A060354(n+1).
floor(T(n,n/2)) = A267682(n) (conjectured).
floor(T(n,n/3)) = A025742(n-1), n > 0 (conjectured).
floor(T(n,n/4)) = A263807(n-1), n > 0 (conjectured).
ceiling(T(n,2^n)/n) = A134522(n), n > 0 (conjectured).
ceiling(T(n,n/2+n)/n) = A051755(n+1) (conjectured).
floor(T(n,n)/n) = A133223(n), n > 0 (conjectured).
ceiling(T(n,n)/n) = A007494(n), n > 0.
ceiling(T(n,n^2)/n) = A171769(n), n > 0.
ceiling(T(2*n,n^2)/n) = A046092(n), n > 0.
ceiling(T(2*n,2^n)/n) = A131520(n+2), n > 0.

A350512 Triangle read by rows with T(n,0) = 1 for n >= 0 and T(n,k) = binomial(n-1,k-1)*(2*k*(n-k) + n)/k for 0 < k <= n.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 7, 7, 1, 1, 10, 18, 10, 1, 1, 13, 34, 34, 13, 1, 1, 16, 55, 80, 55, 16, 1, 1, 19, 81, 155, 155, 81, 19, 1, 1, 22, 112, 266, 350, 266, 112, 22, 1, 1, 25, 148, 420, 686, 686, 420, 148, 25, 1, 1, 28, 189, 624, 1218, 1512, 1218, 624, 189, 28, 1
Offset: 0

Views

Author

Werner Schulte, Jan 02 2022

Keywords

Comments

Depending on some fixed integer m there is a family of number triangles T(m; n,k) for 0 <= k <= n with entries: T(m; n,0) = 1 for n >= 0 and T(m; n,k) = binomial(n-1,k-1)*(m*k*(n-k) + n)/k for 0 < k <= n.
Special cases: m=0 (A007318), m=1 (A103450), and m=2 (this triangle).
Further properties: T(m; n,n) = 1 for n >= 0; T(m; n,k) = T(m; n,n-k) for 0 <= k <= n; T(m; 2*n,n) = A000108(n)*A086270(m,n+1) for n >= 0 and m > 0.
T(m; n,k) = T(m; n-1,k) + T(m; n-1,k-1) + m*binomial(n-2,k-1) for 0 < k < n.
G.f. of column k: (1 + m*k*x) * x^k / (1 - x)^(k+1).
G.f.: A(x, t) = (1 - (1+x)*t + m*x*t^2) / (1 - (1+x)*t)^2.
T(m; n,k) = [x^k] (1 + (m*n - m + 2)*x + x^2) * (1 + x)^(n-2) for n > 0.

Examples

			Triangle T(n, k) for 0 <= k <= n starts:
n\k :  0   1    2    3    4    5    6    7   8  9
=================================================
  0 :  1
  1 :  1   1
  2 :  1   4    1
  3 :  1   7    7    1
  4 :  1  10   18   10    1
  5 :  1  13   34   34   13    1
  6 :  1  16   55   80   55   16    1
  7 :  1  19   81  155  155   81   19    1
  8 :  1  22  112  266  350  266  112   22   1
  9 :  1  25  148  420  686  686  420  148  25  1
  etc.
		

Crossrefs

Row sums are A057711(n+1).

Programs

  • Mathematica
    Flatten[Table[Join[{1},Table[Binomial[n-1,k-1](2*k*(n-k) + n)/k,{k,n}]],{n,0,10}]] (* Stefano Spezia, Jan 06 2022 *)

Formula

T(n, n) = 1; T(n, k) = T(n, n-k).
T(2*n, n) = (n+1)^2 * A000108(n).
T(n, k) = T(n-1, k) + T(n-1, k-1) + 2 * binomial(n-2,k-1) for 0 < k < n.
G.f. of column k: (1 + 2*k*x) * x^k / (1 - x)^(k+1).
G.f.: A(x,t) = (1 - (1 + x) * t + 2 * x * t^2) / (1 - (1 + x) * t)^2.
T(n,k) = [x^k] (1 + 2 * n * x + x^2) * (1 + x)^(n-2) for n > 0.

A368074 a(n) is the least number k such that the k-th n-gonal number can be written as the difference of two positive n-gonal numbers in exactly n ways.

Original entry on oeis.org

5, 12, 82, 105, 297, 182
Offset: 3

Views

Author

Ilya Gutkovskiy, Dec 10 2023

Keywords

Comments

The corresponding n-gonal numbers are in A368075.

Examples

			a(3) = 5: T(5) = T(6) - T(3) = T(8) - T(6) = T(15) - T(14), where T(k) is the k-th triangular number.
		

Crossrefs

A368075 a(n) is the least n-gonal number that can be expressed as the difference of two positive n-gonal numbers in exactly n ways.

Original entry on oeis.org

15, 144, 10045, 21945, 220077, 99008
Offset: 3

Views

Author

Ilya Gutkovskiy, Dec 10 2023

Keywords

Comments

The corresponding indices of n-gonal numbers are in A368074.

Examples

			a(3) = 15: 15 = 21 - 6 = 36 - 21 = 120 - 105.
		

Crossrefs

A376614 a(n) is the least n-gonal number that is an interprime, i.e. the average of two consecutive primes.

Original entry on oeis.org

6, 4, 12, 6, 18, 21, 9, 370, 30, 12, 405, 39, 15, 45, 231, 18, 2619, 2772, 21, 205, 596, 69, 72, 26, 154, 81, 574, 30, 441, 93, 315, 34, 102, 105, 108, 111, 39, 1377, 120, 42, 1485, 129, 45, 1990, 138, 465, 144, 50, 150, 4564, 515, 19684, 1120, 56, 334, 846, 861, 60, 180, 5474, 186, 64, 192, 195
Offset: 3

Views

Author

Robert Israel, Sep 29 2024

Keywords

Comments

a(n) is the first number of the form ((n-2)*k^2 - (n-4)*k)/2 for k >= 0 that is in A024675.
a(n) = n if n is in A024675.

Examples

			a(5) = 12 because 12 = A000326(3) is a pentagonal number and is the average of consecutive primes 11 and 13, and neither of the previous pentagonal numbers (1 and 5) are averages of consecutive primes.
		

Crossrefs

Programs

  • Maple
    f:= proc(s) local n,x;
       for n from 1 do
         x:= ((s-2)*n^2 - (s-4)*n)/2;
         if x >= 4 and not isprime(x) and prevprime(x) + nextprime(x) = 2*x then return x fi
       od
    end proc:
    map(f, [$3..100]);
Previous Showing 11-20 of 20 results.