A062339
Primes whose sum of digits is 4.
Original entry on oeis.org
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
Offset: 1
3001 is a prime with sum of digits = 4, hence belongs to the sequence.
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).
-
[p: p in PrimesUpTo(800000000) | &+Intseq(p) eq 4]; // Vincenzo Librandi, Jul 08 2014
-
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:
sort(convert(A,list)); # Robert Israel, Dec 28 2015
-
Union[FromDigits/@Select[Flatten[Table[Tuples[{0,1,2,3},k],{k,9}],1],PrimeQ[FromDigits[#]]&&Total[#]==4&]] (* Jayanta Basu, May 19 2013 *)
FromDigits/@Select[Tuples[{0,1,2,3},10],Total[#]==4&&PrimeQ[FromDigits[#]]&] (* Harvey P. Dale, Jul 23 2025 *)
-
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
-
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
-
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
Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jul 06 2001
A069665
Smallest n-digit square with maximum digit sum.
Original entry on oeis.org
9, 49, 289, 6889, 97969, 698896, 9696996, 79869969, 876988996, 8998988769, 88998998929, 975979998889, 9998768898889, 97888999968769, 898999897988929, 9895699989899689, 38999699989995889, 989879999979599689
Offset: 1
More terms from Larry Reeves (larryr(AT)acm.org), Oct 14 2003
A069666
Largest n-digit square with maximum digit sum.
Original entry on oeis.org
9, 49, 784, 6889, 97969, 877969, 9696996, 88679889, 876988996, 8998988769, 88998998929, 975979998889, 9998768898889, 97888999968769, 898999897988929, 9896999999766889, 99497897999899876, 989879999979599689
Offset: 1
Corrected and extended by Larry Reeves (larryr(AT)acm.org), Oct 14 2003
A069667
Smallest nontrivial (no trailing zeros) n-digit square with minimum digit sum.
Original entry on oeis.org
1, 16, 121, 1024, 10201, 101124, 1002001, 24000201, 100020001, 2500100001, 10000200001, 141001001001, 1000002000001, 25000010000001, 100000020000001, 2500000100000001, 10000000200000001, 250000001000000001
Offset: 1
More terms from Larry Reeves (larryr(AT)acm.org), Oct 15 2003
A069668
Largest nontrivial (no trailing zeros) n-digit square with minimum digit sum.
Original entry on oeis.org
1, 25, 121, 2401, 10201, 301401, 1002001, 25010001, 100020001, 2500100001, 10000200001, 250001000001, 1000002000001, 25000010000001, 100000020000001, 2500000100000001, 10000000200000001, 250000001000000001
Offset: 1
Corrected and extended by Larry Reeves (larryr(AT)acm.org), Oct 15 2003
A069669
Smallest n-digit triangular number with maximum digit sum.
Original entry on oeis.org
6, 78, 496, 8778, 58996, 887778, 5897895, 88877778, 686999778, 9876799878, 89996788896, 777887999778, 7798988788878, 77779987999896, 589598998999878, 7898898998885986, 78999997699698778, 999699998689998991
Offset: 1
More terms from Larry Reeves (larryr(AT)acm.org), Oct 15 2003
A069670
Largest n-digit triangular number with maximum digit sum.
Original entry on oeis.org
6, 78, 946, 8778, 58996, 998991, 9979278, 98989485, 886899786, 9998888991, 89996788896, 999998497578, 9869988988965, 99989985868878, 988895779999896, 9999678588989986, 99889886986899778, 999699998689998991
Offset: 1
More terms from Larry Reeves (larryr(AT)acm.org), Oct 15 2003
A069671
Smallest n-digit triangular number with minimum digit sum.
Original entry on oeis.org
1, 10, 120, 2211, 10011, 112101, 2001000, 10006101, 200010000, 1210000221, 20000100000, 210010000005, 2000001000000, 32000004000000, 200000010000000, 3200000040000000, 20000000100000000, 320000000400000000, 2000000001000000000, 32000000004000000000
Offset: 1
A069672
Largest n-digit triangular number with minimum digit sum.
Original entry on oeis.org
1, 10, 300, 3003, 20100, 112101, 2001000, 33020001, 200010000, 3200120001, 20000100000, 320001200001, 2000001000000, 32000012000001, 200000010000000, 3200000120000001, 20000000100000000, 320000001200000001, 2000000001000000000, 32000000012000000001, 200000000010000000000, 3200000000120000000001, 20000000000100000000000, 320000000001200000000001, 2000000000001000000000000, 32000000000012000000000001, 200000000000010000000000000, 3200000000000120000000000001, 20000000000000100000000000000, 320000000000001200000000000001
Offset: 1
Cf.
A069661,
A069662,
A069663,
A069664,
A069665,
A069666,
A069667,
A069668,
A069669,
A069670,
A069671.
-
F:= proc(d)
local s, P, nP, S, x, bestx;
bestx:= 0;
for s in [1,3,6,9] do
for P in map(op @combinat:-permute, combinat:-partition(s)) do
nP:= nops(P);
for S in map(t -> [d-1, op(t)], combinat:-choose([$0..d-2],nP-1)) do
x:= add(P[i]*10^S[i],i=1..nP);
if x > bestx and issqr(1+8*x) then bestx:= x fi;
od;
od;
if bestx > 0 then return bestx fi;
od;
end proc:
seq(F(d),d=1..30); # Robert Israel, May 25 2016
Showing 1-9 of 9 results.
Comments