OFFSET
2,3
COMMENTS
For any n > 1 and b > n, n + digitsum(n, base b) equals 2*n and is composite, hence the sequence is well defined.
The sequence is not defined for n = 1 as 1 + digitsum(1, base b) equals 2 and is prime for any base b > 1.
In the scatterplot of the sequence, the points are separated into two beams according to whether n is divisible by 3 or not, then these beams are separated in two according to whether n is divisible by 5 or not, then similarly according to whether n is divisible by 7 or not; these separations seem to continue for each odd prime number; see scatterplot in Links section.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 2..10000
Rémy Sigrist, Colored scatterplot of the sequence for n = 2..250000
Rémy Sigrist, Colored scatterplot of (n, b) such that n + sumdigits(n, base b) is prime and 1 <= n <= 1000 and 2 <= b <= 1000 (where the color is function of n + sumdigits(n, base b))
EXAMPLE
For n = 9, we have:
b 9 + sumdigits(9, base b)
---- ------------------------
2 11 (prime)
3 10
4 12
5 14
6 13 (prime)
7 12
8 11 (prime)
9 10
>=10 18
Hence, a(9) = 3.
PROG
(PARI) a(n) = sum(b=2, n, isprime(n + sumdigits(n, b)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Nov 08 2018
STATUS
approved