OFFSET
1,1
COMMENTS
There are two sequences of primes at which two third-order differences vanish:
one is b(n) = 23, 41, 47, 71, 89, 233, ... which contains all primes prime(n) such that prime(n-2) - 3*prime(n-1) + 3*prime(n) - prime(n+1) = 0;
the other is A139313(n) = 19, 37, 43, ... such that -prime(n-1) + 3*prime(n) - 3*prime(n+1) - prime(n+2) = 0.
Then by definition a(n) = b(n) - A139313(n).
EXAMPLE
23 - 19 = 4 = a(1). 41 - 37 = 4 = a(2). 47 - 43 = 4 = a(3).
MAPLE
A139324a := proc(n) if n = 1 then 23; else a := nextprime(procname(n-1)) ; while (true ) do if prevprime(prevprime(a))-3*prevprime(a)+3*a-nextprime(a) =0 then return a; end if; a := nextprime(a) ; end do: end if; end proc:
A139313 := proc(n) if n = 1 then 19; else a := nextprime(procname(n-1)) ; while (true ) do if -prevprime(a)+3*a-3*nextprime(a)+nextprime(nextprime(a)) = 0 then return a; end if; a := nextprime(a) ; end do: end if; end proc:
seq(A139324(n), n=1..80) ; # R. J. Mathar, Jun 15 2011
MATHEMATICA
Flatten[Table[If[ Prime[ -2 +n] - 3 Prime[ -1 + n] + 3 Prime[n] - 1 Prime[1 + n] == 0, Prime[n], {}], {n, 3, 500}]] - Flatten[ Table[If[ -Prime[ -1 + n] + 3*Prime[n] - 3*Prime[1 + n] + Prime[n + 2] == 0, Prime[n], {}], {n, 2, 500}]]
CROSSREFS
KEYWORD
nonn,less
AUTHOR
Roger L. Bagula, Jun 07 2008
STATUS
approved