login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #16 Dec 20 2021 19:00:45

%S 1,2,4,6,10,11,12,14,15,17,18,20,21,23,24,26,27,29,30,32,33,35,36,38,

%T 41,42,44,45,47,50,51,53,54,56,59,60,62,63,65,68,69,71,72,74,77,78,80,

%U 81,83,86,87,90,92,95,96,99,101,103,105,109,110,112,114,118,121,123,127

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

%C 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

%H Robert Israel, <a href="/A109133/b109133.txt">Table of n, a(n) for n = 1..10000</a>

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

%p filter:= proc(n) local L;

%p L:= convert(n,base,10);

%p isprime(convert(L,`+`)*nops(L)+1)

%p end proc:

%p select(filter, [$1..200]); # _Robert Israel_, Dec 19 2021

%t Select[Range[130],PrimeQ[Total[IntegerDigits[#]]IntegerLength[ #]+ 1]&] (* _Harvey P. Dale_, Jul 12 2011 *)

%o (Python)

%o from sympy import isprime

%o def ok(n): s = str(n); return isprime(sum(map(int, s))*len(s) + 1)

%o print([k for k in range(128) if ok(k)]) # _Michael S. Branicky_, Dec 19 2021

%Y Cf. A110805.

%K base,easy,nonn

%O 1,2

%A _Jason Earls_, Aug 17 2005