%I #15 Jan 15 2023 18:40:13
%S 2,3,5,7,21,32,117,119,127,131,132,133,135,137,139,149,151,157,169,
%T 171,172,173,175,177,179,187,211,212,213,215,217,218,221,231,232,233,
%U 235,237,251,253,271,272,273,275,277,281,311,319,321,322,323,325,327,329,331
%N Prime-acronym numbers: sums of primes which also equal the concatenation of the initial digits of these primes.
%H Eric Angelini, <a href="https://mailman.xmission.com/cgi-bin/mailman/private/math-fun/2020-December/036335.html">Sum of peculiar primes</a>, math-fun mailing list, Dec 24, 2020.
%e Single-digit primes trivially satisfy the constraint.
%e 21 is the sum and also concatenation of the initial digits of the primes 2 and 19.
%e 32 is the sum and also concatenation of the initial digits of the primes 3 and 29.
%e 117 is the sum and also concatenation of the initial digits of the primes 19, 19 and 79.
%o (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)))}
%Y Cf. A340113 for the subset of primes in this sequence.
%K nonn,base
%O 1,1
%A _Eric Angelini_ and _M. F. Hasler_, Dec 28 2020
|