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

A106757 Primes with digit sum = 16.

Original entry on oeis.org

79, 97, 277, 349, 367, 439, 457, 547, 619, 673, 691, 709, 727, 853, 907, 1069, 1087, 1249, 1429, 1447, 1483, 1609, 1627, 1663, 1753, 1861, 1933, 1951, 2239, 2293, 2347, 2383, 2437, 2473, 2617, 2671, 2707, 2833, 2851, 3049, 3067, 3229, 3319, 3373, 3391
Offset: 1

Views

Author

Zak Seidov, May 16 2005

Keywords

Crossrefs

Cf. A000040 (primes), A007953 (sum of digits), A235227 (digit sum = 16).
Cf. A062339 (same for digit sum s = 4), A106756 (s = 14), A106758 (s = 17), and others listed in A244918 (s = 68).
Subsequence of A062342 (primes whose sum of digits is a multiple of 8) and of A107288 (primes with sum of digits a square).

Programs

  • Magma
    [p: p in PrimesUpTo(4000) | &+Intseq(p) eq 16]; // Vincenzo Librandi, Jul 08 2014
    
  • Mathematica
    Reap[Do[If[16==Apply[Plus,IntegerDigits[p=Prime[n]]],Sow[p]],{n,1000}]][[2,1]] (* Zak Seidov, Oct 30 2009 *)
    Select[Prime[Range[500]],Total[IntegerDigits[#]]==16&] (* Harvey P. Dale, Nov 14 2011 *)
  • PARI
    select( {is_A106757(n)= sumdigits(n)==16 && isprime(n)}, primes([1, 3333])) \\ M. F. Hasler, Mar 09 2022

Formula

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

Extensions

More terms from Zak Seidov, Oct 30 2009

A244863 Semiprimes whose digit sum is a perfect square.

Original entry on oeis.org

4, 9, 10, 22, 121, 169, 178, 187, 202, 259, 295, 301, 358, 394, 466, 493, 529, 538, 565, 583, 655, 718, 745, 763, 781, 799, 817, 835, 862, 871, 889, 898, 934, 943, 961, 979, 1003, 1111, 1159, 1177, 1186, 1195, 1267, 1285, 1294, 1339, 1357, 1366, 1393, 1438, 1465
Offset: 1

Views

Author

K. D. Bajpai, Jul 07 2014

Keywords

Comments

Subsequence of A028839.

Examples

			178 is in the sequence because 178 = 2*89 (semiprime) and 1+7+8 = 16 (square).
187 is in the sequence because 187 = 11*17 (semiprime) and 1+8+7 = 16 (square).
		

Crossrefs

Cf. A107288 (Primes whose digit sum is square).

Programs

  • Maple
    select(n -> numtheory:-bigomega(n)=2 and issqr(convert(convert(n,base,10),`+`)),
    [$1..3000]); # Robert Israel, Jul 09 2014
  • Mathematica
    Select[Range[3000], PrimeOmega[#] == 2 && IntegerQ[Sqrt[Apply [Plus, IntegerDigits[#]]]] &]

A223035 Prime numbers whose digits squared sum to a square.

Original entry on oeis.org

2, 3, 5, 7, 43, 263, 269, 1153, 1531, 1933, 2063, 2069, 2287, 2609, 3319, 3391, 3511, 3931, 4003, 4441, 4801, 4889, 5113, 5399, 5939, 6029, 6067, 6203, 6469, 6607, 8849, 9133, 9539, 10111, 10177, 10513, 10531, 10771, 11149, 11213, 11273, 11321, 11491, 11503
Offset: 1

Views

Author

Keywords

Examples

			269 is a prime number, and 2^2+6^2+9^2 = 121 = 11^2.
		

Crossrefs

Prime numbers from the sequence A175396.

Programs

  • Mathematica
    Select[Prime[Range[2000]], IntegerQ[Sqrt[Total[IntegerDigits[#]^2]]] &] (* T. D. Noe, Apr 05 2013 *)
  • R
    ssod<-function(i) sum(as.numeric(strsplit(as.character(i),"")[[1]])^2)
    issquare<-function(x) as.integer(sqrt(x))==sqrt(x)
    x=as.bigz(c()); i=2
    while(length(x)<10000) {if(issquare(ssod(i))) x=c(x,i); i=nextprime(i)}

A244733 Semiprimes sp such that sp plus its digit sum is a perfect square.

Original entry on oeis.org

38, 86, 161, 614, 662, 998, 1145, 1355, 1829, 2189, 2483, 4607, 5027, 5315, 6377, 7199, 8258, 11435, 13214, 15611, 17933, 19574, 20153, 21305, 21878, 24014, 26867, 30599, 32738, 34199, 36077, 38387, 38777, 40778, 42422, 46211, 51509, 52874, 56618, 58541, 59987
Offset: 1

Views

Author

K. D. Bajpai, Jul 12 2014

Keywords

Examples

			86 is in the sequence because 86 = 2* 43, which is semiprime. Also, 86 + (8 + 6) = 100 = 10^2.
614 is in the sequence because 614 = 2* 307, which is semiprime. Also, 614 + (6 + 1 + 4) = 625 = 25^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[50000], PrimeOmega[#] == 2 && IntegerQ[Sqrt[# + Apply[Plus, IntegerDigits[#]]]] &]

A245064 Primes p such that p minus its digit sum is a perfect cube.

Original entry on oeis.org

2, 3, 5, 7, 31, 37, 223, 227, 229, 743, 1741, 1747, 3391, 5851, 5857, 9281, 9283, 13841, 19709, 27011, 27017, 35963, 35969, 46681, 46687, 59341, 74101, 91141, 110603, 110609, 132679, 373273, 474581, 474583, 729023, 804383, 1061227, 1259743, 1259749, 1481573, 2000393
Offset: 1

Views

Author

K. D. Bajpai, Jul 11 2014

Keywords

Examples

			37 is in the sequence because it is prime. Also, 37 - (3 + 7 ) = 27 = 3^3: a perfect cube.
743 is in the sequence because it is prime. Also, 743 - (7 + 4 + 3) = 729 = 9^3: a perfect cube.
		

Crossrefs

Programs

  • Maple
    dmax:= 9; # to get all entries < 10^dmax
    cmax:= floor(10^(dmax/3));
    count:= 0;
    for m from 0 to cmax do
       for p from m^3 to m^3 + 9*dmax do
          if p - convert(convert(p,base,10),`+`) = m^3 and isprime(p) then
             count:= count+1;
             A[count]:= p;
          fi
       od
    od;
    {seq(A[i],i=1..count)}; # Robert Israel, Jul 15 2014
  • Mathematica
    Select[Prime[Range[200000]], IntegerQ[CubeRoot[# - Apply[Plus, IntegerDigits[#]]]] &]
  • PARI
    digsum(n) = my(d=eval(Vec(Str(n)))); sum(i=1, #d, d[i])
    s=[]; forprime(p=2, 2002000, if(ispower(p-digsum(p), 3), s=concat(s, p))); s \\ Colin Barker, Jul 15 2014

A230087 Primes such that prime plus its digit sum is a perfect square.

Original entry on oeis.org

2, 17, 179, 347, 467, 521, 1433, 1583, 2111, 3347, 10601, 12527, 25889, 28541, 32027, 33113, 39569, 39971, 41201, 43661, 45767, 55667, 58061, 59513, 61001, 62969, 63977, 67061, 70199, 77261, 92387, 92993, 100469, 109541, 120401, 122477, 130307, 156011, 163193
Offset: 1

Views

Author

K. D. Bajpai, Oct 08 2013

Keywords

Comments

Number of primes obtained from the sequence ‘prime plus its digit sum is perfect square’ is 150 for n = 1 to 3*10^5, while the sequence for ‘perfect cube’ yields only 11 primes for the same range of n. Hence, sequence for ‘square’ is framed.
Subsequence of primes of A066564. - Michel Marcus, Jun 02 2015

Examples

			a(2) = 17 is prime. Digit sum of 17 = 8, 17 + 8 = 25 = 5^2.
a(5) = 467 is prime. Digit sum of 467 = 17, 467 + 17 = 484 = 22^2.
		

Crossrefs

Cf. A048519.
Cf. A107288 (Primes whose digit sum is square).

Programs

  • Magma
    [p: p in PrimesUpTo(6*10^5) | IsSquare(p+(&+Intseq(p)))]; // Vincenzo Librandi, Jun 02 2015
  • Maple
    KD:= proc() local a,b,c,d; a:= ithprime(n);b:=add( i,i = convert((a), base, 10))(a); c:=a+b; d:=evalf(sqrt(c)); if d=floor(d) then return (a) :fi;end:seq(KD(),n=1..50000);
  • PARI
    for(n=2,1e4,forprime(p=n^2-9*#digits(n^2),n^2, if(p+sumdigits(p) == n^2, print1(p", ")))) \\ Charles R Greathouse IV, Oct 08 2013
    

Extensions

a(1) from Charles R Greathouse IV, Oct 08 2013
Showing 1-7 of 7 results.