

A299154


a(n) is the distance from prime(n) to the next prime that has the same digital root, or a(n) = 0 if there is no greater prime with the same digital root.


0



9, 0, 18, 36, 18, 18, 36, 18, 18, 18, 36, 36, 18, 18, 36, 18, 54, 18, 36, 18, 36, 18, 18, 18, 54, 36, 36, 72, 18, 18, 36, 18, 36, 18, 18, 72, 36, 18, 72, 18, 18, 18, 36, 18, 36, 72, 18, 18, 36, 54, 18, 18, 36, 18, 36, 18, 90, 36, 36, 36
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

For n >= 3, a(n) is a multiple of 18.
I conjecture that there are infinitely many prime numbers with each of the digital roots from the set {1,2,4,5,7,8}. This would imply that the only prime number with a(n) = 0 is 3.
The conjecture is true; for any d in {1,2,4,5,7,8}, gcd(d, 9) = 1, hence, according to Dirichlet's theorem on arithmetic progressions, there are infinitely many primes of the form d + 9*k, and these primes all have digital root d.  Rémy Sigrist, Mar 25 2018


LINKS

Table of n, a(n) for n=1..60.


EXAMPLE

For n=1, prime(n) = 2; 2 mod 9 = 2. The next prime that has the same digital root is 11, because 11 mod 9 = 2. So 11  2 = 9 is the first term.


MATHEMATICA

Table[With[{p = Prime@ n}, If[IntegerQ@ #, #  p, 0] &@ SelectFirst[Prime@ Range[n + 1, n + 120], SameQ @@ Mod[{#, p}, 9] &]], {n, 60}] (* Michael De Vlieger, Feb 10 2018 *)


PROG

(PARI) {
print1(9", "0", ");
forprime(n=5, 1000,
p=n%9; i=nextprime(n+1);
while((i%9)<>p, i=nextprime(i+1));
print1(in", ")
)
}


CROSSREFS

Cf. A038194.
Sequence in context: A062047 A117465 A136679 * A070929 A007394 A067153
Adjacent sequences: A299151 A299152 A299153 * A299155 A299156 A299157


KEYWORD

nonn,base


AUTHOR

Dimitris Valianatos, Feb 03 2018


STATUS

approved



