Displaying 1-10 of 11 results found.
Primes p where the digital sum is equal to 68.
+10
43
59999999, 69999899, 69999989, 78998999, 88989899, 88999979, 89699999, 89799989, 89989799, 89989979, 89997899, 89997989, 89999699, 89999969, 97889999, 98699999, 98879999, 98899799, 98979989, 98988899, 98989889, 98997989, 98998979, 98999969
EXAMPLE
69999899 is a prime with sum of the digits = 68, hence belongs to the sequence.
MATHEMATICA
Select[Prime[Range[10000000]], Total[IntegerDigits[#]]==68 &]
PROG
(Magma) [p: p in PrimesUpTo(100000000) | &+Intseq(p) eq 68];
(Python) # see code in A107579: the same code can be used to produce this sequence, by giving the initial term p = 6*10**7-1, for digit sum 68. - M. F. Hasler, Mar 16 2022
CROSSREFS
Cf. Primes p where the digital sum is equal to k: 2, 11 and 101 for k=2; A062339 (k=4), A062341 (k=5), A062337 (k=7), A062343 (k=8), A107579 (k=10), A106754 (k=11), A106755 (k=13), A106756 (k=14), A106757 (k=16), A106758 (k=17), A106759 (k=19), A106760 (k=20), A106761 (k=22), A106762 (k=23), A106763 (k=25), A106764 (k=26), A048517 (k=28), A106766 (k=29), A106767 (k=31), A106768 (k=32), A106769 (k=34), A106770 (k=35), A106771 (k=37), A106772 (k=38), A106773 (k=40), A106774 (k=41), A106775 (k=43), A106776 (k=44), A106777 (k=46), A106778 (k=47), A106779 (k=49), A106780 (k=50), A106781 (k=52), A106782 (k=53), A106783 (k=55), A106784 (k=56), A106785 (k=58), A106786 (k=59), A106787 (k=61), A107617 (k=62), A107618 (k=64), A107619 (k=65), A106807 (k=67), this sequence (k=68), A181321 (k=70).
Primes whose sum of digits is 4.
+10
26
13, 31, 103, 211, 1021, 1201, 2011, 3001, 10111, 20011, 20101, 21001, 100003, 102001, 1000003, 1011001, 1020001, 1100101, 2100001, 10010101, 10100011, 20001001, 30000001, 101001001, 200001001, 1000000021, 1000001011, 1000010101, 1000020001, 1000200001, 1002000001, 1010000011
COMMENTS
10^ A049054(m)+3 and 3*10^ A056807(m)+1 are subsequences. A107715 (primes containing only digits from set {0,1,2,3}) is a supersequence. Terms not containing the digit 3 are either terms of A020449 (primes that contain digits 0 and 1 only) or of A106100 (primes with maximal digit 2) - and thus terms of these sequences' union A036953 (primes containing only digits from set {0,1,2}). - Rick L. Shepherd, May 23 2005
EXAMPLE
3001 is a prime with sum of digits = 4, hence belongs to the sequence.
MAPLE
N:= 20: # to get all terms < 10^N
B[1]:= {1}:
B[2]:= {2}:
B[3]:= {3}:
A:= {}:
for d from 2 to N do
B[4]:= map(t -> 10*t+1, B[3]) union map(t -> 10*t+3, B[1]);
B[3]:= map(t -> 10*t, B[3]) union map(t -> 10*t+1, B[2]) union map(t -> 10*t+2, B[1]);
B[2]:= map(t -> 10*t, B[2]) union map(t -> 10*t+1, B[1]);
B[1]:= map(t -> 10*t, B[1]);
A:= A union select(isprime, B[4]);
od:
MATHEMATICA
Union[FromDigits/@Select[Flatten[Table[Tuples[{0, 1, 2, 3}, k], {k, 9}], 1], PrimeQ[FromDigits[#]]&&Total[#]==4&]] (* Jayanta Basu, May 19 2013 *)
PROG
(PARI) for(a=1, 20, for(b=0, a, for(c=0, b, if(isprime(k=10^a+10^b+10^c+1), print1(k", "))))) \\ Charles R Greathouse IV, Jul 26 2011
(PARI) select( {is_ A062339(p, s=4)=sumdigits(p)==s&&isprime(p)}, primes([1, 10^7])) \\ 2nd optional parameter for similar sequences with other digit sums. M. F. Hasler, Mar 09 2022
(PARI) A062339_upto_length(L, s=4, a=List(), u=[10^(L-k)|k<-[1..L]])=forvec(d=[[1, L]|i<-[1..s]], isprime(p=vecsum(vecextract(u, d))) && listput(a, p), 1); Vecrev(a) \\ M. F. Hasler, Mar 09 2022
(Magma) [p: p in PrimesUpTo(800000000) | &+Intseq(p) eq 4]; // Vincenzo Librandi, Jul 08 2014
CROSSREFS
Cf. Primes p with digital sum equal to k: {2, 11 and 101} for k=2; this sequence (k=4), A062341 (k=5), A062337 (k=7), A062343 (k=8), A107579 (k=10), A106754 (k=11), A106755 (k=13), A106756 (k=14), A106757 (k=16), A106758 (k=17), A106759 (k=19), A106760 (k=20), A106761 (k=22), A106762 (k=23), A106763 (k=25), A106764 (k=26), A048517 (k=28), A106766 (k=29), A106767 (k=31), A106768 (k=32), A106769 (k=34), A106770 (k=35), A106771 (k=37), A106772 (k=38), A106773 (k=40), A106774 (k=41), A106775 (k=43), A106776 (k=44), A106777 (k=46), A106778 (k=47), A106779 (k=49), A106780 (k=50), A106781 (k=52), A106782 (k=53), A106783 (k=55), A106784 (k=56), A106785 (k=58), A106786 (k=59), A106787 (k=61), A107617 (k=62), A107618 (k=64), A107619 (k=65), A106807 (k=67), A244918 (k=68), A181321 (k=70).
Cf. A020449 (primes with digits 0 and 1), A036953 (primes with digits <= 2), A106100 (primes with largest digit = 2), A069663, A069664 (smallest resp. largest n-digit prime with minimum digit sum).
EXTENSIONS
Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jul 06 2001
Primes with digit sum 10.
+10
13
19, 37, 73, 109, 127, 163, 181, 271, 307, 433, 523, 541, 613, 631, 811, 1009, 1063, 1117, 1153, 1171, 1423, 1531, 1621, 1801, 2017, 2053, 2143, 2161, 2251, 2341, 2503, 2521, 3061, 3313, 3331, 3511, 4051, 4231, 5023, 5113, 6121, 6211, 6301, 8011, 8101
MAPLE
a:=proc(n) local nn: nn:=convert(n, base, 10): if isprime(n)=true and add(nn[j], j=1..nops(nn))=10 then n else end if end proc: seq(a(n), n=1..10^4); # Emeric Deutsch, Mar 06 2008
MATHEMATICA
Select[Prime[Range[100000]], Total[IntegerDigits[#]]==10 &] (* Vincenzo Librandi, Jul 08 2014 *)
PROG
(Magma) [p: p in PrimesUpTo(10000) | &+Intseq(p) eq 10]; // Vincenzo Librandi, Jul 08 2014
(PARI) forprime(p=19, 8101, if(10==sumdigits(p), print(p", "))) \\ Zak Seidov, Oct 08 2016
(Python)
from itertools import count, islice
from sympy import isprime
from sympy.utilities.iterables import multiset_permutations
def agen(b=10, sod=10): # generator for any base, sum-of-digits
if 0 <= sod < b:
yield sod
nzdigs = [i for i in range(1, b) if i <= sod]
nzmultiset = []
for d in range(1, b):
nzmultiset += [d]*(sod//d)
for d in count(2):
fullmultiset = [0]*(d-1-(sod-1)//(b-1)) + nzmultiset
for firstdig in nzdigs:
target_sum, restmultiset = sod - int(firstdig), fullmultiset[:]
restmultiset.remove(firstdig)
for p in multiset_permutations(restmultiset, d-1):
if sum(p) == target_sum:
t = int("".join(map(str, [firstdig]+p)), b)
if isprime(t):
yield t
if p[0] == target_sum:
break
(Python)
from sympy import isprime
"Return a generator of the sequence of all primes >= p with the same digit sum as p."
while True:
if isprime(p): yield p
p = A228915(p) # skip to next larger integer with the same digit sum
CROSSREFS
Cf. A061237 (sum of digits == 1 (mod 9)).
Subsequence of A062340 (primes with digit sum divisible by 5).
Primes with digit sum = 64.
+10
8
19999999, 29999899, 29999989, 39979999, 39999979, 47999899, 48899899, 48989989, 48997999, 48999799, 48999889, 49989799, 49999699, 49999897, 56999989, 58799899, 58898989, 58988899, 58997899, 59698999, 59788999
MATHEMATICA
Select[Prime[Range[3600000]], Total[IntegerDigits[#]]==64&] (* Harvey P. Dale, Jan 19 2012 *)
PROG
(Magma) [p: p in PrimesUpTo(69000000) | &+Intseq(p) eq 64]; // Vincenzo Librandi, Jul 09 2014
CROSSREFS
Cf. similar sequences listed in A244918.
Primes with digit sum = 62.
+10
7
9899999, 18899999, 18999989, 19899989, 19998899, 19998989, 27989999, 27999899, 28998989, 28999979, 29789999, 29798999, 29969999, 29979899, 29988899, 29988989, 29989889, 29997899, 29998799, 29998889, 29999699, 36998999
MATHEMATICA
Select[Prime[Range[600000]], Total[IntegerDigits[#]]==62 &] (* Vincenzo Librandi, Jul 09 2014 *)
PROG
(Magma) [p: p in PrimesUpTo(38000000) | &+Intseq(p) eq 62]; // Vincenzo Librandi, Jul 09 2014
CROSSREFS
Cf. similar sequences listed in A244918.
Primes with digit sum = 65.
+10
6
29999999, 39899999, 39999899, 48999989, 49898999, 49899989, 49979999, 49997999, 57899999, 57998999, 57999899, 58899989, 58989899, 58998899, 59879999, 59898899, 59898989, 59979989, 59987999, 59988989, 59999879
MATHEMATICA
Select[Prime[Range[600000]], Total[IntegerDigits[#]]==65 &] (* Vincenzo Librandi, Jul 09 2014 *)
PROG
(Magma) [p: p in PrimesUpTo(69000000) | &+Intseq(p) eq 65]; // Vincenzo Librandi, Jul 09 2014
CROSSREFS
Cf. Similar sequences listed in A244918.
Primes p with digital sum equal to 13.
+10
5
67, 139, 157, 193, 229, 283, 337, 373, 409, 463, 571, 607, 643, 661, 733, 751, 823, 1039, 1093, 1129, 1237, 1291, 1327, 1381, 1453, 1471, 1543, 1723, 1741, 1831, 2029, 2083, 2137, 2281, 2371, 2551, 2713, 2731, 2803, 3019, 3037, 3109, 3163, 3181, 3217, 3253
MATHEMATICA
Select[Prime[Range[100000]], Total[IntegerDigits[#]]==13 &] (* Vincenzo Librandi, Jul 08 2014 *)
PROG
(Magma) [p: p in PrimesUpTo(10000) | &+Intseq(p) eq 13]; // Vincenzo Librandi, Jul 08 2014
(PARI) select( {is_ A106755(n)=sumdigits(n)==13&&isprime(n)}, primes([1, 3333])) \\ M. F. Hasler, Mar 09 2022
Primes with digit sum = 67.
+10
5
59899999, 69899899, 69899989, 69979999, 69997999, 69999799, 77899999, 78997999, 78998989, 78999889, 78999979, 79699999, 79879999, 79889899, 79979899, 79979989, 79988899, 79989979, 79996999, 79997899, 79997989
COMMENTS
499999909 is the smallest term that contains 0 as a digit. - Altug Alkan, Mar 25 2018
MAPLE
F:= proc(t, d)
if d = 1 then
if t<=9 then return [t] else return [] fi
fi;
if t > 9*d then return [] fi;
[seq(op(map(x -> a*10^(d-1)+x, procname(t-a, d-1))), a=0..min(9, t))]
end proc:
MATHEMATICA
Select[Prime[Range[600000]], Total[IntegerDigits[#]]==67 &] (* Vincenzo Librandi, Jul 09 2014 *)
PROG
(Magma) [p: p in PrimesUpTo(90000000) | &+Intseq(p) eq 67]; // Vincenzo Librandi, Jul 09 2014
(PARI) isok(n) = isprime(n) && (sumdigits(n) == 67); \\ Altug Alkan, Mar 25 2018
CROSSREFS
Cf. similar sequences listed in A244018.
Prime trio leaders: largest number of a prime trio.
+10
5
29, 47, 83, 137, 173, 191, 227, 263, 281, 317, 353, 443, 461, 599, 641, 797, 821, 887, 911, 977, 1019, 1091, 1109, 1163, 1181, 1217, 1307, 1361, 1433, 1451, 1499, 1523, 1613, 1697, 1721, 1787, 1811, 1877, 1901, 1949, 2027, 2063, 2081, 2153, 2207, 2243
COMMENTS
A prime trio is a set of three distinct prime numbers such that the third number is a 1-digit number which is the sum of the digits of the second number and the second number is the sum of the digits of the first number.
EXAMPLE
443 is in the sequence because it is the largest number of the prime trio (443, 11, 2).
599 is the first term with sum of digits different from 11 (cf. A106754), namely 23 (cf. A106762). This sequence contains also all primes with sum of digits equal to 41, 43, 61 etc., but not 29, 47, ... since the second digit sum must be a single-digit prime, i.e., 2, 3, 5 or 7. - M. F. Hasler, Mar 09 2022
MAPLE
filter:= proc(n) local x, y;
if not isprime(n) then return false fi;
x:= convert(convert(n, base, 10), `+`);
if x < 10 or not isprime(x) then return false fi;
y:= convert(convert(x, base, 10), `+`);
member(y, {2, 3, 5, 7})
end proc:
select(filter, [seq(i, i=11..10000, 2)]); # Robert Israel, May 21 2021
MATHEMATICA
ptQ[n_]:=Module[{c=NestList[Total[IntegerDigits[#]]&, n, 2]}, Length[ Union[c]] == 3&&And@@PrimeQ[c]]; Select[Prime[Range[500]], ptQ] (* Harvey P. Dale, Aug 15 2012 *)
PROG
(PARI) select( {is_ A119891(n, s=sumdigits(n))=bittest(172, sumdigits(s)) && isprime(s) && s>9 && isprime(n)}, primes([1, 2345])) \\ M. F. Hasler, Mar 09 2022
AUTHOR
Luc Stevens (lms022(AT)yahoo.com), May 27 2006
Sum of digits of primes ( A007605), sorted and with duplicates removed.
+10
5
2, 3, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 22, 23, 25, 26, 28, 29, 31, 32, 34, 35, 37, 38, 40, 41, 43, 44, 46, 47, 49, 50, 52, 53, 55, 56, 58, 59, 61, 62, 64, 65, 67, 68, 70, 71, 73, 74, 76, 77, 79, 80, 82, 83, 85, 86, 88, 89, 91, 92, 94, 95, 97, 98, 100, 101, 103
COMMENTS
Presumably this is 3 together with numbers greater than 1 and not divisible by 3 (see A001651). - Charles R Greathouse IV, Jul 17 2013. (This is not a theorem because we do not know if, given s > 3 and not a multiple of 3, there is always a prime with digit-sum s. Cf. A067180, A067523. - N. J. A. Sloane, Nov 02 2018)
Conjecture: for s > 10 and not a multiple of 3, there exists a prime with digit-sum s consisting only of the digits 2 and 3 (cf. A137269). This conjecture has been verified for s <= 2995.
Conjecture: for s > 18 and not a multiple of 3, there exists a prime with digit-sum s consisting only of the digits 3 and 4. This conjecture has been verified for s <= 1345.
Conjecture: for s > 90 and not a multiple of 3, there exists a prime with digit-sum s consisting only of the digits 8 and 9. This conjecture has been verified for s <= 8995.
Conjecture: for 0 < a < b < 10, gcd(a, b) = 1 and ab not a multiple of 10, if s > 90 and s is not a multiple of 3, then there exists a prime with digit-sum s consisting only of the digits a and b. (End)
Search completed in 0.011 seconds
|