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

A176254 Incorrect duplicate of A062343.

Original entry on oeis.org

17, 53, 71, 233, 251, 431, 521, 1061, 1151, 1223, 1511, 2141, 2213, 2411, 3023, 3041, 3221, 4013, 4211, 6011, 10133, 10313, 10331, 11213, 11321, 11411, 12041, 12113, 13121, 20123, 20231, 21221, 23021, 30113, 31121, 41201, 50111, 100043, 101141
Offset: 1

Views

Author

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

Keywords

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

A061242 Primes of the form 9*k - 1.

Original entry on oeis.org

17, 53, 71, 89, 107, 179, 197, 233, 251, 269, 359, 431, 449, 467, 503, 521, 557, 593, 647, 683, 701, 719, 773, 809, 827, 863, 881, 953, 971, 1061, 1097, 1151, 1187, 1223, 1259, 1277, 1367, 1439, 1493, 1511, 1583, 1601, 1619, 1637, 1709, 1871, 1889, 1907
Offset: 1

Views

Author

Amarnath Murthy, Apr 23 2001

Keywords

Comments

Or, primes of the form 18k - 1. Corresponding values of k are in A138918. - Zak Seidov, Apr 03 2008
From Doug Bell, Mar 23 2009: (Start)
Conjecture: if a(n) = 9x - 1, the integer formed by the repeating digits in the decimal fraction x/a(n) is the smallest integer such that rotating the digits to the left produces a number which is (x+1)/x times larger.
Example: x = 2, a(n) = 17: 2/17 = 0.1176470588235294... repeating with a cycle of 16.
1176470588235294 * 3/2 = 1764705882352941, which is 1176470588235294 rotated to the left.
An additional conjecture is that the values of x from this sequence are the only values where rotating an integer one to the left produces a value (x+1)/x times as large. (End)
The last conjecture is false. For example, for x = 3 we have 230769*(4/3) = 307692, but 9*3-1 = 26 is not in the sequence. - Giovanni Resta, Jul 28 2015
Conjecture: Primes p such that ((x+1)^9-1)/x has 4 irreducible factors of degree 2 over GF(p). - Federico Provvedi, Jun 27 2018

Crossrefs

Cf. A061237, A061238, A061239, A061240, A061241 (p mod 9 = 1, 2, 4, 5 and 7), A138918 (18n - 1 is prime), A258663 (9n - 1 is prime).
Can be partitioned in disjoint subsequences A062343 (primes with sum of digits s = 8), A106758 (s = 17), A106764 (s = 26), A106770 (s = 35), A106776 (s = 44), A106782 (s = 53), A107617 (s = 62), etc.

Programs

  • Magma
    [a: n in [0..250] | IsPrime(a) where a is 9*n - 1 ]; // Vincenzo Librandi, Jun 07 2015
    
  • Maple
    select(isprime, [seq(18*i-1,i=1..1000)]); # Robert Israel, Sep 03 2014
  • Mathematica
    Select[ Range[ 2500 ], PrimeQ[ # ] && Mod[ #, 9 ] == 8 & ]
    Select[9*Range[300] - 1, PrimeQ]
  • PARI
    select( {is(n)=n%9==8&&isprime(n)}, primes([1,2000])) \\ M. F. Hasler, Mar 10 2022
  • Python
    from sympy import prime
    A061242 = [p for p in (prime(n) for n in range(1,10**3)) if not (p+1) % 18]
    # Chai Wah Wu, Sep 02 2014
    

Formula

A010888(a(n)) = 8. - Reinhard Zumkeller, Feb 25 2005
a(n) ~ 6n log n. - Charles R Greathouse IV, May 14 2025

Extensions

More terms from Robert G. Wilson v, May 10 2001
Edited by N. J. A. Sloane at the suggestion of R. J. Mathar, Apr 30 2008
Edited by M. F. Hasler, Mar 10 2022

A107579 Primes with digit sum 10.

Original entry on oeis.org

19, 37, 73, 109, 127, 163, 181, 271, 307, 433, 523, 541, 613, 631, 811, 1009, 1063, 1117, 1153, 1171, 1423, 1531, 1621, 1801, 2017, 2053, 2143, 2161, 2251, 2341, 2503, 2521, 3061, 3313, 3331, 3511, 4051, 4231, 5023, 5113, 6121, 6211, 6301, 8011, 8101
Offset: 1

Views

Author

Zak Seidov, May 16 2005

Keywords

Comments

Subset of A061237 and A117674.

Crossrefs

Cf. A000040 (primes), A007953 (sum of digits), A052224 (digit sum = 10).
Cf. A061237 (sum of digits == 1 (mod 9)).
Subsequence of A062340 (primes with digit sum divisible by 5).
Cf. A062339 (same for digit sum s = 4), A062341 (s = 5), A062343 (s = 8), A106754 (s = 11), and others listed in A244918 (s = 68).

Programs

  • Magma
    [p: p in PrimesUpTo(10000) | &+Intseq(p) eq 10]; // Vincenzo Librandi, Jul 08 2014
    
  • Maple
    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
  • Mathematica
    Select[Prime[Range[100000]], Total[IntegerDigits[#]]==10 &] (* Vincenzo Librandi, Jul 08 2014 *)
  • PARI
    forprime(p=19,8101,if(10==sumdigits(p),print(p","))) \\ Zak Seidov, Oct 08 2016
    
  • PARI
    (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
    
  • Python
    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
    
  • Python
    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

Formula

Intersection of A000040 (primes) and A052224 (digit sum = 10). - M. F. Hasler, Mar 09 2022

Extensions

Edited by N. J. A. Sloane, Feb 20 2009 at the suggestion of Pacha Nambi

A107618 Primes with digit sum = 64.

Original entry on oeis.org

19999999, 29999899, 29999989, 39979999, 39999979, 47999899, 48899899, 48989989, 48997999, 48999799, 48999889, 49989799, 49999699, 49999897, 56999989, 58799899, 58898989, 58988899, 58997899, 59698999, 59788999
Offset: 1

Views

Author

Zak Seidov, May 18 2005

Keywords

Crossrefs

Cf. similar sequences listed in A244918.

Programs

  • Magma
    [p: p in PrimesUpTo(69000000) | &+Intseq(p) eq 64]; // Vincenzo Librandi, Jul 09 2014
  • Mathematica
    Select[Prime[Range[3600000]],Total[IntegerDigits[#]]==64&] (* Harvey P. Dale, Jan 19 2012 *)

A107617 Primes with digit sum = 62.

Original entry on oeis.org

9899999, 18899999, 18999989, 19899989, 19998899, 19998989, 27989999, 27999899, 28998989, 28999979, 29789999, 29798999, 29969999, 29979899, 29988899, 29988989, 29989889, 29997899, 29998799, 29998889, 29999699, 36998999
Offset: 1

Views

Author

Zak Seidov, May 18 2005

Keywords

Crossrefs

Cf. similar sequences listed in A244918.

Programs

  • Magma
    [p: p in PrimesUpTo(38000000) | &+Intseq(p) eq 62]; // Vincenzo Librandi, Jul 09 2014
  • Mathematica
    Select[Prime[Range[600000]], Total[IntegerDigits[#]]==62 &] (* Vincenzo Librandi, Jul 09 2014 *)

A107619 Primes with digit sum = 65.

Original entry on oeis.org

29999999, 39899999, 39999899, 48999989, 49898999, 49899989, 49979999, 49997999, 57899999, 57998999, 57999899, 58899989, 58989899, 58998899, 59879999, 59898899, 59898989, 59979989, 59987999, 59988989, 59999879
Offset: 1

Views

Author

Zak Seidov, May 18 2005

Keywords

Crossrefs

Cf. Similar sequences listed in A244918.

Programs

  • Magma
    [p: p in PrimesUpTo(69000000) | &+Intseq(p) eq 65]; // Vincenzo Librandi, Jul 09 2014
  • Mathematica
    Select[Prime[Range[600000]], Total[IntegerDigits[#]]==65 &] (* Vincenzo Librandi, Jul 09 2014 *)

A106807 Primes with digit sum = 67.

Original entry on oeis.org

59899999, 69899899, 69899989, 69979999, 69997999, 69999799, 77899999, 78997999, 78998989, 78999889, 78999979, 79699999, 79879999, 79889899, 79979899, 79979989, 79988899, 79989979, 79996999, 79997899, 79997989
Offset: 1

Views

Author

Zak Seidov, May 18 2005

Keywords

Comments

499999909 is the smallest term that contains 0 as a digit. - Altug Alkan, Mar 25 2018

Crossrefs

Cf. similar sequences listed in A244018.

Programs

  • Magma
    [p: p in PrimesUpTo(90000000) | &+Intseq(p) eq 67]; // Vincenzo Librandi, Jul 09 2014
    
  • Maple
    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
  • Mathematica
    Select[Prime[Range[600000]], Total[IntegerDigits[#]]==67 &] (* Vincenzo Librandi, Jul 09 2014 *)
  • PARI
    isok(n) = isprime(n) && (sumdigits(n) == 67); \\ Altug Alkan, Mar 25 2018

A062342 Primes whose sum of digits is a multiple of 8.

Original entry on oeis.org

17, 53, 71, 79, 97, 107, 233, 251, 277, 349, 367, 431, 439, 457, 503, 521, 547, 619, 673, 691, 701, 709, 727, 853, 907, 1061, 1069, 1087, 1151, 1223, 1249, 1429, 1447, 1483, 1511, 1601, 1609, 1627, 1663, 1753, 1861, 1933, 1951, 2141, 2213, 2239, 2293
Offset: 1

Views

Author

Amarnath Murthy, Jun 21 2001

Keywords

Examples

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

Crossrefs

Contains A062343 (primes with sum of digits s = 8), A106757 (s = 16), A106768 (s = 32), A106773 (s = 40), A106784 (s = 56) and A107618 (s = 64) as a subsequence.
Subsequence of A062338 (primes with sum of digits divisible by 4) and of A273188 (numbers with sum of digits divisible by 8).

Programs

  • Magma
    [ p: p in PrimesUpTo(10000) | &+Intseq(p) mod 8 eq 0 ]; // Vincenzo Librandi, Apr 02 2011
    
  • Mathematica
    Select[Prime[Range[500]],Divisible[Total[IntegerDigits[#]],8]&] (* Harvey P. Dale, Jun 23 2011 *)
  • PARI
    is(n)= sumdigits(n)%8==0 && isprime(n) \\ Charles R Greathouse IV, Mar 09 2022

Formula

Intersection of A000040 (primes) and A273188 (numbers with sum of digits divisible by 8). - M. F. Hasler, Mar 10 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jul 06 2001
Showing 1-10 of 13 results. Next