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.

A346206 Primes p, with k digits, such that the Sum_{i=1..k} (p without its i-th digit)/(its i-th digit) is a prime.

Original entry on oeis.org

11, 21673, 27367, 32611, 33311, 41141, 48821, 82781, 171263, 211441, 243433, 323443, 343243, 449699, 632623, 663661, 727271, 772127, 847871, 882881, 944969, 1129699, 1192699, 1193939, 1262633, 1334341, 1342433, 1343423, 1361441, 1388641, 1399193, 1461883, 1613441
Offset: 1

Views

Author

Michel Marcus, Jul 10 2021

Keywords

Examples

			21673 gives 1673/2 + 2673/1 + 2173/6 + 2163/7 + 2167/3 = 4903; so 21673 is a term.
		

Crossrefs

Subsequence of A038618 (zeroless primes).

Programs

  • PARI
    subs(d, j) = {my(x=""); for (k=1, #d, if (j != k, x = concat(x, d[k]));); eval(x);}
    isok(p) = {my(d=digits(p), res);  if (isprime(p) && vecmin(d), res = sum(j=1, #d, subs(d, j)/d[j]); (denominator(res)==1) && isprime(res););}
    
  • Python
    from sympy import isprime, primerange
    from fractions import Fraction
    def ok(p):
        s = str(p)
        if '0' in s or len(s) == 1: return False
        f = sum(Fraction(int(s[:i]+s[i+1:]), int(s[i])) for i in range(len(s)))
        return f.denominator == 1 and isprime(f.numerator)
    def aupto(lim): return [p for p in primerange(1, lim+1) if ok(p)]
    print(aupto(1620000)) # Michael S. Branicky, Jul 11 2021