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.

User: Brian Beard

Brian Beard's wiki page.

Brian Beard has authored 2 sequences.

A345668 Last prime minus distance to last prime.

Original entry on oeis.org

1, 2, 1, 4, 3, 6, 5, 4, 3, 10, 9, 12, 11, 10, 9, 16, 15, 18, 17, 16, 15, 22, 21, 20, 19, 18, 17, 28, 27, 30, 29, 28, 27, 26, 25, 36, 35, 34, 33, 40, 39, 42, 41, 40, 39, 46, 45, 44, 43, 42, 41, 52, 51, 50, 49, 48, 47, 58, 57, 60, 59, 58, 57, 56, 55, 66, 65, 64
Offset: 3

Author

Brian Beard, Jun 21 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := 2 * NextPrime[n, -1] - n; Array[a, 100, 3] (* Amiram Eldar, Jun 21 2021 *)

Formula

a(n) = p - (n-p) = 2*p - n where p is the largest prime < n.
a(n) = A151799(n) - A049711(n).
a(n) = A175856(n-1) - 1.

Extensions

More terms from Jon E. Schoenfield, Jun 21 2021

A341130 a(n) = abs(a(n-1) - a(n-2)) if a(n-1) and a(n-2) are both prime or both composite. a(n) = a(n-1) + a(n-2) otherwise, where a(1) = 1 and a(2) = 2 and n > 2.

Original entry on oeis.org

1, 2, 3, 1, 4, 5, 9, 14, 5, 19, 14, 33, 19, 52, 71, 123, 194, 71, 265, 336, 71, 407, 478, 71, 549, 620, 71, 691, 620, 1311, 691, 2002, 2693, 4695, 7388, 2693, 10081, 12774, 2693, 15467, 12774, 28241, 15467, 43708, 59175, 15467, 74642, 90109, 15467, 105576, 121043
Offset: 1

Author

Brian Beard, Feb 05 2021

Keywords

Crossrefs

Cf. A096062.

Programs

  • Mathematica
    Block[{a = {1, 2}}, Do[AppendTo[a, Which[MemberQ[{##}, 1], Abs[#1 + #2], SameQ @@ PrimeQ[{##}], Abs[#1 - #2], True, Abs[#1 + #2]]] & @@ a[[-2 ;; -1]], {i, 49}]; a] (* Michael De Vlieger, Feb 05 2021 *)