login

Revision History for A270003

(Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing all changes.
Least prime p such that n = p + q - r for some primes q and r with q > p.
(history; published version)
#5 by Charles R Greathouse IV at Fri Apr 29 00:12:12 EDT 2016
STATUS

editing

approved

#4 by Charles R Greathouse IV at Fri Apr 29 00:12:08 EDT 2016
NAME

Least prime p such that n = p + q - r for some prime primes q > p and some prime r with q > p.

PROG

(PARI) a(n)=if(n%2 && !isprime(n), 3, 2) \\ Charles R Greathouse IV, Apr 29 2016

STATUS

proposed

editing

#3 by Clark Kimberling at Tue Apr 26 15:43:17 EDT 2016
STATUS

editing

proposed

#2 by Clark Kimberling at Tue Apr 26 15:38:51 EDT 2016
NAME

allocated Least prime such that n = p + q - r for Clark Kimberlingsome prime q > p and some prime r.

DATA

3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 3, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2

OFFSET

1,1

COMMENTS

p = 3 when n is an odd nonprime and p = 2 otherwise, so that 3 appears in positions given by A014076.

LINKS

Clark Kimberling, <a href="/A270003/b270003.txt">Table of n, a(n) for n = 1..10000</a>

EXAMPLE

n p q r

1 3 5 7

2 2 3 3

3 2 3 2

4 2 5 3

5 2 5 2

6 2 7 3

7 2 7 2

MATHEMATICA

t = Join[{{1, {3, 5, 7}}, {2, {2, 3, 3}}}, Table[If[PrimeQ[n], {n, {2, n, 2}}, p = If[EvenQ[2 + NextPrime[n, 1] - n], 3, 2]; NestWhile[# + 1 &, 1, ! PrimeQ[r = (p + (q = NextPrime[n, #])) - n] &]; {n, {p, q, r}}], {n, 3, 300}]];

Map[#[[2]][[1]] &, t] (* p, A270003 *)

Map[#[[2]][[2]] &, t] (* q, A270753 *)

Map[#[[2]][[3]] &, t] (* r, A271353 *)

(* Peter J. C. Moses, Apr 26 2016 *)

CROSSREFS
KEYWORD

allocated

nonn,easy

AUTHOR

Clark Kimberling, Apr 26 2016

STATUS

approved

editing

#1 by Clark Kimberling at Tue Mar 08 15:55:19 EST 2016
NAME

allocated for Clark Kimberling

KEYWORD

allocated

STATUS

approved