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 13 results. Next

A302334 A weighted smoothing applied to the primes as a data set: a(n) = floor(A007443(2n-1)/2^(2n-2)), where A007443 is binomial transform of primes.

Original entry on oeis.org

2, 3, 5, 7, 10, 13, 16, 20, 24, 28, 32, 36, 40, 44, 48, 53, 57, 61, 66, 70, 75, 79, 84, 89, 94, 98, 103, 108, 113, 119, 124, 129, 135, 140, 146, 151, 156, 162, 167, 172, 178, 183, 189, 194, 200, 205, 211, 216, 222, 228, 233, 239, 244, 250, 255, 261, 267, 273, 278, 284
Offset: 1

Views

Author

Peter Munn, Apr 05 2018

Keywords

Comments

a(n) is the weighted average of the first 2n - 1 primes, using row 2n - 2 of Pascal's triangle as weights, with the result rounded down. a(n) is thus based on the longest ordered list of consecutive primes that has prime(n) in the central position, while giving substantially greater weight to the primes near prime(n).
A guiding aim when framing the definition was having the arithmetic mean of the first k terms close to the arithmetic mean of the first k primes. In this respect, a simplified analysis suggested the binomial weighting might perform equally well for large k as small k, and empirical results were encouraging. For all k <= 500 the difference between the means is < 0.541, with 0.5 being exceeded only for 394 <= k <= 401. (These figures become not quite as good if floor rounding is replaced by nearest-integer, though a rounding midway between the two does better than either.)
The early terms (playing the role of primes) correspond closely to A053620 (in the role of primepi function), but the correspondence gets better if nearest-integer rounding is used instead of the floor rounding used here. - Peter Munn, Feb 26 2024
Conjecture: the second differences are in [-2,2].

Examples

			For n=3, we calculate a weighted average of the first 2n - 1 = 5 primes. Row 2n - 2 = 4 of Pascal's triangle, (1,4,6,4,1), provides the weights, and its row sum is 2^4 = 16.
Specifically, using the first formula, a(3) = floor( Sum_{k=0..4}(binomial(4,k)*prime(k+1)) / 2^4 ).
The sum in the formula = 1*prime(1) + 4*prime(2) + 6*prime(3) + 4*prime(4) + 1*prime(5) = 1*2 + 4*3 + 6*5 + 4*7 + 1*11 = 2 + 12 + 30 + 28 + 11 = 83.
So a(3) = floor(83/2^4) = floor(83/16) = 5.
Comparison with the primes: (Start)
Analysis table showing the difference between the start of this sequence and the start of the list of primes. a(n) is subtracted from prime(n) to give a sense of how prime(n) is lower or higher than it might be if the primes were more smoothly distributed. The column headed "cumulative" gives the partial sums of the previous column, which are then divided by n and rounded to 3 decimal places to give the final column. The final column therefore shows the difference between the arithmetic means of the first n primes and the first n terms of this sequence.
  n        prime(n)      a(n)    difference  cumulative average
   1           2           2          0          0       0.000
   2           3           3          0          0       0.000
   3           5           5          0          0       0.000
   4           7           7          0          0       0.000
   5          11          10          1          1       0.200
   6          13          13          0          1       0.167
   7          17          16          1          2       0.286
   8          19          20         -1          1       0.125
   9          23          24         -1          0       0.000
  10          29          28          1          1       0.100
  11          31          32         -1          0       0.000
  12          37          36          1          1       0.083
  13          41          40          1          2       0.154
  14          43          44         -1          1       0.071
  15          47          48         -1          0       0.000
  16          53          53          0          0       0.000
  17          59          57          2          2       0.118
  18          61          61          0          2       0.111
  19          67          66          1          3       0.158
  20          71          70          1          4       0.200
  21          73          75         -2          2       0.095
  22          79          79          0          2       0.091
  23          83          84         -1          1       0.043
  24          89          89          0          1       0.042
  25          97          94          3          4       0.160
  26         101          98          3          7       0.269
  27         103         103          0          7       0.259
  28         107         108         -1          6       0.214
  29         109         113         -4          2       0.069
  30         113         119         -6         -4      -0.133
  31         127         124          3         -1      -0.032
  32         131         129          2          1       0.031
(End)
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Floor[ Sum[ Binomial[2n -2, k]*Prime[k +1]/2^(2n -2), {k, 0, 2n -2}]]; Array[a, 60] (* Robert G. Wilson v, Jun 10 2018 *)
  • PARI
    a(n) = floor(sum(k=0, 2*n-2, (binomial(2*n-2,k) * prime(k+1))/2^(2*n-2))); \\ Michel Marcus, Aug 21 2018

Formula

a(n) = floor(Sum_{k=0..2n-2} (binomial(2n-2,k) * prime(k+1))/2^(2n-2)).
a(n) = floor(A007443(2n-1)/2^(2n-2)).

Extensions

a(51)-a(60) from Robert G. Wilson v, Jun 10 2018

A287915 Indices of primes in A007443.

Original entry on oeis.org

1, 2, 3, 5, 9, 22, 25, 28, 32, 41, 99, 104, 138, 183, 225, 361, 641, 1636, 1719, 3191, 3590, 4144, 5340, 6372, 6893, 6915, 8429, 10024, 10546, 16401, 21636, 22612, 24813, 31416, 36065
Offset: 1

Views

Author

M. F. Hasler, Jun 02 2017

Keywords

Comments

Sequence A007443, the binomial transform of the primes A000040, is defined as A007443(n) = Sum_{k=1..n} binomial(n-1,k-1)*prime(k). This is also the first column of the infinite square array T(m,n) with T(1,n) = prime(n) and T(m+1,n) = T(m,n) + T(m,n+1), as for binomial coefficients. Successive rows result from applying this operation of taking the sum of successive terms. So it would be more natural to use index 0 for the first term of this sequence (which is also the only even term, and results from applying the operation 0 times to the primes). This would yield the sequence 0, 1, 2, 4, 8, 21, 24, 27, 31, 40, 98, 103, 137, 182, ...
The next term, if it exists, is greater than 20000. - Vaclav Kotesovec, Dec 19 2020
Any subsequent terms are > 10^5. - Lucas A. Brown, Mar 18 2024

Crossrefs

Cf. A007443.

Programs

  • Mathematica
    A007443 = Table[Sum[Binomial[n-1, k-1]*Prime[k], {k, 1, n}], {n, 1, 1000}]; Select[Range[Length[A007443]], PrimeQ[A007443[[#]]]&] (* Vaclav Kotesovec, Dec 19 2020 *)
  • PARI
    for(n=1,199,isprime(A007443(n))&&print1(n","))

Extensions

a(18)-a(22) from Jinyuan Wang, Dec 19 2020
a(23)-a(30) from Vaclav Kotesovec, Dec 19 2020
a(31)-a(35) from Lucas A. Brown, Mar 18 2024

A096280 Primes in A007443 (= binomial transform of primes).

Original entry on oeis.org

2, 5, 13, 83, 2707, 71475193, 674721797, 6245693407, 118543624847, 82736199371081, 72298621492552303967009812018997, 2454725173623452943975951834280921, 59966692897276736774965300014477948187539553
Offset: 1

Views

Author

Cino Hilliard, Jun 23 2004

Keywords

Comments

Sum of reciprocals = 0.2893406979695919267175673140... Are these primes infinite?
The next term is too large to be displayed here. See A287915 for the indices k which yield these primes A007443(k). - M. F. Hasler, Jun 02 2017

Crossrefs

See A287915 for the corresponding indices of A007443.

Programs

  • Mathematica
    A007443[n_]:=Sum[Binomial[n-1,k-1]Prime[k],{k,n}];
    With[{upto=500},Select[Array[A007443,upto],PrimeQ]] (* or *)
    Module[{upto=500,b},b=Prime[Range[upto]];Join[{2},Select[Table[First[b=ListConvolve[{1,1},b]],upto-1],PrimeQ]]] (* Paolo Xausa, Oct 31 2023 *)
  • PARI
    \\ n = terms to add, m = order.
    sucsumspr(n,m) = { local(a,b,i,j,k,sr); sr=0; a = primes(1001); b = vector(1001); for(i=1,m, for(j=1,n+n, b[j] = a[j]+ a[j+1]; ); a=b; if(isprime(a[1]),print1(a[1]",");sr+=1.0/a[1]); ); print(); print(sr); }
    
  • PARI
    for(n=1,999, ispseudoprime(A007443(n))&&print1(A007443(n)",")) \\ M. F. Hasler, Jun 02 2017

Formula

a(n) = A007443(A287915(n)). - M. F. Hasler, Jun 02 2017

Extensions

Definition corrected, initial term 2 added, and edited by M. F. Hasler, Jun 02 2017
Name simplified by Paolo Xausa, Nov 05 2023

A007442 Inverse binomial transform of primes.

Original entry on oeis.org

2, 1, 1, -1, 3, -9, 23, -53, 115, -237, 457, -801, 1213, -1389, 445, 3667, -15081, 41335, -95059, 195769, -370803, 652463, -1063359, 1570205, -1961755, 1560269, 1401991, -11023119, 36000427, -93408425, 214275735, -450374071, 879254493, -1599245737, 2695465017
Offset: 1

Views

Author

Keywords

Comments

a(n) is the (n-1)-st difference of the first n primes. Although the magnitude of the terms appears to grow exponentially, a plot shows that the sequence a(n)/2^n has quite a bit of structure. See A082594 for an interesting application. - T. D. Noe, May 09 2003
Graph this divided by A122803 using plot2! - Franklin T. Adams-Watters
From Robert G. Wilson v, Jan 28 2020: (Start)
a(n) is odd for all n>1.
As opposed to A331573, there are terms where abs(a(n)) >= abs(a(n+1)). (End)

Examples

			a(4) = 7 - 3*5 + 3*3 - 2 = -1.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Diff[lst_List] := Table[lst[[i + 1]] - lst[[i]], {i, Length[lst] - 1}]; n=1000; dt = Prime[Range[n]]; a = Range[n]; a[[1]] = 2; Do[dt = Diff[dt]; a[[i]] = dt[[1]], {i, 2, n}]; a
    u = Table[Prime[Range[k]], {k, 1, 100}];Flatten[Table[Differences[u[[k]], k - 1], {k, 1, 100}]] (* Clark Kimberling, May 15 2015 *)
    t = Array[Prime, 30]; f[x_] := Rest[x] - Most[x];
    Flatten[Last /@ (NestList[f, t[[1 ;; #]], (# - 1)] & /@ Range[1, 29])] (* Horst H. Manninger, Mar 22 2021 *)
  • PARI
    vector(50, n, sum(k=0, n-1,(-1)^(n-k-1)*binomial(n-1, k)*prime(k+1))) \\ Altug Alkan, Oct 17 2015

Formula

a(n) = Sum_{k=0..n-1} (-1)^(n-k-1) binomial(n-1, k) prime(k+1).
a(n) = A095195(n,n-1). - Alois P. Heinz, Sep 25 2013
G.f.: Sum_{k>=1} prime(k)*x^k/(1 + x)^k. - Ilya Gutkovskiy, Apr 23 2019

Extensions

Incorrect conjecture concerning the sign of even terms removed by Glen Whitney, Nov 10 2024

A096279 Sums of successive sums of successive sums of successive sums of successive primes.

Original entry on oeis.org

83, 122, 168, 216, 264, 316, 378, 446, 514, 582, 644, 700, 766, 846, 924, 994, 1062, 1126, 1188, 1258, 1340, 1434, 1528, 1602, 1656, 1704, 1764, 1860, 1984, 2094, 2178, 2260, 2348, 2432, 2514, 2598, 2682, 2766, 2848, 2932, 3018, 3090, 3152, 3242, 3378
Offset: 1

Views

Author

Cino Hilliard, Jun 22 2004

Keywords

Comments

The first term is always odd and may be prime. The first terms of more and more successions produce A007443.

Examples

			2 3 5 7 11 successive primes
5 8 12 18 sums of successive primes
13 20 30 sums of successive sums of successive primes
33 50 sums of successive sums of successive sums of successive primes
83 sums of successive sums of successive sums of successive sums of successive primes
		

Crossrefs

Programs

  • Mathematica
    Nest[ListConvolve[{1,1},#]&,Prime[Range[100]],4] (* Paolo Xausa, Oct 31 2023 *)
  • PARI
    \\ Iterated successive sums of successive sums... of successive primes.
    \\ Input number of terms n and the order m. m=0 yields the primes.
    sucsums(n, m) = { my(a, b, i, j, k); a = primes(n+m); b = vector(#a); for(i=1, m, for(j=1, n+m-i, b[j] = a[j]+ a[j+1]; ); a=b; ); for(k=1, n, print1(a[k], ", "); ) }

A111107 Lexicographically smallest increasing sequence of primes whose binomial transform consists only of primes.

Original entry on oeis.org

2, 3, 5, 11, 13, 29, 43, 53, 59, 71, 79, 83, 103, 113, 139, 173, 181, 227, 269, 277, 317, 383, 463, 509, 673, 701, 751, 863, 967, 977, 1187, 1201, 1493, 1531, 1609, 1637, 1801, 2153, 2221, 2239, 2371, 2377, 2543, 2557, 2683, 2687, 2791, 2837, 3067, 3229, 3257
Offset: 0

Views

Author

Daniel Joyce, Oct 14 2005

Keywords

Comments

In the standard binomial transform of the primes most of the terms are composite.

Examples

			The binomial transform of this sequence gives: 2, 5, 13, 37, 101, 271, 727, 1931, 5003, 12547, 30449, 71761, ... = A384676.
The prime 7 and various larger primes are missing from the new sequence because the transform would not consist of primes. For example,
  2,5,13,33
  3,8,20
  5,12
  7
and 33 is not prime, so we must eliminate 7.
		

Crossrefs

Formula

a(n) = Sum_{i=0..n} A384676(n-i)*binomial(n,i)*(-1)^i. - Alois P. Heinz, Jun 06 2025

Extensions

Offset set to 0 by Alois P. Heinz, Jun 06 2025

A164738 Triangle read by rows. Row 0 = {2}; left half of row n+1 = row n, right half = row n reversed with each term replaced by the next prime.

Original entry on oeis.org

2, 2, 3, 2, 3, 5, 3, 2, 3, 5, 3, 5, 7, 5, 3, 2, 3, 5, 3, 5, 7, 5, 3, 5, 7, 11, 7, 5, 7, 5, 3, 2, 3, 5, 3, 5, 7, 5, 3, 5, 7, 11, 7, 5, 7, 5, 3, 5, 7, 11, 7, 11, 13, 11, 7, 5, 7, 11, 7, 5, 7, 5, 3, 2, 3, 5, 3, 5, 7, 5, 3, 5, 7, 11, 7, 5, 7, 5, 3, 5, 7, 11, 7, 11, 13, 11, 7, 5, 7, 11, 7, 5, 7, 5, 3, 5, 7, 11, 7
Offset: 0

Views

Author

Gary W. Adamson, Aug 23 2009

Keywords

Comments

Row n has 2^n terms.
Row sums = (2, 5, 13, 33, 83, 205, 495,...) = A007443, the binomial transform of the primes.

Examples

			The triangle begins:
  2;
  2, 3;
  2, 3, 5, 3;
  2, 3, 5, 3, 5, 7, 5, 3;
  2, 3, 5, 3, 5, 7, 5, 3, 5, 7, 11, 7, 5, 7, 5, 3;
  ...
		

Crossrefs

Programs

  • Mathematica
    Flatten[NestList[Join[ #, NextPrime[Reverse[ # ]]] &, {2}, 7]] (* Zak Seidov, Aug 24 2009 *)

Extensions

More terms from Zak Seidov, Aug 24 2009
Edited by Zak Seidov and N. J. A. Sloane, Aug 25 2009
Offset 0 from Alois P. Heinz, Oct 31 2023

A178167 Binomial transform of odd primes.

Original entry on oeis.org

3, 8, 20, 50, 122, 290, 674, 1538, 3462, 7720, 17104, 37708, 82768, 180880, 393488, 851914, 1835470, 3935808, 8402158, 17865738, 37858268, 79991512, 168605710, 354649382, 744605426, 1560666296, 3265699888, 6822355756, 14229565634
Offset: 1

Views

Author

Keywords

Comments

03 05 07 11 13 08 12 18 24 20 30 42 50 72 122

Crossrefs

First differences of A007443.

Programs

  • Mathematica
    q=33;lst=Prime[Range[2,q]]; lst1={First[lst]};Do[lst=Table[Abs[lst[[n]]+lst[[n+1]]],{n,1,Length[lst]-1}];AppendTo[lst1,First[lst]],{k,q-2}];lst1
    Differences[Table[Sum[Binomial[n-1, k-1]*Prime[k], {k, 1, n}], {n, 1, 30}]] (* Vaclav Kotesovec, Dec 19 2020 *)

A333176 a(n) = Sum_{k=1..n} (binomial(n,k) mod 2) * prime(k).

Original entry on oeis.org

2, 3, 10, 7, 20, 23, 58, 19, 44, 51, 112, 63, 140, 151, 328, 53, 114, 117, 250, 131, 276, 287, 604, 161, 342, 355, 742, 383, 798, 825, 1720, 131, 270, 273, 566, 289, 596, 607, 1252, 323, 664, 675, 1392, 711, 1458, 1481, 3046, 407, 832, 839, 1718, 875, 1782
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 10 2020

Keywords

Crossrefs

Programs

  • Maple
    N:= 200: # for a(1) .. a(N)
    P:= [seq(ithprime(i),i=1..N)]:
    B:= [1,1]: R:= 2:
    for n from 2 to N do
      B:= [1,op(B[2..-1]+B[1..-2] mod 2),1];
      R:= R, convert(P[select(t -> B[t+1] = 1,[$1..n])],`+`);
    od:
    R; # Robert Israel, Jan 29 2025
  • Mathematica
    Table[Sum[Mod[Binomial[n, k], 2] Prime[k], {k, 1, n}], {n, 1, 53}]
  • PARI
    a(n) = sum(k=1, n, if (binomial(n, k) % 2, prime(k))); \\ Michel Marcus, Mar 10 2020
    
  • Python
    from sympy import prime
    def A333176(n): return sum(prime(k) for k in range(1,n+1) if not ~n&k) # Chai Wah Wu, Jul 22 2025

Formula

Sum_{k=1..n} (-1)^A010060(n-k) * (binomial(n,k) mod 2) * a(k) = prime(n).

A287919 Square array T(0,n) = prime(n) and T(m+1,n) = T(m,n) + T(m,n+1), m >= 0, n >= 1, read by falling antidiagonals.

Original entry on oeis.org

2, 3, 5, 5, 8, 13, 7, 12, 20, 33, 11, 18, 30, 50, 83, 13, 24, 42, 72, 122, 205, 17, 30, 54, 96, 168, 290, 495, 19, 36, 66, 120, 216, 384, 674, 1169, 23, 42, 78, 144, 264, 480, 864, 1538, 2707, 29, 52, 94, 172, 316, 580, 1060, 1924, 3462, 6169
Offset: 0

Views

Author

M. F. Hasler, Jun 02 2017

Keywords

Examples

			The array starts:
[0]    2    3    5     7    11    13    17    19    23    29 ... (A000040)
[1]    5    8   12    18    24    30    36    42    52    60 ... (A001043)
[2]   13   20   30    42    54    66    78    94   112   128 ... (A096277)
[3]   33   50   72    96   120   144   172   206   240   274 ... (A096278)
[4]   83  122  168   216   264   316   378   446   514   582 ... (A096279)
[5]  205  290  384   480   580   694   824   960  1096  1226 ...
[6]  495  674  864  1060  1274  1518  1784  2056  2322  2570 ...
[7] 1169 1538 1924  2334  2792  3302  3840  4378  4892  5380 ...
...
First column is A007443: binomial transform of primes.
Second column is A178167: binomial transform of odd primes.
		

Crossrefs

Rows and columns include A001043, A096277-A096279, A007443, A178167.

Programs

  • Mathematica
    A287919list[dmax_]:=With[{a=Reverse[NestList[ListConvolve[{1,1},#]&,Prime[Range[dmax]],dmax-1]]},Array[Reverse[Diagonal[a,#]]&,dmax,1-dmax]];
    A287919list[10] (* Generates 10 antidiagonals *) (* Paolo Xausa, Oct 31 2023 *)
  • PARI
    A287919(m,n)=sum(k=0,m,prime(n+k)*binomial(m,k))
    /* read by antidiagonals */ for(m=0,13,for(n=0,m,print1(A287919(n,m-n+1)",")))
Showing 1-10 of 13 results. Next