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

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

Views

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 *)
Showing 1-1 of 1 results.