A088273 Duplicate of A049054.
1, 2, 5, 6, 11, 17, 18, 39, 56, 101, 105, 107, 123, 413, 426, 2607
Offset: 1
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
For k=3 we have 10^3+21 = 1000+21 = 1021, which is prime.
q=21; s=""; For[ a=q,a<=q,s="10^n+"<>ToString[ a ]<>":"; n=0; For[ i=1,i< 10^3,If[ PrimeQ[ 10^i+a ],n=1; s=s<>ToString[ i ]<>"," ]; i++ ]; If[ n>0,Print[ s ] ]; a++ ] (* Vladimir Joseph Stephan Orlovsky, May 06 2008 *)
for(n=1,1e4,if(ispseudoprime(10^n+21),print1(n", "))) \\ Charles R Greathouse IV, Jul 20 2011
3001 is a prime with sum of digits = 4, hence belongs to the sequence.
[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
k=5 is a term because 10^5 + 43 = 100043, which is prime.
Select[Range[2*10^3],PrimeQ[10^#+43]&] (* Vladimir Joseph Stephan Orlovsky, Apr 29 2008 *)
is(n)=ispseudoprime(10^n+43) \\ Charles R Greathouse IV, Apr 28 2015
n = 7 we have 10^7+19 = 10000000+19 = 10000019, which is prime.
Select[Range[2*10^3],PrimeQ[10^#+19]&] (* Vladimir Joseph Stephan Orlovsky, Apr 29 2008 *)
is(n)=ispseudoprime(10^n+19) \\ Charles R Greathouse IV, Apr 28 2015
k = 8 ==> 10^8+49 = 100000049, which is prime.
a={};Do[p=10^n+49;If[PrimeQ[p],AppendTo[a,n]],{n,0,10^3,1}];a (* Vladimir Joseph Stephan Orlovsky, Jul 17 2008 *)
for(n=1,1e4,if(ispseudoprime(10^n+49),print1(n", "))) \\ Charles R Greathouse IV, Jul 25 2011
4 is a member since 10^4 + 9 = 10009 is a prime.
Do[ If[ PrimeQ[ 10^n + 9], Print[n]], {n, 0, 10000}] (* Robert G. Wilson v, Dec 16 2004 *)
is(n)=isprime(10^n + 9) \\ Charles R Greathouse IV, Apr 29 2015
For k = 3 we get 10^3 + 31 = 1000 + 31 = 1031, which is prime.
a={}; Do[If[PrimeQ[p=10^n+31], AppendTo[a, n]], {n, 0, 6*10^2}]; a (* Vladimir Joseph Stephan Orlovsky, Aug 07 2008 *)
8 is a term since 10^8 + 7 = 100000007 is a prime.
Do[ If[ PrimeQ[ 10^n + 7], Print[n]], {n, 0, 10000}] (* Robert G. Wilson v, Dec 16 2004 *)
is(n)=isprime(10^n + 7) \\ Charles R Greathouse IV, Apr 29 2015
For n=2 we have 10^2 + 27 = 100 + 27 = 127, which is prime.
Do[ If[ PrimeQ[10^n + 27], Print[n]], {n, 3000}] (* Robert G. Wilson v, Jul 01 2005 *)
Comments