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.

A109133 Numbers k such that (sum of digits)*(number of digits) + 1 is prime.

Original entry on oeis.org

1, 2, 4, 6, 10, 11, 12, 14, 15, 17, 18, 20, 21, 23, 24, 26, 27, 29, 30, 32, 33, 35, 36, 38, 41, 42, 44, 45, 47, 50, 51, 53, 54, 56, 59, 60, 62, 63, 65, 68, 69, 71, 72, 74, 77, 78, 80, 81, 83, 86, 87, 90, 92, 95, 96, 99, 101, 103, 105, 109, 110, 112, 114, 118, 121, 123, 127
Offset: 1

Views

Author

Jason Earls, Aug 17 2005

Keywords

Comments

By Dirichlet's theorem on primes in arithmetic progressions, for any positive integer k this sequence has infinitely many terms of the form k*10^m. - Robert Israel, Dec 19 2021

Examples

			1234 is a term because 4*(1+2+3+4)+1 = 41.
		

Crossrefs

Cf. A110805.

Programs

  • Maple
    filter:= proc(n) local L;
      L:= convert(n,base,10);
      isprime(convert(L,`+`)*nops(L)+1)
    end proc:
    select(filter, [$1..200]); # Robert Israel, Dec 19 2021
  • Mathematica
    Select[Range[130],PrimeQ[Total[IntegerDigits[#]]IntegerLength[ #]+ 1]&] (* Harvey P. Dale, Jul 12 2011 *)
  • Python
    from sympy import isprime
    def ok(n): s = str(n); return isprime(sum(map(int, s))*len(s) + 1)
    print([k for k in range(128) if ok(k)]) # Michael S. Branicky, Dec 19 2021