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 41-50 of 62 results. Next

A089056 Primes whose sum of digits [s(d)] is a prime and where sum of two such consecutive s(d) values is a square.

Original entry on oeis.org

7, 11, 23, 29, 41, 131, 137, 197, 199, 467, 487, 557, 577, 593, 757, 773, 827, 829, 863, 881, 883, 937, 953, 1013, 1019, 1031, 1103, 1109, 1277, 1279, 1567, 1583, 1637, 1657, 1871, 1873, 2003, 2027, 2087, 2089, 2267, 2269, 2377, 2393, 2447, 2467, 2591, 2593
Offset: 1

Views

Author

Enoch Haga, Dec 20 2003

Keywords

Comments

Subsequence of A046704.

Examples

			a(2)=23; a(3)=29: 2+3=5; 2+9=11; 5+11=16, a square.
		

Crossrefs

Cf. A046704.

Programs

  • Mathematica
    Module[{sdp=Select[Prime[Range[500]],PrimeQ[Total[IntegerDigits[#]]]&]},Flatten[Select[ Partition[ sdp,2,1],IntegerQ[ Sqrt[ Total[ Flatten[ IntegerDigits/@ #]]]]&]]]//Union (* Harvey P. Dale, Oct 09 2023 *)

Formula

From the sequence of primes whose s(d) values are prime, select those where sum of two consecutive s(d) values is a square.

Extensions

Edited, corrected and extended by Ray Chandler, Feb 14 2004

A091368 Primes p such that the sum of the digits of p is not prime, but the sum of each digit raised to the 4th power is prime.

Original entry on oeis.org

1699, 2689, 6199, 6829, 6991, 7477, 8089, 8269, 8629, 9619, 12589, 15289, 19069, 19609, 20599, 20959, 21589, 21859, 23857, 25189, 25819, 25873, 25981, 27259, 27529, 27583, 28069, 28537, 28573, 28591, 28753, 29059, 29527, 29581, 29851
Offset: 1

Views

Author

Chuck Seggelin, Jan 03 2004

Keywords

Comments

Apparently, for primes such that each digit raised to the 4th power sum to a prime, it is more likely that the digits themselves also sum to a prime. In the first 10,000 primes there are 760 primes whose digits raised to the 4th power sum to a prime. Of these, only 106 are such that the sums of the digits are not prime. Interestingly, all of these primes have a digit sum of 25 or 35. Essentially this sequence is the terms of A091367 (primes whose digits raised to the 4th power sum to a prime) that do not also appear in A046704 (primes whose digits sum to a prime).

Examples

			a(1)=1699 because 1+6+9+9 = 25 which is not prime, but 1^4 + 6^4 + 9^4 + 9^4 = 14419 which is prime.
		

Crossrefs

Cf. A046704 (primes whose digits sum to a prime) A091367 (primes whose digits raised to the 4th power sum to a prime) A052034 and A091362 (same observation for digits squared) A091366 and A091365 (same observation for digits cubed).

Programs

  • Mathematica
    pnpQ[n_]:=Module[{idn=IntegerDigits[n]},!PrimeQ[Total[idn]]&&PrimeQ[ Total[ idn^4]]]; Select[Prime[Range[4000]],pnpQ] (* Harvey P. Dale, Apr 26 2018 *)

A141640 Additive nonprimes: odd sum of digits is a nonprime.

Original entry on oeis.org

1, 9, 10, 18, 27, 36, 45, 54, 63, 69, 72, 78, 81, 87, 90, 96, 100, 108, 117, 126, 135, 144, 153, 159, 162, 168, 171, 177, 180, 186, 195, 207, 216, 225, 234, 243, 249, 252, 258, 261, 267, 270, 276, 285, 294, 306, 315, 324, 333, 339, 342, 348, 351, 357, 360, 366
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Sep 03 2008

Keywords

Comments

A141468(n)=n-th nonprime.

Examples

			Nonprime (7)=10 is additive nonprime because 1+0=1 (odd) is nonprime (2).
Nonprime (12)=18 is additive nonprime because 1+8=9 (odd) is nonprime (6), etc.
		

Crossrefs

Programs

  • Mathematica
    osdnpQ[n_]:=Module[{s=Total[IntegerDigits[n]]},OddQ[s]&&!PrimeQ[s]]; Select[Range[400],osdnpQ] (* Harvey P. Dale, Aug 04 2013 *)

Extensions

45 and 207 inserted and extended by R. J. Mathar, Sep 05 2008

A158328 Lessers p1 of twin primes with prime sums of digits of p1 and p2.

Original entry on oeis.org

3, 5, 41, 137, 191, 197, 227, 281, 311, 461, 599, 641, 821, 827, 881, 1031, 1091, 1277, 1301, 1451, 1721, 1871, 2027, 2081, 2087, 2111, 2267, 2591, 2711, 2801, 3167, 3251, 3257, 3299, 3527, 3581, 3671, 3851, 4001, 4157, 4241, 4337, 4421, 4481, 4517, 4799
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Mar 16 2009

Keywords

Comments

Or, numbers n such that n and n+2 are terms in A046704. [Zak Seidov, Feb 02 2010]

Examples

			a(3)=41 is in the sequence because 41, 41+2=43, 4+1=5 and 4+3=7 are primes.
a(4)=137 is in the sequence because 137, 137+2=139, 1+3+7=11 and 1+3+9=13 are primes.
		

Crossrefs

Programs

  • Maple
    sd:= n -> convert(convert(n,base,10),`+`):
    p:= 1: q:= 2: count:= 0: Res:= NULL:
    while count < 100 do
      if q = p+2 and isprime(sd(p)) and isprime(sd(q)) then
          count:= count+1; Res:= Res, p
      fi;
      p:= q; q:= nextprime(q);
    od:
    Res; # Robert Israel, Apr 08 2018
  • Mathematica
    sd[n_]:=Plus@@IntegerDigits[n]; Select[Prime[Range[650]],And@@PrimeQ[{#+2,sd[#],sd[#+2]}] &] (* Jayanta Basu, May 25 2013 *)

Extensions

Corrected by Juri-Stepan Gerasimov, Mar 24 2009
3299 and 4481 inserted by R. J. Mathar, Mar 27 2009
Example edited by Robert Israel, Apr 08 2018

A162658 Primes such that the sum of its smallest and largest decimal digits is an odd prime.

Original entry on oeis.org

23, 29, 41, 47, 61, 67, 83, 103, 107, 163, 211, 223, 229, 233, 241, 269, 293, 307, 383, 421, 431, 433, 443, 449, 457, 461, 467, 479, 491, 499, 503, 509, 523, 547, 587, 607, 613, 631, 641, 661, 677, 701, 829, 853, 857, 863, 883, 929, 947
Offset: 1

Views

Author

Parthasarathy Nambi, Jul 09 2009

Keywords

Examples

			947 is a prime in which the sum of the smallest digit (4) and the largest digit (9) is an odd prime (13).
		

Crossrefs

A166975 Four-digit primes such that, if the digits are ABCD, then AB+CD and A+B+C+D are also primes.

Original entry on oeis.org

1013, 1019, 1031, 1033, 1051, 1091, 1093, 1097, 1217, 1231, 1259, 1277, 1291, 1297, 1433, 1439, 1453, 1459, 1493, 1499, 1613, 1637, 1657, 1693, 1697, 1811, 1871, 2003, 2027, 2063, 2069, 2081, 2083, 2087, 2089, 2207, 2221, 2267, 2281, 2287, 2423, 2447
Offset: 1

Views

Author

Ray G. Opao, Oct 26 2009

Keywords

Comments

The last term of this sequence is a(179) = 9859.
Subsequence of A046704. - R. J. Mathar, Oct 28 2009
Prime digit sums 5, 7, 11, 13, 17, 19, 23, 29, 31 occur 5, 8, 23, 19, 37, 37, 38, 9, 3 times, respectively. Sequence contains ten twin prime pairs. - Rick L. Shepherd, Feb 19 2013

Examples

			1217 is in the list since 1217, 12+17=29, and 1+2+1+7=11 are all primes.
		

Programs

  • Maple
    p:=1009: while p<10000 do d:=convert(p,base,10): if(isprime(add(d[j],j=1..4)) and isprime(d[1]+d[3]+10*(d[2]+d[4])))then printf("%d, ", p): fi: p:=nextprime(p): od: # Nathaniel Johnston, Jun 03 2011
  • Mathematica
    apQ[n_]:=Module[{idn=IntegerDigits[n],a,b,c,d},a=idn[[1]];b=idn[[2]];c= idn[[3]];d=idn[[4]];AllTrue[{10a+b+10c+d,Total[idn]},PrimeQ]]; Select[ Prime[Range[PrimePi[1000]+1,PrimePi[9999]]],apQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 14 2015 *)
  • Python
    from sympy import isprime
    def ok(n):
         if n < 1000 or n > 9999 or not isprime(n): return False
         return isprime(n//100 + n%100) and isprime(sum(map(int, str(n))))
    afull = [k for k in range(1001, 10000, 2) if ok(k)]
    print(afull[:42]) # Michael S. Branicky, Aug 20 2022

Extensions

Numbers in the range 1000 to 1200 inserted by R. J. Mathar, Oct 28 2009
Many terms corrected by Nathaniel Johnston, Jun 03 2011

A172216 Smallest k such that sum of digits of prime(n)^k is prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 2, 5, 1, 1, 7, 2, 1, 1, 1, 2, 5, 1, 1, 6, 2, 2, 1, 1, 4, 1, 4, 2, 2, 1, 2, 1, 1, 1, 2, 1, 1, 4, 6, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 5, 6, 1, 4, 4, 1, 1, 2, 2, 1, 1, 4, 3, 1, 1, 1, 1, 1, 8, 2, 1, 1, 2, 1, 1, 5, 2, 1, 1, 1, 8, 1, 4, 2, 3, 1, 1, 2, 1, 1, 1, 4, 1, 8, 3, 2, 6, 2, 3, 6, 2, 1, 10, 8, 1
Offset: 1

Views

Author

Klaus Brockhaus, Jan 29 2010

Keywords

Comments

For all n, prime(n)^0 = 1 has nonprime sum of digits 1.
a(n) = 1 iff prime(n) is in A046704, an additive prime. a(n) = 1 iff n is in A075177.

Examples

			prime(1) = 2; 2^1 = 2 has prime sum of digits 2. Hence a(1) = 1.
prime(6) = 13; 13^1 = 13 has nonprime sum of digits 4; 13^2 = 169 has nonprime sum of digits 16; 13^3 = 2197 has prime sum of digits 19. Hence a(6) = 3.
		

Crossrefs

Programs

  • Magma
    S:=[]; for n in [1..105] do j:=1; while not IsPrime(&+Intseq(NthPrime(n)^j)) do j+:=1; end while; Append(~S, j); end for; S;
  • Mathematica
    sdp[n_]:=Module[{k=1},While[!PrimeQ[Total[IntegerDigits[Prime[n]^k]]], k++]; k]; Array[sdp,110] (* Harvey P. Dale, Apr 13 2014 *)

A176196 Primes such that the sum of k-th powers of digits, for each of k = 1, 2, 3, and 4, is also a prime.

Original entry on oeis.org

11, 101, 113, 131, 223, 311, 353, 461, 641, 661, 883, 1013, 1031, 1103, 1301, 1439, 1451, 1471, 1493, 1697, 1741, 2111, 2203, 3011, 3347, 3491, 3659, 4139, 4337, 4373, 4391, 4733, 4931, 5303, 5639, 5693, 6197, 6359, 6719, 6791, 6917, 6971, 7411, 7433
Offset: 1

Views

Author

Michel Lagneau, Apr 11 2010

Keywords

Comments

For k = 1, 2, and 3 see A176179

Examples

			For the prime number n=14549 we obtain :
1 + 4 + 5 + 4 + 9 = 23 ;
1^2 +4^2 + 5^2 +4^2 + 9^2 = 139 ;
1^3 +4^3 + 5^3 +4^3 + 9^3 = 983 ;
1^4 +4^4 + 5^4 +4^4 + 9^4 = 7699 ;
		

References

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

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 2 to 20000 do:l:=evalf(floor(ilog10(n))+1):n0:=n:s1:=0:s2:=0:s3:=0:s4:=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:s4:=s4+u^4:od:if type(n,prime)=true and type(s1,prime)=true and type(s2,prime)=true and type(s3,prime)=true and type(s4,prime)=true then print(n):else fi:od:
  • Mathematica
    Select[Prime[Range[1000]],And@@PrimeQ[Total/@Table[IntegerDigits[#]^n,{n,4}]]&] (* Harvey P. Dale, Jun 16 2013 *)
  • Python
    from sympy import isprime, primerange
    def ok(p):
        return all(isprime(sum(int(d)**k for d in str(p))) for k in range(1, 5))
    def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
    print(aupto(7443)) # Michael S. Branicky, Nov 23 2021

A180404 Primes p such that the sum of fifth power of their digits is a prime.

Original entry on oeis.org

11, 101, 191, 223, 227, 229, 281, 313, 331, 337, 359, 373, 379, 397, 463, 487, 557, 577, 593, 643, 683, 733, 739, 757, 773, 821, 863, 881, 911, 937, 953, 1019, 1033, 1091, 1109, 1123, 1129, 1181, 1213, 1231, 1259, 1277, 1291, 1303, 1321, 1381, 1433, 1439
Offset: 1

Views

Author

Carmine Suriano, Sep 02 2010

Keywords

Examples

			a(5) = 227 since 2^5+2^5+7^5 = 32+32+16807 = 16871 is a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[500]],PrimeQ[Total[IntegerDigits[#]^5]]&] (* Harvey P. Dale, May 25 2011 *)

Formula

If a prime p = abcdef... (each letter being a single digit) then sum = a^5+b^5+... belongs to this sequence if sum is a prime.

A260796 Numbers k such that digit sum of prime(k) plus digit sum of prime(k+1) is prime.

Original entry on oeis.org

1, 15, 37, 46, 47, 73, 91, 102, 107, 111, 118, 121, 123, 129, 161, 165, 187, 195, 197, 199, 203, 219, 239, 240, 242, 263, 275, 290, 292, 300, 326, 329, 357, 363, 388, 412, 416, 423, 426, 465, 470, 472, 504, 506, 539, 553, 565, 606, 611, 630, 641, 647, 660, 667
Offset: 1

Views

Author

K. D. Bajpai, Aug 08 2015

Keywords

Examples

			a(2) = 15: digit sum of prime(15) + digit sum of prime (16) = (4+7) + (5+3) = 19 which is prime.
a(3) = 37: digit sum of prime(37) + digit sum of prime (38) = (1+5+7) + (1+6+3) = 23 which is prime.
		

Crossrefs

Programs

  • Magma
    [n :  n in [1..500]  |  IsPrime(k) where k is (&+Intseq(NthPrime(n)) + &+Intseq(NthPrime(n+1))) ];
    
  • Maple
    digsum:= n -> convert(convert(n, base, 10), `+`): select(n -> isprime(digsum(ithprime(n)) + digsum(ithprime(n+1))),[seq(k, k=1..10^3)]);
  • Mathematica
    Select[Range[1000], PrimeQ[Plus @@ (IntegerDigits[Prime[#]]) + Plus @@ (IntegerDigits[Prime[# + 1]])] &]
    Position[Total/@Partition[Total[IntegerDigits[#]]&/@Prime[Range[ 700]],2,1],?PrimeQ] // Flatten (* _Harvey P. Dale, Jun 09 2019 *)
  • PARI
    for(n = 1, 500, if(isprime(sumdigits(prime(n)) + sumdigits(prime(n+1))), print1(n, ", ")));
    
  • Python
    from sympy import isprime, prime
    A260796_list = [n for n in range(1,10**5) if isprime(sum(int(d) for d in str(prime(n))+str(prime(n+1))))] # Chai Wah Wu, Aug 09 2015
Previous Showing 41-50 of 62 results. Next