OFFSET
1,1
LINKS
Eric Angelini, Sum of peculiar primes, math-fun mailing list, Dec 24, 2020.
EXAMPLE
Single-digit primes trivially satisfy the constraint.
21 is the sum and also concatenation of the initial digits of the primes 2 and 19.
32 is the sum and also concatenation of the initial digits of the primes 3 and 29.
117 is the sum and also concatenation of the initial digits of the primes 19, 19 and 79.
PROG
(PARI) is_A340112(n, d=digits(n), nd=if(vecmin(d), #d))={ /* Check whether n is the sum of primes starting with the digits d[1..nd], respectively. If there's a zero digit, return 0. If there's a single digit left, n must be a prime starting with d[1] */ nd<2 && return(isprime(n) && nd && d[1]==digits(n)[1]); /* else subtract from n a prime p starting with digit d[nd]; check n-p with digits d[1 .. nd-1] */ for( e= !isprime(d[nd]), logint(n, 10), forprime( p=d[nd]*10^e, min(n-vecsum(d[^-1]), (d[nd]+1)*10^e-1), self()(n-p, d[^-1], nd-1) && return(1)))}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini and M. F. Hasler, Dec 28 2020
STATUS
approved