OFFSET
1,3
COMMENTS
There is a unique decomposition of the primes: provided the weight a(n) is > 0, we have prime(n) = weight * level + gap, or A000040(n)=a(n)*A117563(n)+A001223(n).
a(n) == 0 (mod 2) only for n = {1, 2 or 4}. - Robert G. Wilson v, May 05 2006
a(n) = 0 only for primes 2, 3 and 7. Conjecture: 2, 3 and 7 are the only primes for which log(A000040(n)) < sqrt(A001223(n)).
a(n) > 0 if and only if 2*prime(n+1) < 3*prime(n). - Thomas Ordowski, Nov 25 2013
LINKS
Remi Eismann, Table of n, a(n) for n = 1..10000
Rémi Eismann, Decomposition into weight * level + jump and application to a new classification of primes, arXiv:0711.0865 [math.NT], 2007-2010.
Fabien Sibenaler, Program in assembly that gives the decomposition of a prime number [prime = weight * level + gap, or A000040(n) = A117078(n) * A117563(n) + A001223(n)]
EXAMPLE
For n = 1 we have prime(n) = 2, prime(n+1) = 3; there is no k such that 3 - 2 = 1 = (2 mod k), hence a(1) = 0.
For n = 3 we have prime(n) = 5, prime(n+1) = 7; 3 is the smallest k such that 7 - 5 = 2 = (5 mod k), hence a(3) = 3.
For n = 19 we have prime(n) = 67, prime(n+1) = 71; 7 is the smallest k such that 71 - 67 = 4 = (67 mod k), hence a(19) = 7.
MATHEMATICA
f[n_] := Block[{a, p = Prime@n, np = Prime[n + 1]}, a = Min@ Select[ Divisors[2p - np], # > np - p &]; If[a == Infinity, 0, a]]; Array[f, 80] (* Robert G. Wilson v, May 08 2006 *)
PROG
(PARI) {m=78; for(n=1, m, p=prime(n); d=prime(n+1)-p; k=0; j=1; while(k==0&&j<p, if(p%j!=d, j++, k=j)); print1(k, ", "))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémi Eismann, Apr 18 2006, Dec 10 2006, Feb 14 2008
EXTENSIONS
Edited and corrected by Don Reble and Klaus Brockhaus, Apr 21 2006
STATUS
approved