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”).

Primes p such that the sum of (p mod d) for nonzero digits d of p is prime.
1

%I #14 Sep 08 2022 08:46:24

%S 17,23,29,37,53,67,83,97,107,113,127,131,139,157,163,167,173,181,191,

%T 193,199,223,227,233,241,251,281,283,307,311,313,331,337,353,367,379,

%U 383,397,409,421,431,433,439,457,463,467,499,503,521,523,541,569,571,587,593,613,631,643,647,659,661

%N Primes p such that the sum of (p mod d) for nonzero digits d of p is prime.

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

%e a(10) = 113 is in the sequence because 113 is prime and (113 mod 1) + (113 mod 1) + (113 mod 3) = 2 is prime.

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

%p isprime(n) and isprime(add(n mod t, t = subs(0=NULL, convert(n,base,10))))

%p end proc:

%p select(filter, [seq(i,i=3..1000,2)]);

%t smdQ[n_]:=PrimeQ[Total[Mod[n,Select[IntegerDigits[n],#!=0&]]]]; Select[ Prime[ Range[150]],smdQ] (* _Harvey P. Dale_, Jun 20 2021 *)

%o (Magma) a:=[]; for p in PrimesUpTo(700) do v:=[]; for i in [1..#Intseq(p)] do if Intseq(p)[i] ne 0 then Append(~v,Intseq(p)[i]); end if; end for; if IsPrime(&+[p mod v[u]: u in [1..#v]]) then Append(~a,p); end if; end for; a; // _Marius A. Burtea_, Dec 19 2019

%K nonn,base

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Dec 19 2019