OFFSET
1,1
COMMENTS
A Honaker prime is a prime number prime(k) such that k and prime(k) have the same sum of digits.
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..7300
EXAMPLE
The first Honaker prime is 131, so a(1) = 131.
The second Honaker prime is 263, so a(2) = 131 + 263 = 394.
MATHEMATICA
Accumulate[Select[Prime@Range@3000, Plus @@ IntegerDigits@# == Plus @@ IntegerDigits@PrimePi@# &]] (* Bajpai *)
Accumulate[Table[Prime[n] * Boole[Plus@@IntegerDigits[n] == IntegerDigits[Prime[n]]], {n, 1000}] (* Alonso del Arte, Aug 25 2016 *)
PROG
(Perl) use ntheory ":all"; my($s, $i)=(0, 0); forprimes { say $s+=$_ if sumdigits($_) == sumdigits(++$i) } 1e7; # Dana Jacobsen, Aug 29 2016
(PARI) first(n)=my(v=vector(n), i, k, s); forprime(p=2, , if(sumdigits(k++)==sumdigits(p), v[i++] = s+=p); if(i==n, return(v))) \\ Charles R Greathouse IV, Aug 29 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
K. D. Bajpai, Aug 25 2016
STATUS
approved