OFFSET
1,2
COMMENTS
It appears that 2/3 of the terms are close to the line a(n) = 4n/3 and 1/3 are close to the line a(n) = 2n/3.
From Robert Israel: Given positive integers a,b, there will always be infinitely many positive integers c such that a+b+c is prime but a+c is composite. In fact, let p, q be any distinct primes coprime to a+b and b respectively. Let d == - ap^(-1) mod q, and consider the numbers f(k) = d p + k p q for k >= 0. Since a + b + d p is coprime to p q, Dirichlet's theorem says a + b + f(k) is prime for infinitely many k. On the other hand, a + f(k) is divisible by q for all k.
From Paul Curtz, Feb 05 2016:
Trisections of this probable permutation of n:
1, 7, 21, 11, 23, 13, 5, 19, ...
2, 4, 14, 12, 20, 30, 26, 32, ...
8, 18, 6, 24, 10, 36, 16, 38, ...
which appear to be rearrangements of
1, 3, 5, 7, 9, 11, 13, ...
2, 4, 12, 14, 20, 26, 28, ...
6, 8, 10, 16, 18, 22, 24, ...
LINKS
Lars Blomberg, Table of n, a(n) for n = 1..10000
EXAMPLE
For n=19 we have a(19)+a(18)+a(17) = 5+36+30 = 71 which is prime, but a(19)+a(17) = 5+30 = 35 which is not prime.
MAPLE
N:= 1000: # to get all terms before the first term > N
V:= {$3..1000}:
A[1]:= 1:
A[2]:= 2:
for n from 3 while assigned(A[n-1]) do
for v in V do
if isprime(v + A[n-1]+A[n-2]) and not isprime(v + A[n-2]) then
A[n]:= v;
V:= V minus {v};
break
fi
od;
od:
seq(A[i], i=1..n-2); # Robert Israel, Feb 01 2016
MATHEMATICA
a = {1, 2}; Do[k = If[Length@ # == 0, Max@ a + 1, First@ #] &@ Complement[Range@ Max@ a, a]; While[Or[MemberQ[a, k], Nand[PrimeQ[k + a[[n - 1]] + a[[n - 2]]], CompositeQ[k + a[[n - 2]]]]], k++]; AppendTo[a, k], {n, 3, 67}]; a (* Michael De Vlieger, Feb 05 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Angelini and Lars Blomberg, Jan 31 2016
STATUS
approved