A176251 Incorrect duplicate of A062341.
5, 23, 41, 113, 131, 311, 2111, 10211, 20021, 101021, 101111
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.
69999899 is a prime with sum of the digits = 68, hence belongs to the sequence.
[p: p in PrimesUpTo(100000000) | &+Intseq(p) eq 68];
Select[Prime[Range[10000000]], Total[IntegerDigits[#]]==68 &]
# 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
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
1151 belongs to the sequence since it is a prime with sum of digits = 8.
[p: p in PrimesUpTo(20000) | &+Intseq(p) eq 8]; // Vincenzo Librandi, Jul 08 2014
A062343 := proc(n) option remember ; local p ; if n = 1 then 17; else p := nextprime(procname(n-1)) ; while true do if digsum(p) = 8 then # digsum in oeis.org/transforms.txt return p; else p := nextprime(p) ; end if; end do: end if; end proc: seq(A062343(n),n=1..80) ; # R. J. Mathar, May 22 2025
Select[Prime[Range[500000]], Total[IntegerDigits[#]]==8 &] (* Vincenzo Librandi, Jul 08 2014 *)
select( {is_A062343(p, s=8)=sumdigits(p)==s&&isprime(p)}, primes([1, 12345])) \\ 2nd optional parameter for similar sequences with other digit sums. M. F. Hasler, Mar 09 2022
{A062343_upto_length(L, s=8, 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
[p: p in PrimesUpTo(10000) | &+Intseq(p) eq 10]; // Vincenzo Librandi, Jul 08 2014
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
Select[Prime[Range[100000]], Total[IntegerDigits[#]]==10 &] (* Vincenzo Librandi, Jul 08 2014 *)
forprime(p=19,8101,if(10==sumdigits(p),print(p","))) \\ Zak Seidov, Oct 08 2016
(A107579_nxt(p)=until(isprime(p=A228915(p)),); p); A107579_first(N=100)=vector(N, i, p=if(i>1, A107579_nxt(p), 19)) \\ M. F. Hasler, Mar 15 2022
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 print(list(islice(agen(), 45))) # Michael S. Branicky, Mar 10 2022
from sympy import isprime def A107579(p=19): "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 a=A107579(); [next(a) for in range(50)] # _M. F. Hasler, Mar 16 2022
[p: p in PrimesUpTo(69000000) | &+Intseq(p) eq 64]; // Vincenzo Librandi, Jul 09 2014
Select[Prime[Range[3600000]],Total[IntegerDigits[#]]==64&] (* Harvey P. Dale, Jan 19 2012 *)
[p: p in PrimesUpTo(38000000) | &+Intseq(p) eq 62]; // Vincenzo Librandi, Jul 09 2014
Select[Prime[Range[600000]], Total[IntegerDigits[#]]==62 &] (* Vincenzo Librandi, Jul 09 2014 *)
Do[p = Join[ IntegerDigits[n, 4], Reverse[ Drop[ IntegerDigits[n, 4], -1]]]; q = Plus @@ p; If[q == 5 && PrimeQ[ FromDigits[p]] && q == 5, Print[ FromDigits[p]]], {n, 1, 4 10^8}] (* this coding will not pick up the first entry *)
for(i=0,50,for(j=0,i,p=10^(2*i)+10^(i+j)+10^i+10^(i-j)+1;isprime(p)&&print1(p,", "))) \\ Jeppe Stig Nielsen, Aug 30 2025
[p: p in PrimesUpTo(69000000) | &+Intseq(p) eq 65]; // Vincenzo Librandi, Jul 09 2014
Select[Prime[Range[600000]], Total[IntegerDigits[#]]==65 &] (* Vincenzo Librandi, Jul 09 2014 *)
[p: p in PrimesUpTo(90000000) | &+Intseq(p) eq 67]; // Vincenzo Librandi, Jul 09 2014
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: select(isprime, F(67,8)); # Robert Israel, Mar 25 2018
Select[Prime[Range[600000]], Total[IntegerDigits[#]]==67 &] (* Vincenzo Librandi, Jul 09 2014 *)
isok(n) = isprime(n) && (sumdigits(n) == 67); \\ Altug Alkan, Mar 25 2018
Comments