cp's OEIS Frontend

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.

Showing 1-10 of 11 results. Next

A176252 Incorrect duplicate of A062337.

Original entry on oeis.org

7, 43, 61, 151, 223, 241, 313, 331, 421, 1033, 1123, 1213, 1231, 1321, 2113, 2131, 2221, 2311, 3121, 4111, 5011, 10141, 11113, 11131, 11311, 12211, 14011, 21121, 21211, 22111, 30211, 101221, 102121, 111121, 111211, 112111, 131011, 310111
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), Apr 13 2010

Keywords

Comments

Original definition: "Smallest primes in growing order where the parts of compositions of integer 7 used as decimal digits enable primes."

A244918 Primes p where the digital sum is equal to 68.

Original entry on oeis.org

59999999, 69999899, 69999989, 78998999, 88989899, 88999979, 89699999, 89799989, 89989799, 89989979, 89997899, 89997989, 89999699, 89999969, 97889999, 98699999, 98879999, 98899799, 98979989, 98988899, 98989889, 98997989, 98998979, 98999969
Offset: 1

Views

Author

Vincenzo Librandi, Jul 08 2014

Keywords

Examples

			69999899 is a prime with sum of the digits = 68, hence belongs to the sequence.
		

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

Programs

  • Magma
    [p: p in PrimesUpTo(100000000) | &+Intseq(p) eq 68];
    
  • Mathematica
    Select[Prime[Range[10000000]], Total[IntegerDigits[#]]==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

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

Views

Author

Amarnath Murthy, Jun 21 2001

Keywords

Comments

Is this sequence (and its brothers A062337, A062341 and A062343) infinite?
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

Examples

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

Crossrefs

Subsequence of A062338, A107288, and A107715 (primes with digits <= 3).
A159352 is a subsequence.
Cf. A000040 (primes), A052218 (digit sum = 4), A061239 (primes == 4 (mod 9)).
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. A049054 (10^k+3 is prime), A159352 (these primes).
Cf. A056807 (3*10^k+1 is prime), A259866 (these primes).
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).

Programs

  • Magma
    [p: p in PrimesUpTo(800000000) | &+Intseq(p) eq 4]; // Vincenzo Librandi, Jul 08 2014
  • 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:
    sort(convert(A,list)); # Robert Israel, Dec 28 2015
  • Mathematica
    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 *)
  • 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
    

Formula

Intersection of A052218 (digit sum 4) and A000040 (primes). - M. F. Hasler, Mar 09 2022

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jul 06 2001
More terms from Rick L. Shepherd, May 23 2005
More terms from Lekraj Beedassy, Dec 19 2007

A062341 Primes whose sum of digits is 5.

Original entry on oeis.org

5, 23, 41, 113, 131, 311, 401, 1013, 1031, 1103, 1301, 2003, 2111, 3011, 4001, 10103, 10211, 10301, 11003, 12011, 12101, 13001, 20021, 20201, 21011, 21101, 30011, 100103, 101021, 101111, 102101, 103001, 120011, 121001, 200003, 200201, 201011, 201101, 202001
Offset: 1

Views

Author

Amarnath Murthy, Jun 21 2001

Keywords

Examples

			1301 belongs to the sequence since it is a prime with sum of digits = 5.
		

Crossrefs

Cf. A000040 (primes), A007953 (sum of digits), A052219 (digit sum = 5).
Cf. A062339 (same for digit sum s = 4), A062337 (s = 7), and others listed in A244918 (s = 68).
Subsequence of A062340 (primes with sum of digits divisible by 5).

Programs

  • Magma
    [p: p in PrimesUpTo(250000) | &+Intseq(p) eq 5]; // Vincenzo Librandi, Jul 08 2014
    
  • Maple
    T:= n-> `if`(n=1, 5, sort(select(isprime, [seq(seq(seq(
        10^(n-1)+1+10^i+10^j+10^k, k=1..j), j=1..i), i=1..n-1),
        seq(10^(n-1)+3+10^i, i=1..n-1)]))[]):
    seq(T(n), n=1..8);  # Alois P. Heinz, Dec 28 2015
  • Mathematica
    Select[Prime[Range[20000]],Total[IntegerDigits[#]]==5&] (* Harvey P. Dale, Nov 24 2013 *)
  • PARI
    \\ From M. F. Hasler, Mar 09 2022: (Start)
    select( {is_A062341(p,s=5)=sumdigits(p)==s&&isprime(p)}, primes([1,10^6])) \\ 2nd optional parameter for similar sequences with other digit sums.
    A062341_upto_length(L,s=5,a=List(),u=[10^k|k<-[0..L-1]])={forvec(d=[[1,L]|i<-[1..s]], isprime(p=vecsum(vecextract(u,d))) && listput(a,p),1); Set(a)} \\ (End)
  • Python
    from sympy import primerange as primes
    def ok(p): return sum(map(int, str(p))) == 5
    print(list(filter(ok, primes(1, 202002)))) # Michael S. Branicky, May 23 2021
    

Formula

Intersection of A000040 (primes) with A052219 (digit sum 5). - M. F. Hasler, Mar 09 2022

Extensions

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

A062343 Primes whose sum of digits is 8.

Original entry on oeis.org

17, 53, 71, 107, 233, 251, 431, 503, 521, 701, 1061, 1151, 1223, 1511, 1601, 2141, 2213, 2411, 3023, 3041, 3203, 3221, 4013, 4211, 5003, 5021, 6011, 6101, 7001, 10007, 10061, 10133, 10151, 10223, 10313, 10331, 10601, 11213, 11321, 11411
Offset: 1

Views

Author

Amarnath Murthy, Jun 21 2001

Keywords

Examples

			1151 belongs to the sequence since it is a prime with sum of digits = 8.
		

Crossrefs

Cf. A000040 (primes), A007953 (sum of digits), A052222 (digit sum = 8).
Cf. A062339 (same for digit sum s = 4), A062341 (s = 5), A062337 (s = 7), A107579 (s = 10), and others listed in A244918 (s = 68).
Subsequence of A062342 (primes with digit sum divisible by 8).

Programs

  • Magma
    [p: p in PrimesUpTo(20000) | &+Intseq(p) eq 8]; // Vincenzo Librandi, Jul 08 2014
    
  • Maple
    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
  • Mathematica
    Select[Prime[Range[500000]], Total[IntegerDigits[#]]==8 &] (* Vincenzo Librandi, Jul 08 2014 *)
  • PARI
    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
    
  • PARI
    {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

Formula

Intersection of A000040 (primes) and A052222 (digit sum 8). - M. F. Hasler, Mar 09 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jul 06 2001

A133223 Sum of digits of primes (A007605), sorted and with duplicates removed.

Original entry on oeis.org

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
Offset: 1

Views

Author

Lekraj Beedassy, Dec 19 2007

Keywords

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)
From Chai Wah Wu, Nov 04 2018: (Start)
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)

Crossrefs

Extensions

Corrected by Jeremy Gardiner, Feb 09 2014

A062338 Primes whose sum of digits is a multiple of 4.

Original entry on oeis.org

13, 17, 31, 53, 71, 79, 97, 103, 107, 211, 233, 251, 277, 349, 367, 389, 431, 439, 457, 479, 503, 521, 547, 569, 587, 619, 659, 673, 677, 691, 701, 709, 727, 839, 853, 857, 907, 929, 947, 983, 1021, 1061, 1069, 1087, 1151, 1201, 1223, 1249, 1289, 1429
Offset: 1

Views

Author

Amarnath Murthy, Jun 21 2001

Keywords

Examples

			349 is a prime with sum of digits =16=4*4, hence belongs to the sequence.
		

Crossrefs

Subsequence of A119449.

Programs

  • Magma
    [ p: p in PrimesUpTo(10000) | &+Intseq(p) mod 4 eq 0 ]; /* Vincenzo Librandi, Apr 02 2011 */
    
  • Maple
    filter:= x -> (convert(convert(x,base,10),`+`) mod 4 = 0) and isprime(x);
    A062338:= select(filter, [seq(2*i+1,i=0..1000)]); # Robert Israel, Apr 20 2014
  • PARI
    is(n)=isprime(n) && sumdigits(n)%4==0 \\ Charles R Greathouse IV, Mar 09 2022

Extensions

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

A118703 Zero-free primes with digit sum equal to 7.

Original entry on oeis.org

7, 43, 61, 151, 223, 241, 313, 331, 421, 1123, 1213, 1231, 1321, 2113, 2131, 2221, 2311, 3121, 4111, 11113, 11131, 11311, 12211, 21121, 21211, 22111, 111121, 111211, 112111
Offset: 1

Views

Author

Zak Seidov, May 20 2006

Keywords

Comments

There are exactly 29 such primes the largest one being 112111.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[11000]],DigitCount[#,10,0]==0&&Total[ IntegerDigits[ #]] == 7&] (* Harvey P. Dale, Dec 04 2020 *)
  • PARI
    isok(n) = isprime(n) && (sumdigits(n) == 7) && (vecmin(digits(n)) != 0); \\ Michel Marcus, Oct 10 2013

A158283 Prime numbers p such that 1 = abs(final digit of p - sum of all the other digits of p).

Original entry on oeis.org

23, 43, 67, 89, 113, 157, 179, 199, 223, 269, 313, 337, 359, 379, 449, 607, 719, 739, 809, 829, 919, 1013, 1033, 1103, 1123, 1213, 1237, 1259, 1279, 1303, 1327, 1439, 1459, 1549, 1619, 1709, 2003, 2069, 2089, 2113, 2137, 2179, 2203, 2269, 2339, 2539
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Mar 15 2009

Keywords

Examples

			23(1=3-2), 43(1=abs(3-4)), 67(1=abs(7-6)), 89(1=abs(9-8)), 113(1=3-(1+1)).
		

Crossrefs

Programs

  • Mathematica
    ps1[n_]:=Module[{idn=IntegerDigits[n]},Abs[Last[idn]-Total[Most[idn]]] == 1]; Select[Prime[Range[400]],ps1] (* Harvey P. Dale, Jul 31 2012 *)

Extensions

Entries checked by R. J. Mathar, May 19 2010

A259144 Number of n-digit primes whose sum of digits is 7.

Original entry on oeis.org

1, 2, 7, 20, 28, 58, 95, 154, 226, 278, 403, 570, 734, 949, 1200, 1515, 1931, 2328, 2908, 3529, 4196, 5034, 5800, 6870, 7871, 9132, 10574, 12359, 14005, 15871, 17924, 20231, 22505, 25903, 28800, 31532, 34830, 38479, 43334, 48847, 52769, 57173, 61545, 67774, 75186
Offset: 1

Views

Author

Zak Seidov, Jun 19 2015

Keywords

Crossrefs

Programs

  • PARI
    a(n)=n--; my(A,B,C,D); sum(a=0,n, A=10^n+10^a+1; sum(b=a,n, B=A+10^b; sum(c=b,n, C=B+10^c; sum(d=c,n, D=C+10^d; sum(e=d,n, isprime(D+10^e)))))) \\ Charles R Greathouse IV, Jun 19 2015

Extensions

More terms from Alois P. Heinz, Jun 19 2015
Showing 1-10 of 11 results. Next