A281290 Primes p where the difference between the largest digit of p and sum of all other digits equals 4.
37, 59, 73, 127, 149, 239, 271, 293, 307, 419, 491, 509, 941, 1049, 1061, 1117, 1171, 1193, 1229, 1319, 1409, 1601, 1913, 1931, 2017, 2039, 2129, 2309, 2903, 3119, 3191, 3209, 3911, 4019, 4091, 5009, 6011, 6101, 9041, 9203, 9221, 9311, 10061, 10139, 10193
Offset: 1
Examples
37 is a term since 7 - 3 = 4. 9221 is a term, since 9 - (2 + 2 + 1) = 4.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000 (terms 1..2579 from Lars Blomberg)
Programs
-
Mathematica
Select[Prime@ Range[10^3], Fold[#1 - #2 &, First@ #, Rest@ #] == 4 &@ Reverse@ Sort@ IntegerDigits@ # &] (* Michael De Vlieger, Feb 08 2017 *)
-
PARI
is(n)=my(d=digits(n)); 2*vecmax(d)==vecsum(d)+4 && isprime(n) \\ Charles R Greathouse IV, Feb 18 2017
-
PARI
do(d)=my(v=List()); for(len=1,d, for(b=5,9, for(e=0,len-1, my(t=b*10^e,n,dig); forvec(u=vector(b-4,i,[0,len-1]), n=t+sum(i=1,#u,10^u[i]); if(!isprime(n), next); dig=digits(n); if(2*vecmax(dig)==vecsum(dig)+4, listput(v,n)), 1)))); Set(v) \\ Charles R Greathouse IV, Feb 18 2017
Extensions
More terms from Lars Blomberg, Feb 18 2017
Comments