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.

Previous Showing 31-40 of 62 results. Next

A249448 Largest n-digit prime whose digit sum is also prime.

Original entry on oeis.org

7, 89, 991, 9967, 99991, 999983, 9999971, 99999989, 999999937, 9999999943, 99999999821, 999999999989, 9999999999971, 99999999999923, 999999999999883, 9999999999999851, 99999999999999997, 999999999999999967, 9999999999999999919, 99999999999999999989, 999999999999999999829
Offset: 1

Views

Author

Paolo P. Lava, Oct 29 2014

Keywords

Comments

Subsequence of A046704 (primes with digit sum being prime).
Some terms of this sequence are also in A003618, the largest n-digit primes.

Examples

			a(1) = 7 because it is the largest prime with just one digit.
a(2) = 89 because it is the largest prime with 2 digits whose sum, 8 + 9 = 17, is a prime.
Again, a(7) = 9999971 because it is the largest prime with 7 digits whose sum is a prime: 9 + 9 + 9 + 9 + 9 + 7 + 1 = 53.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,k,n; for k from 0 to q do
    for n from 10^(k+1)-1 by -1 to 10^k do if isprime(n) then a:=n; b:=0;
    while a>0 do b:=b+(a mod 10); a:=trunc(a/10); od;
    if isprime(b) then print(n); break; fi; fi;
    od; od; end: P(10^3);
  • Mathematica
    Table[Module[{p=NextPrime[10^n,-1]},While[!PrimeQ[Total[IntegerDigits[p]]],p=NextPrime[p,-1]];p],{n,25}] (* Harvey P. Dale, Jun 20 2023 *)
  • PARI
    a(n) = {p = precprime(10^n); while (!isprime(sumdigits(p)), p = precprime(p-1)); p;} \\ Michel Marcus, Oct 29 2014

A330653 The prime numbers whose digit sum, adjacent digit sum concatenation, and adjacent digit difference concatenation are also primes.

Original entry on oeis.org

29, 41, 47, 61, 83, 101, 263, 281, 401, 463, 601, 607, 661, 809, 821, 863, 1129, 1303, 2063, 2267, 3121, 3181, 3301, 3343, 4001, 4603, 5309, 5581, 6007, 6043, 6803, 6863, 7129, 7309, 8009, 8681, 8821, 9721, 9967, 10903, 10909, 14143, 16903, 17209, 18521, 19421, 20063, 20201, 20407, 20807, 21143, 24281, 25147
Offset: 1

Views

Author

Scott R. Shannon, Dec 22 2019

Keywords

Comments

This sequence lists the prime numbers whose digit sum A007953, concatenation of adjacent digit sums A053392, and concatenation of adjacent digit differences A040115, are also primes. Due to the digit sum being prime this is a subsequence of A046704.
For primes up to ten million there are 2268 entries, which is about one prime in every 293. The largest digit sum is 53 for a(1482) = 5986889, the largest adjacent digit sum concatenation is 171818141113 for a(2076) = 8999567, and the largest adjacent digit difference concatenation is 993247 for a(2099) = 9096481.

Examples

			a(1) = 29, as 2 + 9 = 11, '2 + 9' = 11, '|2 - 9|' = 7, and 29, 11, 7 are all prime.
a(7) = 263, as 2 + 6 + 3 = 11, '2 + 6' + '6 + 3' = 89, '|2 - 6|' + '|6 - 3|' = 43, and 263, 11, 89, 43 are all prime.
a(25) = 4001, as 4 + 0 + 0 + 1 = 5, '4 + 0' + '0 + 0' + '0 + 1' = 401, '|4 - 0|' + '|0 - 0|' + '|0 - 1|' = 401, and 4001, 5, 401 are all prime.
		

Crossrefs

A087340 Primes p such that the sum of the digits of p as well as 1 plus the product of its digits are also primes.

Original entry on oeis.org

2, 11, 23, 29, 41, 43, 47, 61, 67, 89, 223, 227, 229, 263, 269, 281, 463, 643, 661, 821, 827, 883, 887, 1123, 1129, 1163, 1213, 1231, 1237, 1279, 1291, 1297, 1321, 1327, 1361, 1367, 1433, 1439, 1453, 1459, 1471, 1493, 1523, 1543, 1549, 1567, 1613, 1637
Offset: 1

Views

Author

Amarnath Murthy, Sep 06 2003

Keywords

Crossrefs

Cf. A087339.

Programs

  • Magma
    [p: p in PrimesUpTo(1700) | IsPrime(&+Intseq(p)) and IsPrime(1+&*Intseq(p))]; // Bruno Berselli, Apr 09 2013
  • Mathematica
    Select[Select[Prime[Range[280]], PrimeQ[Plus@@IntegerDigits[ # ]]&], PrimeQ[Times@@IntegerDigits[ # ]+1]&] (from Harvey Dale)

Formula

A066725 INTERSECT A046704. - R. J. Mathar, Aug 26 2007

Extensions

Edited and extended by Robert G. Wilson v, Sep 07 2003

A109982 Primes p such that index of p, the sum of p's digits and the number of p's digits are all primes.

Original entry on oeis.org

11, 41, 67, 83, 157, 179, 191, 241, 283, 331, 353, 401, 461, 599, 739, 773, 797, 919, 991, 10079, 10169, 10433, 10457, 10589, 10631, 10723, 10853, 10909, 11311, 11447, 11867, 11953, 12097, 12143, 12301, 12457, 12479, 12503, 12547, 12763, 13003
Offset: 1

Views

Author

Zak Seidov, Jul 06 2005

Keywords

Examples

			a(414) = 99551 because its index, 9551, the sum, 29 and number, 5, of digits are all primes.
		

Crossrefs

Cf. A046704 Additive primes: sum of digits is a prime, A088136 Primes such that sum of first and last digits is prime, A109981 Primes such that the sum of digits and the number of digits are primes.

Programs

  • Mathematica
    Select[Prime[Range[200]], PrimeQ[Length[IntegerDigits[ # ]]]&&PrimeQ[Plus@@IntegerDigits[ # ]]&]
    Select[Prime[Range[1600]],AllTrue[{PrimePi[#],Total[IntegerDigits[#]], IntegerLength[ #]}, PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 15 2019 *)

A118571 Sophie Germain primes whose sum of digits is a prime.

Original entry on oeis.org

2, 3, 5, 11, 23, 29, 41, 83, 89, 113, 131, 173, 179, 191, 281, 359, 443, 593, 641, 683, 719, 809, 911, 953, 1013, 1019, 1031, 1103, 1439, 1451, 1499, 1583, 1811, 1901, 2003, 2063, 2069, 2339, 2351, 2393, 2399, 2753, 2939, 3299, 3329, 3389, 3413, 3491, 3761
Offset: 1

Views

Author

Luc Stevens (lms022(AT)yahoo.com), May 07 2006

Keywords

Examples

			191 is in the sequence because it is a Sophie Germain prime and the sum of its digits 1+9+1 = 11 is a prime.
		

Crossrefs

Intersection of A005384 and A028834.
Subsequence of A046704.

Programs

  • Mathematica
    Select[Range[4000], PrimeQ[#] && PrimeQ[2*# + 1] && PrimeQ[Plus @@ IntegerDigits[#]] &] (* Amiram Eldar, Feb 08 2021 *)
    Select[Prime[Range[600]],AllTrue[{2#+1,Total[IntegerDigits[#]]},PrimeQ]&] (* Harvey P. Dale, Mar 08 2025 *)

A172035 Smallest exponent k > 1 that sum of digits of k-th power of the n-th prime is a prime (n=1,2,...) or 0 if no such k exists.

Original entry on oeis.org

5, 0, 2, 2, 9, 3, 2, 5, 3, 2, 7, 2, 4, 5, 2, 2, 5, 2, 3, 6, 2, 2, 2, 2, 4, 8, 4, 2, 2, 4, 2, 8, 2, 3, 2, 2, 4, 4, 6, 2, 4, 2, 10, 3, 4, 2, 3, 2, 4, 3, 5, 6, 3, 4, 4, 2, 2, 2, 2, 2, 3, 4, 3, 3, 3, 5, 3, 3, 8, 2, 3, 12, 2, 3, 2, 5, 2, 3, 8, 16, 8, 3, 4, 2, 3, 2, 4, 2, 2, 5, 7, 4, 3, 8, 3, 2, 6, 2, 3, 6, 2, 2, 10
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), Jan 23 2010

Keywords

Comments

k = 1 is the "trivial" case: sod(prime(n)) = prime(m)
n = 2, prime(2) = 3: 3^k is for k > 1 a multiple of 3^2.

Examples

			sod(2^5)=5, sod(5^2)=7, sod(7^2)=13, sod(11^9)=53, sod(13^3)=19, sod(17^2)=19, sod(19^5)=37, sod(23^3)=17, sod(29^2)=13, sod(31^7)=31, sod(37^2)=19, sod(41^4)=31, sod(43^5)=31, sod(47^2)=13, sod(53^2)=19, sod(59^5)=47, sod(61^2)=13, sod(67^3)=19, sod(71^6)=37, sod(73^2)=19, sod(79^2)=13, sod(83^2)=31, sod(89^2)=19, sod(97^4)=43, sod(101^8)=67, sod(103^4)=31, sod(107^2)=19, sod(109^2)=19, sod(113^4)=31, sod(127^2)=19, sod(131^8)=61, sod(137^2)=31, sod(139^3)=37, sod(149^2)=7, sod(151^2)=13, sod(157^4)=31, sod(163^4)=37, sod(167^6)=73, sod(173^2)=31, sod(179^4)=37, sod(181^2)=19, sod(191^10)=97, sod(193^3)=37, sod(197^4)=37, sod(199^2)=19, sod(211^3)=37, sod(223^2)=31, sod(227^4)=43, sod(229^3)=37.
		

References

  • M. Fujiwara, Y. Ogawa: Introduction to truly beautiful Mathematics, Chikuma Shobo, Tokyo 2005.
  • Theo Kempermann, Zahlentheoretische Kostproben, Harri Deutsch, 2. aktualisierte Auflage 2005.
  • Hans Schubart: Einfuehrung in die klassische und moderne Zahlentheorie, Vieweg, Braunschweig 1974.

Crossrefs

Cf. A172216. - Klaus Brockhaus, Jan 29 2010

Programs

  • Magma
    S:=[ 5, 0 ]; for n in [3..103] do j:=2; while not IsPrime(&+Intseq(NthPrime(n)^j)) do j+:=1; end while; Append(~S, j); end for; S; // Klaus Brockhaus, Jan 29 2010

Extensions

More terms from Klaus Brockhaus, Jan 29 2010
Edited by Charles R Greathouse IV, Aug 02 2010

A176179 Primes such that the sum of digits, the sum of the squares of digits and the sum of 3rd powers of their digits is also a prime.

Original entry on oeis.org

11, 101, 113, 131, 199, 223, 311, 337, 353, 373, 449, 461, 463, 641, 643, 661, 733, 829, 883, 919, 991, 1013, 1031, 1103, 1301, 1439, 1451, 1471, 1493, 1499, 1697, 1741, 1949, 2089, 2111, 2203, 2333, 2441, 2557, 3011, 3037, 3307, 3323, 3347, 3491, 3583, 3637, 3659, 3673, 3853, 4049, 4111, 4139, 4241, 4337, 4373, 4391, 4409
Offset: 1

Views

Author

Michel Lagneau, Apr 10 2010

Keywords

Comments

See A091365 for the exceptions for the case where the sum of the digits of p is not prime, but the sum of the cubes of the digits of p is prime.

Examples

			For the prime number n =5693 we obtain :
5 + 6 + 9 + 3 = 23 ;
5^2 + 6^2 + 9^2 + 3^2 = 151 ;
5^3 + 6^3 + 9^3 + 3^3 = 1097.
		

References

  • Charles W. Trigg, Journal of Recreational Mathematics, Vol. 20(2), 1988.

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 2 to 10000 do:l:=evalf(floor(ilog10(n))+1):n0:=n:s1:=0:s2:=0:s3:=0:for m from 1 to l do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :s1:=s1+u:s2:=s2+u^2:s3:=s3+u^3:od:if type(n,prime)=true and type(s1,prime)=true and type(s2,prime)=true and type(s3,prime)=true then print(n):else fi:od:
  • Mathematica
    okQ[n_]:=Module[{idn=IntegerDigits[n]}, And@@PrimeQ[Total/@{idn,idn^2,idn^3}]]; Select[Prime[Range[600]],okQ]  (* Harvey P. Dale, Jan 18 2011 *)
  • Python
    from sympy import isprime, primerange
    def ok(p):
        return all(isprime(sum(int(d)**k for d in str(p))) for k in [1, 2, 3])
    def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
    print(aupto(4409)) # Michael S. Branicky, Nov 23 2021

Extensions

Corrected and extended by Harvey P. Dale, Jan 18 2011

A239790 The smallest multidigit prime of a sequence of n consecutive primes such that their digit sums are also a sequence of n consecutive primes.

Original entry on oeis.org

11, 41, 41, 191, 402131, 6340271501
Offset: 1

Views

Author

Carlos Rivera, Mar 26 2014

Keywords

Comments

a(7), if it exists, is larger than 2*10^14. - Giovanni Resta, Apr 03 2014
a(7) <= 101100010001001200110001. - Jens Kruse Andersen, Aug 28 2016
a(7) <= 1212030150560200001. - Oscar Volpatti, Aug 25 2025

Examples

			a(4)=191 because 191, 193, 197, 199 generates 11, 13, 17, 19.
a(5)=402131 because 402131, 402133, 402137, 402139, 402197 generates 11,13,17,19,23.
		

Crossrefs

Programs

  • PARI
    isok(p, n) = if ((p > 10) && isprime(p), my(v=vector(n)); v[1] = p; for (i=2, n, v[i] = nextprime(v[i-1]+1);); my(vs=vector(n, i, sumdigits(v[i]))); if (!isprime(vs[1]), return(0)); for (i=2, n, if (vs[i] != nextprime(vs[i-1]+1), return(0));); return(1););
    a(n) = my(k=1); while (!isok(k, n), k++); k; \\ Michel Marcus, Aug 28 2025
  • UBASIC
    10   P=7:KM=0:'puzzle 1290, Meller
       20   P=nxtprm(P):if P>2^32-20 then end
       30   gosub *K:if K<=KM then goto 20
       40   print K,P,Q1:KM=K:goto 20
      100   *K
      110   Z=P:gosub *SODZ
      120   if SODZ<>prmdiv(SODZ) then return
      130   K=1:Q=SODZ:Q1=Q
      140   Z=nxtprm(Z):gosub *SODZ
      150   if SODZ<>nxtprm(Q) then return
      160   K=K+1:Q=nxtprm(Q):goto 140
      200   *SODZ:SODZ=0:L=alen(Z)
      210   for I=1 to L:D=val(mid(str(Z),I+1,1))
      220   SODZ=SODZ+D:next I
      230   return
    

Extensions

a(6) from Giovanni Resta, Apr 03 2014

A331031 The prime numbers that are prime-indexed primes and whose digit sum, adjacent digit sum concatenation, and adjacent digit difference concatenation are also primes.

Original entry on oeis.org

41, 83, 401, 2063, 6863, 10909, 20063, 26489, 44621, 105229, 187067, 205507, 233267, 238547, 240047, 243301, 256307, 346763, 367021, 376003, 395581, 555707, 562181, 563467, 600203, 613243, 644843, 675263, 689789, 785801, 787601, 837667, 845381, 954263, 959389, 1070203
Offset: 1

Views

Author

Scott R. Shannon, Jan 07 2020

Keywords

Comments

This sequence lists the prime numbers that are prime-indexed primes, see A006450, and whose digit sum A007953, concatenation of adjacent digit sums A053392, and concatenation of adjacent digit differences A040115, are also primes. This is a subsequence of A006450 and A330653. There are 267 terms for primes up to 20491057.

Examples

			a(4) = 2063 as 2063 is the 311th prime, 2+0+6+3 = 11, '2+0'+'0+6'+'6+3' = 269, '|2-0|'+'|0-6|'+'|6-3|' = 263, and 2063, 311, 11, 269, 263 are all prime.
		

Crossrefs

A068951 Scan the primes, record digit-sum if it is itself prime.

Original entry on oeis.org

2, 3, 5, 7, 2, 5, 11, 5, 7, 11, 7, 13, 11, 17, 2, 5, 5, 11, 13, 7, 13, 11, 17, 11, 13, 17, 19, 7, 11, 13, 7, 11, 17, 11, 13, 5, 7, 11, 7, 13, 11, 17, 13, 19, 19, 5, 13, 7, 11, 17, 11, 13, 17, 19, 17, 13, 19, 17, 23, 7, 13, 11, 13, 17, 13, 17, 17, 13, 19, 13, 19, 17, 23, 17, 11, 13
Offset: 1

Views

Author

Francois Jooste (phukraut(AT)hotmail.com), Mar 10 2002

Keywords

Examples

			a(13)=5 since the 13th prime is 41 and 4+1=5, which is prime.
		

Crossrefs

Cf. A046704.

Programs

  • Maple
    dig := X->convert((convert(X,base,10)),`+`); a := n->`if`(isprime(dig(ithprime(n)))=true,dig(ithprime(n)),printf(""));
  • Mathematica
    Select[Total[IntegerDigits[#]]&/@Prime[Range[200]],PrimeQ] (* Harvey P. Dale, Oct 17 2020 *)
Previous Showing 31-40 of 62 results. Next