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.

A048528 Primes expressible in two ways as the sum of an integer and its digit sum.

Original entry on oeis.org

101, 103, 107, 109, 113, 307, 311, 313, 317, 509, 521, 709, 719, 911, 919, 1009, 1013, 1213, 1217, 1409, 1607, 1609, 1613, 1619, 1621, 1811, 1823, 2017, 2027, 2111, 2113, 2309, 2311, 2521, 2711, 2713, 2719, 2917, 2927, 3011, 3209, 3217, 3221, 3407, 3413, 3613, 3617, 3623
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Examples

			313 = 296 + (2+9+6) and 313 = 305 + (3+0+5).
		

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Tally[Select[#+Total[IntegerDigits[#]]&/@ Range[ 5000], PrimeQ]],#[[2]]==2&]][[1]] (* Harvey P. Dale, May 09 2013 *)
  • Python
    from collections import Counter
    from sympy import isprime
    def a_list(upto):
        return [i for i, j in Counter([i+sum(map(int, str(i))) for i in range(upto)]).items() if j>1 and isprime(i)]
    print(a_list(4000)) # Nicholas Stefan Georgescu, Mar 02 2023

Extensions

Corrected and extended by Harvey P. Dale, May 09 2013