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 12 results. Next

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

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

A106754 Primes p with digital sum equal to 11.

Original entry on oeis.org

29, 47, 83, 137, 173, 191, 227, 263, 281, 317, 353, 443, 461, 641, 821, 911, 1019, 1091, 1109, 1163, 1181, 1217, 1307, 1361, 1433, 1451, 1523, 1613, 1721, 1811, 1901, 2027, 2063, 2081, 2153, 2207, 2243, 2333, 2351, 2423, 2441, 2531, 2621, 2711, 2801, 3251
Offset: 1

Views

Author

Zak Seidov, May 16 2005

Keywords

Crossrefs

Cf. A000040 (primes), A007953 (sum of digits), A166311 (digit sum = 11).
Cf. A062339 (same for digit sum s = 4), ..., A107579 (s = 10), A106755 (s = 13), and others listed in A244918 (s = 68).
Subsequence of A119891 (prime trios: chain of prime sums of digits; also has as subsequence A106762 (s = 23), A106774 (s = 41), etc).

Programs

  • Magma
    [p: p in PrimesUpTo(10000) | &+Intseq(p) eq 11]; // Vincenzo Librandi, Jul 08 2014
    
  • Mathematica
    Select[Prime[Range[100000]], Total[IntegerDigits[#]]==11 &] (* Vincenzo Librandi, Jul 08 2014 *)
  • PARI
    select( {is_A106754(n)=sumdigits(n)==11&&isprime(n)}, primes([1, 3333])) \\ M. F. Hasler, Mar 09 2022

Formula

Intersection of A000040 (primes) and A166311 (digit sum = 11), also equals { p in A000040 | A007953(p) = 11 }. - M. F. Hasler, Mar 09 2022

A106764 Primes with digit sum = 26.

Original entry on oeis.org

1889, 1979, 1997, 2699, 2789, 2879, 2897, 2969, 3779, 3797, 4679, 4787, 4877, 4967, 5399, 5669, 5849, 5867, 5939, 6299, 6389, 6569, 6659, 6857, 6947, 6983, 7487, 7559, 7577, 7649, 7757, 7793, 7829, 7883, 7919, 7937, 8297, 8369, 8387, 8693, 8747, 8783
Offset: 1

Views

Author

Zak Seidov, May 16 2005

Keywords

Crossrefs

Cf. similar sequences listed in A244918.

Programs

  • Magma
    [p: p in PrimesUpTo(9000) | &+Intseq(p) eq 26]; // Vincenzo Librandi, Jul 08 2014
    
  • Mathematica
    Select[Prime[Range[1300]],Total[IntegerDigits[#]]==26&]  (* Harvey P. Dale, Feb 14 2011 *)
  • PARI
    select(x->sumdigits(x)==26, primes(1000)) \\ Michel Marcus, Jul 08 2014
    
  • Python
    a=A107579(p=1889); [next(a) for A107579.%20-%20_M.%20F.%20Hasler"> in range(50)]  # providing optional 1st arg = initial term, to "universal" code in A107579. - _M. F. Hasler, Mar 16 2022

A158473 Primes whose digit sum contains one or more digits of the same prime.

Original entry on oeis.org

2, 3, 5, 7, 19, 109, 127, 137, 139, 149, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 271, 281, 283, 307, 317, 337, 347, 367, 373, 379, 397, 419, 461, 463, 467, 491, 541, 557, 571, 613, 617, 619, 631, 641, 643, 647, 661, 673, 691, 719, 733, 739, 743, 751
Offset: 1

Views

Author

Parthasarathy Nambi, Mar 20 2009

Keywords

Examples

			139 is a prime whose digit sum of 13 contains the digits 1 and 3 which are also in the prime.
149 is a prime whose digit sum of 14 contains the digits 1 and 4 which are also in the prime.
419 is a prime whose digit sum of 14 contains the digits 1 and 4 which are also in the prime.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,s;
      L:= convert(n,base,10);
      s:= convert(L,`+`);
      convert(convert(s,base,10),set) intersect convert(L,set) <> {}
    end proc:
    select(filter, [seq(ithprime(i),i=1..100)]); # Robert Israel, Feb 27 2023
  • PARI
    isok(p) = isprime(p) && (#setintersect(Set(digits(p)), Set(digits(sumdigits(p)))) >= 1); \\ Michel Marcus, Nov 12 2017

Extensions

Single-digit primes added by R. J. Mathar, Jul 08 2009
Typos in data corrected by D. S. McNeil and Andrew Weimholt, Aug 17 2010

A181321 Primes with digital sum 70.

Original entry on oeis.org

189997999, 199799989, 199898899, 199997899, 199997989, 199998889, 268999999, 269998999, 278989999, 278999989, 279889999, 279988999, 287998999, 287999989, 288998989, 288999889, 288999979, 289699999, 289789999, 289889989
Offset: 1

Views

Author

Zak Seidov, Jan 26 2011

Keywords

Comments

The sequence begins with 8438 9-digit numbers.
Then there are 739572 10-digit numbers.
All terms == 7 (mod 18).

Crossrefs

Cf. similar sequences listed in A244918.

Programs

  • Magma
    [p: p in PrimesUpTo(3*10^8) | &+Intseq(p) eq 70]; // Vincenzo Librandi, Jul 09 2014
    
  • Mathematica
    Select[Prime[Range[3*10^8]], Total[IntegerDigits[#]]==70 &] (* Vincenzo Librandi, Jul 09 2014 *)
  • Python
    # see code in A107579 which can be used to produce this sequence by giving the initial term p = 189997999 (or 8*10**7-1, for digit sum 70). - M. F. Hasler, Mar 16 2022

A062340 Primes whose sum of digits is a multiple of 5.

Original entry on oeis.org

5, 19, 23, 37, 41, 73, 109, 113, 127, 131, 163, 181, 271, 307, 311, 389, 401, 433, 479, 523, 541, 569, 587, 613, 631, 659, 677, 811, 839, 857, 929, 947, 983, 997, 1009, 1013, 1031, 1063, 1103, 1117, 1153, 1171, 1289, 1301, 1423, 1487, 1531, 1559, 1621, 1667
Offset: 1

Views

Author

Amarnath Murthy, Jun 21 2001

Keywords

Examples

			569 is a prime with sum of digits = 20, hence belongs to the sequence.
		

Crossrefs

Cf. A007953 (sum of digits), A227793 (sum of digits divisible by 5).
Has as subsequence A062341 (primes with sum of digits s = 5), A107579 (s = 10), A106760 (s = 20), A106763 (s = 25), A106770 (s = 35), A106773 (s = 40), A106780 (s = 50), A106783 (s = 55), A107619 (s = 65) and A181321 (s = 70).
Cf. A062340 (equivalent for 8).

Programs

  • Magma
    [ p: p in PrimesUpTo(10000) | &+Intseq(p) mod 5 eq 0 ]; // Vincenzo Librandi, Apr 02 2011
    
  • Mathematica
    Select[Prime[Range[300]],Divisible[Total[IntegerDigits[#]],5]&] (* Harvey P. Dale, Jul 06 2020 *)
  • PARI
    select( {is_A062340(n)=sumdigits(n)%5==0&&isprime(n)}, primes([1,2000])) \\ M. F. Hasler, Mar 10 2022
  • Python
    from sympy import primerange as primes
    def ok(p): return sum(map(int, str(p)))%5 == 0
    print(list(filter(ok, primes(1, 1668)))) # Michael S. Branicky, May 19 2021
    

Formula

Intersection of A000040 (primes) and A227793 (sum of digits in 5Z). - M. F. Hasler, Mar 10 2022

Extensions

Corrected and extended by Harvey P. Dale and Larry Reeves (larryr(AT)acm.org), Jul 04 2001

A109184 Palindromic primes with digit sum 20.

Original entry on oeis.org

929, 16661, 17471, 36263, 70607, 72227, 73037, 91019, 1074701, 1082801, 1180811, 1262621, 1328231, 1360631, 1508051, 1532351, 1630361, 1712171, 1802081, 3160613, 3218123, 7014107, 7300037, 9002009, 102383201, 102707201, 103282301
Offset: 1

Views

Author

Zak Seidov, Jun 22 2005

Keywords

Comments

Cf. A070250 Palindromic primes with digit sum 10, A107579 Primes with digit sum = 10, A106760 Primes with digit sum = 20, A109185 Palindromic primes with digit sum 40.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[5940000]],PalindromeQ[#]&&Total[IntegerDigits[#]]==20&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 19 2021 *)

A109185 Palindromic primes with digit sum = 40.

Original entry on oeis.org

97879, 98689, 1878781, 1968691, 1976791, 1984891, 3768673, 3784873, 3792973, 3858583, 3948493, 3964693, 7278727, 7392937, 7466647, 7564657, 7654567, 7662667, 7850587, 7916197, 9078709, 9446449, 9470749, 9626269, 9634369
Offset: 1

Views

Author

Zak Seidov, Jun 22 2005

Keywords

Comments

Cf. A070250 Palindromic primes with digit sum = 10, A107579 Primes with digit sum = 10, A106760 Primes with digit sum = 20, A109184 Palindromic primes with digit sum = 20, A109207 Palindromic primes with digit sum = 50.

Crossrefs

Programs

  • Mathematica
    Select[Prime@ Range[9000, 10^6], And[# == Reverse@ #, Total@ # == 40] &@ IntegerDigits@ # &] (* Michael De Vlieger, Dec 18 2015 *)
  • PARI
    isok(n) = isprime(n) && (d=digits(n)) && (Vecrev(d)==d) && (sumdigits(n)==40); \\ Michel Marcus, Dec 18 2015
Showing 1-10 of 12 results. Next