cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A276255 Sum of first n Honaker primes.

Original entry on oeis.org

131, 394, 851, 1890, 2939, 4030, 5331, 6692, 8125, 9696, 11609, 13542, 15683, 17904, 20177, 22618, 25209, 27872, 30579, 33298, 36027, 38830, 41897, 45034, 48263, 51696, 55255, 58886, 62977, 67130, 71487, 75884, 80587, 85310, 90213, 95222, 100729, 106430, 112141
Offset: 1

Views

Author

K. D. Bajpai, Aug 25 2016

Keywords

Comments

A Honaker prime is a prime number prime(k) such that k and prime(k) have the same sum of digits.

Examples

			The first Honaker prime is 131, so a(1) = 131.
The second Honaker prime is 263, so a(2) = 131 + 263 = 394.
		

Crossrefs

Cf. A033548.

Programs

  • Mathematica
    Accumulate[Select[Prime@Range@3000, Plus @@ IntegerDigits@# == Plus @@ IntegerDigits@PrimePi@# &]] (* Bajpai *)
    DeleteDuplicates[Accumulate[Table[Prime[n] * Boole[Plus@@IntegerDigits[n] == Plus@@IntegerDigits[Prime[n]]], {n, 1000}]]] (* Alonso del Arte, Aug 25 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
  • Perl
    use ntheory ":all"; my($s,$i)=(0,0); forprimes { say $s+=$ if sumdigits($) == sumdigits(++$i) } 1e7; # Dana Jacobsen, Aug 29 2016