OFFSET
1,2
COMMENTS
First 8 terms are primes (and are also in A061248). Next terms are not always primes.
LINKS
Francesco Di Matteo, Table of n, a(n) for n = 1..25
FORMULA
EXAMPLE
a(4) = 19 and 1 + 9 = 10; so a(5) = 89 because 8 + 9 = 17 and 17 - 10 = 7, that is the 4th prime.
PROG
(Python)
sumprime = 0
isPrime=lambda x: all(x % i != 0 for i in range(int(x**0.5)+1)[2:])
for i in range(2, 100):
..if isPrime(i):
....alfa = ""
....k = i + sumprime
....sumprime = k
....while k > 9:
......alfa = alfa + "9"
......k = k - 9
....alfa = str(k)+alfa
....print alfa
(PARI) findnext(x, k) = {sx = sumdigits(x); pk = prime(k); y = 1; while (sumdigits(y) - sx != pk, y++); y; }
lista(nn) = {print1(x = 0, ", "); for (k=1, nn, y = findnext(x, k); print1(y, ", "); x = y; ); } \\ Michel Marcus, Feb 19 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Francesco Di Matteo, Feb 17 2016
EXTENSIONS
NAME adapted to offset. - R. J. Mathar, Jun 19 2021
STATUS
approved