login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 1
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Rémy Sigrist, Table of n, a(n) for n = 1..10000

Rémy Sigrist, Colored logarithmic scatterplot of the first 2500 terms (where the color is function of the last prime number encountered) [A remarkable graph. - N. J. A. Sloane, Feb 13 2021]

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 *)

CROSSREFS

Cf. A096062.

Sequence in context: A257681 A338240 A265755 * A330139 A046671 A178760

Adjacent sequences:  A341127 A341128 A341129 * A341131 A341132 A341133

KEYWORD

nonn,look

AUTHOR

Brian Beard, Feb 05 2021

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 10 22:31 EDT 2021. Contains 342856 sequences. (Running on oeis4.)