login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A109133
Numbers k such that (sum of digits)*(number of digits) + 1 is prime.
1
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,2
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
LINKS
EXAMPLE
1234 is a term because 4*(1+2+3+4)+1 = 41.
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 *)
PROG
(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
CROSSREFS
Cf. A110805.
Sequence in context: A089227 A204660 A275956 * A056077 A249428 A129630
KEYWORD
base,easy,nonn
AUTHOR
Jason Earls, Aug 17 2005
STATUS
approved