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-8 of 8 results.

A138042 Numbers k such that A096379(k)=A096379(k+1).

Original entry on oeis.org

2, 7, 13, 19, 49, 69, 116, 182, 206, 225, 229, 236, 253, 265, 288, 315, 324, 352, 379, 390, 394, 435, 492, 497, 542, 551, 567, 625, 643, 658, 718, 754, 794, 920, 930, 935, 958, 966, 988, 1025, 1032, 1085, 1101, 1128, 1155, 1171, 1173, 1225, 1235, 1249
Offset: 1

Views

Author

Zak Seidov, Mar 02 2008

Keywords

Comments

Numbers k such that prime(k)=2*prime(k+2)-prime(k+3).

Examples

			n=2: {prime(n), 2*prime(n+2)-prime(n+3)}={3,2*7-11},
n=7: {prime(7), 2*prime(9)-prime(10)}={17,2*23-29},
n=13: {prime(13), 2*prime(15)-prime(16)}={41,2*47-53},
n=19: {prime(19), 2*prime(21)-prime(22)}={67,2*73-79}.
		

Crossrefs

Programs

  • Mathematica
    Do[If[Prime[n]==2Prime[n+2]-Prime[n+3],Print[n]],{n,1,50000}]
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A138042 (MATCHING-POS 1 1 (lambda (n) (= 2 (/ (+ (A000040 n) (A000040 (+ n 3))) (A000040 (+ n 2)))))))

Formula

a(n) = A066495(n) - 2.

Extensions

Formula corrected by Antti Karttunen, Jul 13 2013

A191472 a(n) = 2*prime(n+2) - prime(n+1) - prime(n).

Original entry on oeis.org

5, 6, 10, 8, 10, 8, 10, 16, 10, 14, 14, 8, 10, 16, 18, 10, 14, 14, 8, 14, 14, 16, 22, 16, 8, 10, 8, 10, 32, 22, 16, 10, 22, 14, 14, 18, 14, 16, 18, 10, 22, 14, 10, 8, 26, 36, 20, 8, 10, 16, 10, 22, 22, 18, 18, 10, 14, 14, 8, 22, 38, 22, 8, 10, 32, 26, 26, 14
Offset: 1

Views

Author

Zak Seidov, Aug 27 2012

Keywords

Comments

For n > 2, all terms >= 8 and all even integers are possible except for 12.

Examples

			a(1) = 2*prime(3) - prime(2) - prime(1) = 2*5 - 3 - 2 = 5.
		

Crossrefs

Cf. A096379.

Programs

  • Mathematica
    ps = Prime[Range[100]]; Table[2*ps[[n+2]] - ps[[n+1]] - ps[[n]], {n, Length[ps] - 2}] (* T. D. Noe, Aug 27 2012 *)
    2#[[3]]-#[[2]]-#[[1]]&/@Partition[Prime[Range[70]],3,1] (* Harvey P. Dale, Aug 10 2023 *)
    ListConvolve[{2, -1, -1}, Prime[Range[100]]] (* Paolo Xausa, Jul 30 2024 *)
  • PARI
    first(n)=my(v=vector(n),p=2,q=3,k); forprime(r=5,, if(k++>n, break); v[k]=2*r-q-p; p=q; q=r); v \\ Charles R Greathouse IV, Oct 03 2017

A098865 Primes of the form prime(n) + prime(n+1) - prime(n+2).

Original entry on oeis.org

5, 7, 11, 13, 23, 37, 41, 53, 73, 97, 101, 103, 109, 127, 137, 157, 179, 191, 223, 229, 251, 263, 269, 271, 307, 311, 353, 373, 389, 409, 419, 433, 457, 479, 487, 491, 503, 541, 563, 571, 593, 641, 647, 673, 683, 691, 701, 757, 809, 821, 853, 859, 863, 877
Offset: 1

Views

Author

Robert G. Wilson v, Nov 04 2004

Keywords

Comments

Many primes of this form arise in several different ways, e.g. 13, 37, 223, 1087, 1423, 1483, 1867, ..., . 13 = 17+19-23 = 19+23-29.

Crossrefs

Programs

  • Mathematica
    Union[ Select[ Table[Prime[n] + Prime[n + 1] - Prime[n + 2], {n, 155}], PrimeQ[ # ] &]]
    Union[Select[#[[1]]+#[[2]]-#[[3]]&/@ Partition[Prime[ Range[20000]], 3,1],PrimeQ]]  (* Harvey P. Dale, Mar 14 2011 *)

A375097 a(n) = prime(n+2) - (prime(n) + prime(n+1))/2.

Original entry on oeis.org

3, 5, 4, 5, 4, 5, 8, 5, 7, 7, 4, 5, 8, 9, 5, 7, 7, 4, 7, 7, 8, 11, 8, 4, 5, 4, 5, 16, 11, 8, 5, 11, 7, 7, 9, 7, 8, 9, 5, 11, 7, 5, 4, 13, 18, 10, 4, 5, 8, 5, 11, 11, 9, 9, 5, 7, 7, 4, 11, 19, 11, 4, 5, 16, 13, 13, 7, 5, 8, 11, 10, 9, 7, 8, 11, 8, 10, 14, 7, 11
Offset: 2

Views

Author

Hugo Pfoertner, Jul 30 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Array[#3 - (#1 + #2)/2 & @@ Prime[{#, # + 1, # + 2}] &, 80, 2] (* Michael De Vlieger, Jul 30 2024 *)
  • PARI
    a(n) = prime(n+2) - (prime(n) + prime(n+1))/2

A135275 a(n) = prime(2n-1) + prime(2n) - prime(2n+1).

Original entry on oeis.org

0, 1, 7, 13, 21, 27, 37, 41, 53, 65, 69, 75, 95, 101, 95, 121, 127, 143, 153, 161, 169, 187, 185, 207, 223, 231, 235, 251, 263, 275, 269, 305, 299, 321, 343, 345, 361, 373, 385, 391, 409, 425, 433, 445, 457, 459, 479, 493, 507, 517
Offset: 1

Views

Author

Cino Hilliard, Dec 02 2007

Keywords

Comments

Original name was: Sum and difference of staircase primes according to the rule: bottom + top - next top.

Crossrefs

Programs

  • Mathematica
    Table[Prime[n + 1] + Prime[n] - Prime[n + 2], {n, 1, 30}][[;; ;; 2]] (* G. C. Greubel, Oct 08 2016 *)
  • PARI
    g(n) = forstep(x=1,n,2,y=prime(x+1)+ prime(x)- prime(x+2);print1(y","))
    
  • PARI
    n=1; p=2; q=3; forprime(r=5,1e3, if(n, print1(p+q-r", ")); n=!n; p=q; q=r) \\ Charles R Greathouse IV, Oct 08 2016

Formula

We list the primes in staircase fashion as in A135274. The right diagonal, RD(n), is the set of top primes and the left diagonal, LD(x), is the set of bottom primes. Then a(n) = LD(n+1) + RD(n) - RD(n+2).
a(n) = A096379(2*n-1). - R. J. Mathar, Sep 10 2016

Extensions

New name from Charles R Greathouse IV, Oct 08 2016

A309720 Numbers of the form p+q-r = q+r-s where p < q < r < s are consecutive primes.

Original entry on oeis.org

1, 13, 37, 65, 223, 343, 637, 1087, 1273, 1423, 1445, 1483, 1603, 1687, 1867, 2077, 2135, 2375, 2605, 2683, 2705, 3029, 3523, 3545, 3913, 3997, 4123, 4633, 4783, 4927, 5435, 5735, 6079, 7205, 7295, 7331, 7547, 7589, 7811, 8159, 8227, 8701, 8827, 9085, 9335, 9457, 9461, 9923, 10057
Offset: 1

Views

Author

Philip Mizzi, Aug 14 2019

Keywords

Comments

The consecutive primes (p,q,r,s) satisfy 2*(r-p) = s-p. Define (p,q,r,s) = (p,p+dq,p+dr,p+ds), then 2*dr = ds. For n > 1, (r-p) == 0 (mod 6). - A.H.M. Smeets, Aug 17 2019
Correspond to where prime(i) - (prime(i+2)-prime(i+1)) values repeat. For example, 13 is obtained via both 19 - (29-23) and 17 - (23-19). - Bill McEachen, Jan 03 2021

Examples

			Consider 4 consecutive primes (3,5,7,11), 3+5-7 = 1 = 5+7-11. 1 is a member of the sequence.
Consider 4 consecutive primes (59,61,67,71), 59+61-67 = 53 but, 61+67-71 = 57. These two sums are not equal so neither number is part of the sequence.
		

Crossrefs

Programs

  • Mathematica
    upto[n_]:=Block[{p,q,r,s,t,v}, Union[ Reap[ Do[ {p,q,r,s}=t; v=p+q-r; If[ v==q+r-s <= n, Sow@ v], {t, Partition[ Prime[ Range[ 4+ PrimePi[ 2*n] ]], 4,1]}]] [[2,1]]]]; upto[11000] (* Giovanni Resta, Sep 06 2019 *)
    #[[1]]+#[[2]]-#[[3]]&/@Select[Partition[Prime[Range[2000]],4,1],#[[1]]+#[[2]]- #[[3]] == #[[2]]+#[[3]]-#[[4]]&] (* Harvey P. Dale, Sep 21 2022 *)

Extensions

More terms from Michel Marcus, Aug 14 2019

A138197 Array read by antidiagonals: T(n,k) = T(n-1,k) + T(n,k+1) - T(n,k+2).

Original entry on oeis.org

2, 3, 0, 5, 1, 0, 7, 1, -3, -2, 11, 5, -1, -5, -2, 13, 7, 1, -5, -5, 14, 17, 11, 5, -5, -21, -27, 24, 19, 13, 11, 11, 1, -37, -91, -54, 23, 13, 5, 5, 17, 27, -13, -153, -294, 29, 21, 11, -1, -9, 3, 49, 87, -57, -588, 31, 23, 17, 13, 5, -19, -51, -9, 237, 527, -156, 37, 27, 15, 7, 15, 35, 7, -159, -347, 95, 1871, 3212, 41, 35, 25, 5, -15
Offset: 1

Views

Author

Zak Seidov, Mar 05 2008

Keywords

Comments

Rule A096379 applied recursively.

Examples

			Top left corner of array:
     2,    3,     5,     7,   11,   13,    17,    19,   23,  29, ... = A000040
     0,    1,     1,     5,    7,   11,    13,    13,   21,  23, ... = A096379
     0,   -3,    -1,     1,    5,   11,     5,    11,   17,  15, ...
    -2,   -5,    -5,    -5,   11,    5,    -1,    13,    7,   5, ...
    -2,   -5,   -21,     1,   17,   -9,     5,    15,  -15,  -9, ...
    14,  -27,   -37,    27,    3,  -19,    35,     9,  -71,  -5, ...
    24,  -91,   -13,    49,  -51,    7,   115,   -57, -167,  69, ...
   -54, -153,    87,    -9, -159,  179,   225,  -293, -217, 223, ...
  -294,  -57,   237,  -347, -205,  697,   149,  -733,  -59, 341, ...
  -588,  527,    95, -1249,  343, 1579,  -525, -1133,  335, 271, ...
  -156, 1871, -1497, -2485, 2447, 2187, -1993, -1069,  643, 261, ...
  ...
		

Crossrefs

Formula

T(0,k) = A000040(k), and T(n,k) = T(n-1,k) + T(n,k+1) - T(n,k+2).

Extensions

Typo corrected by Travis Hoppe, Apr 24 2008

A375087 Numbers added to cumulative correction term in order for prime numbers to resemble a recursive sequence.

Original entry on oeis.org

0, 1, 0, 4, 2, 4, 2, 0, 8, 2, 4, 8, 2, 0, 4, 10, 2, 4, 8, 0, 4, 4, 2, 10, 10, 2, 4, 2, -8, 14, 12, 8, -2, 10, 6, 2, 8, 4, 4, 10, -2, 10, 8, 4, -6, 2, 20, 14, 2, 0, 8, -2, 6, 10, 6, 10, 2, 4, 8, -4, -2, 20, 16, 2, -8, 12, 10, 14, 8, 0, 2, 8, 8, 8, 4, 2, 10, 4, 2, 16, 2, 10
Offset: 1

Views

Author

Kaleb Williams, Jul 29 2024

Keywords

Comments

At n=1, prime(n+2) = prime(n+1) + prime(n) but thereafter such a form must be reduced by a "correction" amount prime(n+2) = prime(n+1) + prime(n) - A096379(n), and the present sequence is how that correction changes.

Examples

			For n = 1: a(1) = p_2 + p_1 - p_3 - (Sum_{i <= 0} a(i)) = p_2 + p_1 - p_3 ==> a(1) = 3 + 2 - 5 = 0 ==> a(1) = 0.
For n = 2: a(2) = p_3 + p_2 - p_4 - (Sum_{i <= 1} a(i)) = p_3 + p_2 - p_4 - a(1) ==> a(2) = 5 + 3 - 7 - 0 = 1 ==> a(2) = 1.
For n = 3: a(3) = p_4 + p_3 - p_5 - (Sum_{i <= 2} a(i)) = p_4 + p_3 - p_5 - (a(1) + a(2)) ==> a(3) = 7 + 5 - 11 - (0 + 1) = 0 ==> a(3) = 0.
		

Crossrefs

Cf. A096379 (partial sums), A066495 (indices of 0's).

Programs

  • PARI
    lista(nn) = my(va = vector(nn)); for (n=1, nn, va[n] = prime(n+1) + prime(n) - prime(n+2) - sum(i=1, n-1, va[i]);); va; \\ Michel Marcus, Jul 30 2024

Formula

a(n) = 2*prime(n+1) - prime(n+2) - prime(n-1), for n>=2.
a(n) = A096379(n) - A096379(n-1), for n>=2.
prime(n+2) = prime(n+1) + prime(n) - Sum_{i=1..n} a(i)
a(n) = prime(n+1) + prime(n) - prime(n+2) - Sum_{i=0..n-1} a(i).
Showing 1-8 of 8 results.