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!)
A284383 a(1) = 1, a(2) = 2, a(3) = 3, a(4) = 2; a(n) is the largest composite number <= (a(n-a(n-1)) + a(n-a(n-2))) for n > 4. 4
1, 2, 3, 2, 4, 4, 6, 4, 6, 6, 8, 6, 10, 6, 10, 10, 12, 8, 14, 10, 14, 10, 16, 10, 16, 16, 16, 12, 22, 12, 20, 16, 22, 14, 24, 16, 24, 16, 26, 16, 26, 26, 24, 18, 30, 22, 28, 26, 30, 20, 34, 24, 36, 20, 38, 24, 36, 24, 40, 26, 38, 26, 40, 26, 42, 26, 42, 42, 32, 28, 50, 28, 46, 34 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Altug Alkan, Table of n, a(n) for n = 1..10000

Altug Alkan, Alternative scatterplot of A284383

Altug Alkan, Illustration for A284383

FORMULA

a(1) = 1, a(2) = 2, a(3) = 3; a(n) = a(n-a(n-1)) + a(n-a(n-2)) - A010051(a(n-a(n-1)) + a(n-a(n-2))) for n > 3.

EXAMPLE

a(5) = 4 because a(5 - a(4)) + a(5 - a(3)) = a(3) + a(2) = 3 + 2 = 5 and largest composite number <= 5 is 4.

MATHEMATICA

a[n_] := a[n] = If[n <= 4, n - 2 Boole[n == 4], k = 0; While[! CompositeQ@ Set[m, a[n - a[n - 1]] + a[n - a[n - 2]] - k], k++]; m]; Array[a, 74] (* Michael De Vlieger, Mar 29 2017 *)

PROG

(PARI) f(n) = n-isprime(n);

a=vector(1000); a[1]=1; a[2]=2; a[3]=3; for(n=4, #a, a[n] = f(a[n-a[n-1]]+a[n-a[n-2]])); a

CROSSREFS

Cf. A005185, A010051, A014684, A113523, A284374.

Sequence in context: A173997 A029143 A153846 * A072406 A297117 A120680

Adjacent sequences:  A284380 A284381 A284382 * A284384 A284385 A284386

KEYWORD

nonn

AUTHOR

Altug Alkan, Mar 26 2017

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 January 29 16:58 EST 2020. Contains 331347 sequences. (Running on oeis4.)