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 81-90 of 101 results. Next

A162735 An alternating sum of all numbers from prime(n) to prime(n+1).

Original entry on oeis.org

1, 4, 6, 9, 12, 15, 18, 21, 26, 30, 34, 39, 42, 45, 50, 56, 60, 64, 69, 72, 76, 81, 86, 93, 99, 102, 105, 108, 111, 120, 129, 134, 138, 144, 150, 154, 160, 165, 170, 176, 180, 186, 192, 195, 198, 205, 217, 225, 228, 231, 236, 240, 246, 254, 260, 266, 270, 274, 279
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 13 2009

Keywords

Comments

Without the initial term, identical to A024675, cf. formula. Except for the initial terms, also the same as A162800. - M. F. Hasler, Jun 01 2013

Examples

			a(1) = 1 = -2+3. a(2) = 4=3-4+5. a(3) = 6 =5-6+7. a(4) = 9 = 7-8+9-10+11.
		

Crossrefs

Programs

  • Mathematica
    Join[{1}, Most[#] + Differences[#]/2] & [Prime[Range[2, 100]]] (* Paolo Xausa, Jun 17 2024 *)

Formula

a(n) = sum_{j= A000040(n).. A000040(n+1)} (-1)^(j+1)*j = A001057(A000040(n+1))-A001057(A000040(n)-1).
{1} U A024675.

Extensions

Edited by R. J. Mathar, Sep 23 2009

A187026 Least m such that prime(n) divides (prime(m) + prime(m+1))/2.

Original entry on oeis.org

2, 3, 6, 8, 25, 9, 11, 21, 19, 69, 24, 29, 46, 23, 60, 115, 51, 111, 32, 82, 129, 185, 132, 71, 106, 155, 63, 116, 84, 203, 54, 77, 58, 145, 108, 87, 289, 93, 67, 443, 254, 460, 292, 76, 350, 300, 447, 86, 397, 124, 284, 808, 128, 335, 136
Offset: 1

Views

Author

Vladimir Shevelev, Mar 02 2011

Keywords

Examples

			a(1) = 2 because prime(1)=2 divides (prime(2)+prime(3))/2 = (3+5)/2 = 4.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local m, pn; pn:= ithprime(n);
          for m from n+1 while not irem((ithprime(m)+ithprime(m+1))/2, pn)=0
          do od; m
        end:
    seq(a(n), n=1..80);  # Alois P. Heinz, Mar 02 2011
  • Mathematica
    leastM[n_]:=Module[{m=1},While[!Divisible[(Prime[m]+Prime[m+1])/2,n],m++];m]; leastM/@Prime[Range[60]] (* Harvey P. Dale, Mar 04 2011 *)

A205881 Second pentagonal numbers that are interprime.

Original entry on oeis.org

15, 26, 260, 495, 610, 950, 1190, 1962, 2420, 2667, 3197, 3337, 3480, 6370, 7597, 14455, 15965, 18205, 39447, 42926, 43947, 50325, 57135, 63140, 64377, 65000, 66255, 74037, 78090, 82251, 86520, 87967, 106267, 107870, 121980, 125426, 136957, 140607, 153760
Offset: 1

Views

Author

Zak Seidov, Feb 01 2012

Keywords

Comments

Intersection of A005449 and A024675. Also see references in A075190 about interprimes of different forms.

Examples

			a(1) = 15 = A024675(5) = A005449(3).
a(2) = 26 = A024675(8) = A005449(4).
		

Crossrefs

Programs

  • Mathematica
    Select[Mean/@Partition[Prime[Range[15000]],2,1],IntegerQ[(Sqrt[1+24#]-1)/6]&] (* Harvey P. Dale, Feb 02 2020 *)

A226109 Triangular numbers t such that t - 4, t - 2, t + 2, t + 4 are four primes.

Original entry on oeis.org

15, 105, 1485, 18915, 666435, 2143485, 4174605, 10059855, 10440165, 28196295, 95295915, 124591005, 155064855, 171023265, 206258205, 298400235, 311737965, 347701635, 389470095, 459332895, 460424685, 498948255, 526517475, 537575655, 615496155, 645500415, 885763005, 963144105
Offset: 1

Views

Author

Alex Ratushnyak, May 26 2013

Keywords

Comments

Subsequence of A129752.
Proper subsequence of A226196. - Alex Ratushnyak, May 30 2013

Crossrefs

Programs

  • Java
    import java.math.BigInteger;
    public class A226109 {
        public static void main (String[] args) {
          for (long n = 1; n < (1L << 31); n++) {
              long p2 = n * (n + 1)/2 + 2, m2 = p2 - 4;
              BigInteger b = BigInteger.valueOf(p2);
              if (!b.isProbablePrime(80)) continue;
              b = BigInteger.valueOf(m2);
              if (!b.isProbablePrime(80)) continue;
              b = BigInteger.valueOf(p2 + 2);
              if (!b.isProbablePrime(80)) continue;
              b = BigInteger.valueOf(m2 - 2);
              if (!b.isProbablePrime(80)) continue;
              System.out.printf("%d, ", p2 - 2);
          }
        }
    }
    
  • Magma
    A000217:=func; [A000217(t): t in [0..10^5] | forall{A000217(t)+i: i in [-4,-2,2,4] | IsPrime(A000217(t)+i)}]; // Bruno Berselli, May 27 2013
  • Mathematica
    Select[Accumulate[Range[0, 70]], Union[PrimeQ[{# - 4, # - 2, # + 2, # + 4}]] == {True} &] (* Alonso del Arte, May 27 2013 *)

A265684 Sarrus numbers (A001567) that are the average of two consecutive primes.

Original entry on oeis.org

645, 7957, 11305, 15841, 25761, 35333, 126217, 194221, 212421, 332949, 464185, 635401, 656601, 741751, 934021, 1193221, 1357441, 1459927, 1620385, 1690501, 1969417, 2704801, 3911197, 4154161, 4209661, 5095177, 5284333, 5351537, 5758273, 6189121, 6212361, 7820201, 8134561, 8209657
Offset: 1

Views

Author

Altug Alkan, Dec 13 2015

Keywords

Comments

Inspired by A265669.
Motivation was the form of differences between consecutive primes that generate this sequence. It seems that 12*k appears in differences most of the time. For the first 175 term of this sequence, the relevant proportion is 161/175.
Differences between corresponding consecutive primes are 4, 12, 12, 36, 4, 12, 12, 36, 4, 4, 24, 24, 4, 60, 24, 24, 24, 12, 12, 36, 12, 24, 12, 24, 36, 12, 12, 12, 12, 24, 4, 60, 24, 48, 36, 12, 24, 36, 24, 20, 12, 84, 36, 12, 24, 24, 12, 24, 36, 12, 12, 36, ...

Examples

			645 is a term because it is a Sarrus number and the average of the consecutive primes 643 and 647.
7957 is a term because it is a Sarrus number and the average of the consecutive primes 7951 and 7963.
		

Crossrefs

Intersection of A001567 and A024675.
Cf. A265669.

Programs

  • Mathematica
    Select[Range[200000], CompositeQ[#] && PowerMod[2, (# - 1), #] == 1 && NextPrime[#] - # == # - NextPrime[#, -1] &] (* Amiram Eldar, Jun 28 2019 *)
  • PARI
    is(n)={Mod(2, n)^n==2 && !isprime(n)}
    forcomposite(n=2, 1e7, if(is(n) && (nextprime(n)-n)==(n-precprime(n)), print1(n, ", ")))

A267896 a(n) = (Prime(n+1)^2 - Prime(n)^2) / 8.

Original entry on oeis.org

2, 3, 9, 6, 15, 9, 21, 39, 15, 51, 39, 21, 45, 75, 84, 30, 96, 69, 36, 114, 81, 129, 186, 99, 51, 105, 54, 111, 420, 129, 201, 69, 360, 75, 231, 240, 165, 255, 264, 90, 465, 96, 195, 99, 615, 651, 225, 114, 231, 354, 120, 615, 381, 390, 399, 135, 411, 279
Offset: 2

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [(NthPrime(n+1)^2-NthPrime(n)^2) div 8: n in [2..60]]; // Vincenzo Librandi, Jan 23 2016
  • Maple
    seq((ithprime(n+1)^2 - ithprime(n)^2)/8, n=2..100); # Robert Israel, Jan 22 2016
  • Mathematica
    Rest[Array[(Prime[# + 1]^2 - Prime[#]^2) / 8 &, 60]] (* Vincenzo Librandi, Jan 23 2016 *)
    (#[[2]]-#[[1]])/8&/@Partition[Prime[Range[2,60]]^2,2,1] (* Harvey P. Dale, Aug 01 2022 *)
  • PARI
    a(n) = (prime(n+1)^2 - prime(n)^2)/8; \\ Michel Marcus, Jan 22 2016
    

Formula

a(n) = A024675(n) * A028334(n) / 2.
a(n) = (A000040(n+1)^2 - A000040(n)^2) / 8.
a(n) = A069482(n) / 8.

A270696 Perfect powers that are the average of two consecutive primes.

Original entry on oeis.org

4, 9, 64, 81, 144, 225, 324, 441, 625, 1089, 1681, 1728, 2601, 3600, 4096, 5184, 6084, 8464, 12544, 13689, 16641, 17576, 19044, 19600, 21952, 25281, 27225, 28224, 29584, 36864, 38025, 39204, 45369, 46656, 47524, 51984, 56169, 74529, 87025, 88804, 91809, 92416, 95481
Offset: 1

Views

Author

Altug Alkan, Mar 21 2016

Keywords

Comments

The corresponding lesser primes are in A242380. - Michel Marcus, Mar 23 2016

Examples

			1728 is a term because 1728 = 12^3 = (1723 + 1733)/2.
		

Crossrefs

Programs

  • Mathematica
    Select[Mean/@Partition[Prime[Range[10000]],2,1],GCD@@FactorInteger[#][[All,2]]>1&] (* Harvey P. Dale, Jun 22 2022 *)
  • PARI
    for(n=2, 1e5, if((nextprime(n) - n) == (n - precprime(n)) && ispower(n), print1(n, ", ")));
    
  • PARI
    list(lim)=my(v=List(),t); forprime(e=2,logint(lim\=1,2), for(m=2,sqrtnint(lim,e), t=m^e; if(t-precprime(t)==nextprime(t)-t, listput(v,t)))); Set(v) \\ Charles R Greathouse IV, Mar 21 2016

A287943 T(1, c) = prime(c). T(r + 1, c) = (T(r, c') + T(r, c'+1)) / 2 where c' is the c-th number such that T(r, c') + T(r, c'+1) is even. Table for T read downwards by antidiagonals.

Original entry on oeis.org

2, 3, 4, 5, 6, 5, 7, 9, 28, 30, 11, 12, 32, 60, 45, 13, 15, 53, 68, 64, 97, 17, 18, 58, 85, 130, 223, 160, 19, 21, 62, 116, 193, 322, 558, 359, 23, 26, 74, 144, 208, 401, 868, 713, 536, 29, 30, 96, 165, 238, 540, 957, 1180, 1553, 2866, 31, 34, 136, 186, 265, 576, 1403
Offset: 1

Views

Author

Zak Seidov and Robert G. Wilson v, Jun 03 2017

Keywords

Comments

This array has the same idea as Gilbreath's conjecture (see A036262) but instead of absolute difference it is the integer average sum.

Examples

			Row
1:           2          3          5          7         11         13         17
2:           4          6          9         12         15         18         21
3:           5         28         32         53         58         62         74
4:          30         60         68         85        116        144        165
5:          45         64        130        193        208        238        265
6:          97        223        322        401        540        576        765
7:         160        558        868        957       1403       1531       1598
8:         359        713       1180       1467       1639       1808       3131
9:         536       1553       4179       5178       6335       7865       9274
10:       2866       7100      14023      14900      15838      17837      20121
11:       4983      15369      18979      22054      28390      43704      47511
12:      10176      17174      25222      36047      60602      87739     120599
13:      13675      21198     104169     155638     193710     201367     223740
14:     174674     271986     372056     479130     542177     553224     581451
15:     223330     322021     425593     590611     650029     807687     924065
16:     373807     508102     620320     728858     865876    1094922    1133312
17:     564211     674589     797367     980399    1114117    1378160    2055687
18:     619400     735978     888883    1047258    3000375    4135480    5526718
19:     677689    4831099    5819401    7119393    7743933    8367375    9362587
20:    2754394    5325250    6469397    7431663    8055654    8864981   14204980
21:    4039822    6950530   36789607   41026156   43928115   47881364   50592342
22:    5495176   49236853   51408848   61276421   64658379   88092051   96453019
23:   62967400   76375215   92272535  119006122  209296919  261901315  310000824
24:   84323875  235599117  316302735  400483922  497171955  515469235  524697491
25:  159961496  275950926  506320595  520083363  555977282  619254662  638646183
26:  217956211  513201979  587615972  647540001  684757327  812990322 1671545118
27:  365579095  666148664 1242267720 1989912374 2194765721 2371664980 2708581740
28:  954208192 1616090047 2540123360 3262521514 3383785254 3840848685
29: 2901322437 3323153384
etc.
The 2nd row begins with 4, 6 and 9 since it is the integer average, 4 is the average between 3 and 5, six is the average between 5 and 7, and nine is the average between 7 and 11, etc.
		

Crossrefs

Programs

  • Mathematica
    t = NestList[Select[(Rest@# + Most@#)/2, IntegerQ] &, Prime@ Range@ 1100, 10]; Table[ t[[n -k +1, k]], {n, 11}, {k, n, 1, -1}] // Flatten

A354682 Interprimes that are products of two successive primes.

Original entry on oeis.org

6, 15, 667, 1517, 9797, 123197, 233273, 522713, 627239, 826277, 974153, 988027, 1127843, 1162003, 1209991, 2624399, 2637367, 3493157, 4235339, 4384811, 4460543, 6827753, 7784099, 10916407, 11370383, 17065157, 25009997, 26347493, 29964667, 32330587, 32387477, 33419957, 34809991, 35354867, 37088099
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jun 03 2022

Keywords

Comments

Numbers that are both the average of two successive primes and the product of two successive primes.
Includes p*(p+2) where p, p+2,p^2+2*p-6 and p^2+2*p+6 are all primes but p^2+2*p-2, p^2+2*p-4, p^2+2*p+2 and p^2+2*p+4 are composite. The Generalized Bunyakovsky Conjecture implies there are infinitely many such terms.

Examples

			a(3) = 667 is a term because 667 = (661 + 673)/2 = 23*29 where 661 and 673 are successive primes and 23 and 29 are successive primes.
		

Crossrefs

Intersection of A006094 and A024675. Cf. A174955.

Programs

  • Maple
    R:= NULL: count:= 0:
    q:= 2:
    while count < 50 do
      p:= q; q:= nextprime(q);
      r:= p*q;
      if prevprime(r)+nextprime(r)=2*r then
        R:= R, r; count:= count+1;
      fi
    od:
    R;
  • Mathematica
    Select[Table[Prime[n]*Prime[n + 1], {n, 1, 800}], Plus @@ NextPrime[#, {-1, 1}] == 2*# &] (* Amiram Eldar, Jun 03 2022 *)
    Select[Times@@@Partition[Prime[Range[1000]],2,1],(NextPrime[#]+NextPrime[#,-1])/2==#&] (* Harvey P. Dale, Nov 03 2024 *)

A355849 a(n) is the least k > 1 such that k*n is the average of two consecutive primes.

Original entry on oeis.org

4, 2, 2, 3, 3, 2, 3, 7, 2, 3, 9, 5, 2, 3, 2, 4, 2, 4, 4, 3, 2, 7, 3, 3, 2, 10, 3, 2, 12, 2, 3, 2, 3, 3, 3, 2, 3, 2, 5, 3, 5, 10, 2, 4, 4, 3, 6, 3, 9, 3, 2, 5, 12, 2, 3, 10, 4, 6, 4, 2, 10, 3, 5, 3, 3, 3, 2, 8, 2, 6, 6, 2, 10, 5, 2, 3, 2, 4, 14, 2, 4, 3, 9, 5, 2, 12, 4, 2, 4, 2, 12, 6, 2, 3, 6, 2
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jul 28 2022

Keywords

Comments

a(n) is the least k > 1 such that k*n is in A024675.

Examples

			a(4) = 3 because 3*4 = 12 is the average of consecutive primes 11 and 13.
		

Crossrefs

Cf. A024675.

Programs

  • Maple
    M:= {seq((ithprime(i)+ithprime(i+1))/2, i=2..10^5)}:
    f:= proc(p) local k;
      for k from 2 do if member(k*p,M) then return k fi od
    end proc:
    map(f, [$1..100]);
  • Mathematica
    a[n_] := Module[{m = 2*n}, While[Plus @@ NextPrime[m, {-1, 1}] != 2*m, m += n]; m/n]; Array[a, 100] (* Amiram Eldar, Aug 05 2022 *)
Previous Showing 81-90 of 101 results. Next