OFFSET
1,1
COMMENTS
As the sum of terms beyond a(2) = 3 must be odd, a(2) is the only odd term. Is is unknown if all even numbers appear.
Similarly, the sum of digits of terms beyond a(2) must be odd, so a(2) is the only term with odd sum of digits. 10 is the first even number that does not appear. - Michael S. Branicky, Dec 18 2024
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..5000
EXAMPLE
a(5) = 4 as the sum of both the terms and digits from a(1)..a(5) is 23, which is a prime number, and 4 has not previously appeared.
a(6) = 24 as the sum of terms from a(1)..a(6) is 47 while the sum of digits of these terms is 29, and both 47 and 29 are prime numbers while 24 has not previously appeared.
PROG
(Python)
from sympy import isprime
from itertools import count, islice
def sod(n): return sum(map(int, str(n)))
def agen(): # generator of terms
aset, s, ds, m = {2, 3}, 5, 5, 4
yield from [2, 3]
while True:
an = next(k for k in count(m, 2) if k not in aset and all(isprime(i) for i in [s+k, ds+sod(k)]))
s, ds = s+an, ds+sod(an)
aset.add(an)
yield an
while m in aset or sod(m)&1: m += 2
print(list(islice(agen(), 80))) # Michael S. Branicky, Dec 18 2024
CROSSREFS
KEYWORD
nonn,base,new
AUTHOR
Scott R. Shannon, Dec 16 2024
STATUS
approved