OFFSET
1,1
COMMENTS
Note that 2, 19, 23, 317, 1031, 49081, 86453, 109297, 270343, 5794777, 8177207 (see A004023) are terms. [Last 2 terms added by Serge Batalov, Aug 24 2021]
While all currently known A004023 terms are in this sequence, there is no clear argument that it would hold for all future values. - Serge Batalov, Aug 24 2021
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
PROG
(PARI) upto(n)= {my(res = List()); for(i = 1, n, if(is(i), listput(res, i); print1(i", "))); res}
is(n) = {if(n < 8, return(isprime(n))); qd = n; n = 10^n\9; r = 1 + (n-1)%9; h = (r + 9 * (r%2))/2; ld = 10; while(h + 9*qd >= n % ld, ld*=10); vs = qd - valuation(ld, 10); n %= ld; for(i = 0, qd, if(vs + vecsum(digits(n - h - 9*i)) == h + 9*i, return(1))); 0} \\ David A. Corneth, Aug 20 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Marcus, Aug 19 2020
STATUS
approved