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-7 of 7 results.

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

A106093 Primes with maximal digit = 9.

Original entry on oeis.org

19, 29, 59, 79, 89, 97, 109, 139, 149, 179, 191, 193, 197, 199, 229, 239, 269, 293, 349, 359, 379, 389, 397, 409, 419, 439, 449, 479, 491, 499, 509, 569, 593, 599, 619, 659, 691, 709, 719, 739, 769, 797, 809, 829, 839, 859, 907, 911, 919, 929, 937, 941, 947
Offset: 1

Views

Author

Zak Seidov and Robert G. Wilson v, May 07 2005

Keywords

Comments

Differs from A062679 in 95th term = 1693; A062679(95) = 1691 = 19*89.

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(2000) | 9 in Intseq(p)]; // Vincenzo Librandi, Nov 22 2015
    
  • Mathematica
    Select[Prime[Range[200]], Max[IntegerDigits[ # ]]==9&]
  • PARI
    forprime(p=2, 1e3, if(vecmax(digits(p)) == 9, print1(p, ", "))) \\ Altug Alkan, Nov 22 2015

A106099 Primes with maximal digit = 3.

Original entry on oeis.org

3, 13, 23, 31, 103, 113, 131, 223, 233, 311, 313, 331, 1013, 1031, 1033, 1103, 1123, 1213, 1223, 1231, 1301, 1303, 1321, 2003, 2113, 2131, 2203, 2213, 2311, 2333, 3001, 3011, 3023, 3121, 3203, 3221, 3301, 3313, 3323, 3331
Offset: 1

Views

Author

Zak Seidov, May 07 2005

Keywords

Crossrefs

Programs

  • Maple
    Res:= 3: count:= 1:
    A:= {3}: B:= {$1..2}:
    for d from 2 while count < 100 do
      A:= {seq(seq(10*a+i,i=0..3),a=A), seq(10*b+3,b=B)}:
      B:= {seq(seq(10*b+i,i=0..2),b=B)}:
      S:= sort(convert(select(isprime,A),list));
      count:= count + nops(S);
      Res:= Res, op(S);
    od:
    Res; # Robert Israel, Jan 01 2019
  • Mathematica
    Select[Prime[Range[600]], Max[IntegerDigits[ # ]]==3&]

A106097 Primes with maximal digit = 5.

Original entry on oeis.org

5, 53, 151, 251, 353, 503, 521, 523, 541, 1051, 1151, 1153, 1451, 1453, 1511, 1523, 1531, 1543, 1553, 2053, 2153, 2251, 2351, 2503, 2521, 2531, 2543, 2551, 3251, 3253, 3511, 3533, 3541
Offset: 1

Views

Author

Zak Seidov, May 07 2005

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[500]], Max[IntegerDigits[ # ]]==5&]

A106098 Primes with maximal digit = 4.

Original entry on oeis.org

41, 43, 241, 401, 421, 431, 433, 443, 1423, 1433, 2141, 2143, 2243, 2341, 2411, 2423, 2441, 3041, 3343, 3413, 3433, 4001, 4003, 4013, 4021, 4111, 4133, 4201, 4211, 4231, 4241, 4243
Offset: 1

Views

Author

Zak Seidov, May 07 2005

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[600]], Max[IntegerDigits[ # ]]==4&]

A221697 Numbers whose largest digit of all divisors is 2.

Original entry on oeis.org

2, 22, 121, 202, 211, 1021, 1201, 2011, 2111, 2221, 2222, 10201, 10211, 12011, 12101, 12211, 12221, 20011, 20021, 20101, 20201, 20222, 21001, 21011, 21101, 21121, 21211, 21221, 22111, 22121, 101021, 101221, 102001, 102101, 102121, 110221, 111121, 111211, 111221, 112111, 112121
Offset: 1

Views

Author

Jaroslav Krizek, Jan 22 2013, corrected Jan 29 2013

Keywords

Comments

Also numbers k such that the largest digit of the concatenation of all the divisors (A037278) of k is 2.
Numbers k such that A209928(k) = 2.
Union of A221698 and A106100.

Examples

			10201 is a term because the largest digit of all the divisors of 10201 (1, 101, 10201) is 2.
		

Crossrefs

Cf. A037278, A106100, A209928 (largest digit of all divisors of n), A221698.

Programs

  • Maple
    isA221697 := proc(n)
          local dgs,d;
          dgs := {} ;
        for d in numtheory[divisors](n) do
            dgs := dgs union convert(convert(d,base,10),set) ;
        end do:
        if max(op(dgs)) = 2 then
            true;
        else
            false;
        end if;
    end proc:
    for n from 2 to 112121 do
        if isA221697(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Jan 30 2013
  • Mathematica
    Select[Range[115000],Max[Flatten[IntegerDigits/@Divisors[#]]]==2&] (* Harvey P. Dale, Dec 15 2014 *)
  • Python
    from sympy import divisors
    def ok(n): return '2' == max("".join(map(str, divisors(n))))
    print([m for m in range(1, 112122) if ok(m)]) # Michael S. Branicky, Feb 22 2021
    
  • Python
    from sympy import isprime, divisors
    from itertools import count, islice, product
    def agen(): # generator of terms
        yield 2
        for d in count(2):
            for f in "12":
                for mid in product("012", repeat=d-2):
                    for e in "12": # ending in zero has 5 as divisor
                        s = f+"".join(mid)+e
                        t = int(s)
                        if "2" in s and isprime(t): yield t; continue
                        if "2" == max("".join(map(str, divisors(t)))): yield t
    print(list(islice(agen(), 50))) # Michael S. Branicky, Aug 03 2022

A221698 Composite numbers n such that largest digit of all divisors of n is 2.

Original entry on oeis.org

22, 121, 202, 1111, 2222, 10201, 12221, 20222, 22121, 111221, 112211, 202222, 220121, 221111, 222211, 1021211, 1112221, 1122011, 1222201, 2021111, 2022002, 2022121, 2121101, 2122111, 2200202, 2202211, 2211121, 2212111, 2222011, 10212211, 11112211, 11121011
Offset: 1

Views

Author

Jaroslav Krizek, Jan 22 2013

Keywords

Comments

Also composite numbers n such that largest digit of concatenation of all divisors (A037278) of n is 2.
Composite numbers n such that A209928(n) = 2.
Complement of A106100 with respect to A221697.

Examples

			Number 10201 is in the sequence because the largest digit of all divisors of 10201 (1, 101, 10201) is 2.
		

Crossrefs

Cf. A209928 (largest digit of all divisors of n), A221697.

Programs

  • Mathematica
    t = {}; n = 1; While[Length[t] < 40, n++; m = FromDigits[IntegerDigits[n, 3]]; If[! PrimeQ[m] && Max[Union[Flatten[IntegerDigits[Divisors[m]]]]] <= 2, AppendTo[t, m]]]; t (* T. D. Noe, Jan 30 2013 *)
Showing 1-7 of 7 results.