OFFSET
1,2
COMMENTS
I conjecture that there are prime numbers for every n, if n is not divisible by 3.
Other terms: a(97) = 79999999999, a(98) = 98999999999, a(100) = 298999999999.
a(1000) = 2999899999999999999999999999999999999999999999999999999999999999999999999
999999999999999999999999999999999999999.
EXAMPLE
a(23) = 599 because 599 is a prime number greater than a(22) = 499 and the sum of its digits is 5 + 9 + 9 = 23.
a(24) = 0 because 24 (mod 3) = 0.
MATHEMATICA
a = {1}; Do[If[n != 3 && Divisible[n, 3], AppendTo[a, 0], p = NextPrime@ Max@ a; While[Total@ IntegerDigits@ p != n, p = NextPrime@ p]; AppendTo[a, p]], {n, 2, 57}]; a (* Michael De Vlieger, Feb 12 2017 *)
PROG
(PARI) {
print1(0", "2", ");
n=3; p=3; sp=3;
while(p<1000000,
while(sp<>n,
p=nextprime(p+1);
sp=sumdigits(p);
);
print1(p", ");
n++; if(n%3==0, n++; print1(0", "));
)
}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Dimitris Valianatos, Feb 12 2017
STATUS
reviewed