login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A062339 Primes whose sum of digits is 4. 26

%I #50 Jan 28 2023 12:21:45

%S 13,31,103,211,1021,1201,2011,3001,10111,20011,20101,21001,100003,

%T 102001,1000003,1011001,1020001,1100101,2100001,10010101,10100011,

%U 20001001,30000001,101001001,200001001,1000000021,1000001011,1000010101,1000020001,1000200001,1002000001,1010000011

%N Primes whose sum of digits is 4.

%C This is a subsequence of A062338. Is this sequence (and its brothers A062337, A062341 and A062343) infinite?

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

%C Subsequence of A107288. - _Zak Seidov_, Oct 29 2009

%C Includes A159352. - _Robert Israel_, Dec 28 2015

%H T. D. Noe and Robert Israel, <a href="/A062339/b062339.txt">Table of n, a(n) for n = 1..10000</a> (n = 1..1000 from T. D. Noe)

%H Amin Witno, <a href="http://www.ijopcm.org/Vol/10/IJOPCM(vol.3.2.3.J.10).pdf">Numbers which factor as their digital sum times a prime</a>, International Journal of Open Problems in Computer Science and Mathematics 3:2 (2010), pp. 132-136.

%F Intersection of A052218 (digit sum 4) and A000040 (primes). - _M. F. Hasler_, Mar 09 2022

%e 3001 is a prime with sum of digits = 4, hence belongs to the sequence.

%p N:= 20: # to get all terms < 10^N

%p B[1]:= {1}:

%p B[2]:= {2}:

%p B[3]:= {3}:

%p A:= {}:

%p for d from 2 to N do

%p B[4]:= map(t -> 10*t+1,B[3]) union map(t -> 10*t+3,B[1]);

%p B[3]:= map(t -> 10*t, B[3]) union map(t -> 10*t+1,B[2]) union map(t -> 10*t+2,B[1]);

%p B[2]:= map(t -> 10*t, B[2]) union map(t -> 10*t+1,B[1]);

%p B[1]:= map(t -> 10*t, B[1]);

%p A:= A union select(isprime,B[4]);

%p od:

%p sort(convert(A,list)); # _Robert Israel_, Dec 28 2015

%t Union[FromDigits/@Select[Flatten[Table[Tuples[{0,1,2,3},k],{k,9}],1],PrimeQ[FromDigits[#]]&&Total[#]==4&]] (* _Jayanta Basu_, May 19 2013 *)

%o (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

%o From _M. F. Hasler_, Mar 09 2022: (Start)

%o (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

%o (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)} \\ (End)

%o (Magma) [p: p in PrimesUpTo(800000000) | &+Intseq(p) eq 4]; // _Vincenzo Librandi_, Jul 08 2014

%Y Cf. A000040 (primes), A052218 (digit sum = 4), A061239 (primes == 4 (mod 9)).

%Y 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).

%Y Cf. A049054 (10^k+3 is prime), A159352 (these primes).

%Y Cf. A056807 (3*10^k+1 is prime), A259866 (these primes).

%Y Subsequence of A107715 (primes with digits <= 3).

%Y 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).

%K nonn,base

%O 1,1

%A _Amarnath Murthy_, Jun 21 2001

%E Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jul 06 2001

%E More terms from _Rick L. Shepherd_, May 23 2005

%E More terms from _Lekraj Beedassy_, Dec 19 2007

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 09:26 EDT 2024. Contains 371967 sequences. (Running on oeis4.)