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

A119450 Primes with odd digit sum.

Original entry on oeis.org

3, 5, 7, 23, 29, 41, 43, 47, 61, 67, 83, 89, 113, 131, 137, 139, 151, 157, 173, 179, 191, 193, 197, 199, 223, 227, 229, 241, 263, 269, 281, 283, 311, 313, 317, 331, 337, 353, 359, 373, 379, 397, 401, 409, 421, 443, 449, 461, 463, 467, 487, 557, 571, 577, 593
Offset: 1

Views

Author

Zak Seidov, May 20 2006

Keywords

Comments

On average, there are as many prime numbers for which the sum of decimal digits is even as prime numbers for which it is odd [A119450]. This hypothesis, first made in 1968, has recently been proved by researchers from the Institut de Mathematiques de Luminy.
Also primes such that absolute value of difference between largest digit and the sum of all the other digits is an odd integer. This is in accordance with hypothesis of Alexandre Gelfond, proved by C. Mauduit and J. Rivat as stated in Links section. - Osama Abuajamieh, Feb 10 2017
Considering the sequence digit sums, when prime, new maximum digit sums encounter the prime numbers themselves in order. This of course implies that, for any largest considered prime Pmax in this sequence, there will exist a larger entry P2 with digit sum = Pmax. Note the data available for such scrutiny grows very slowly - considering primes through 10^12 only attains digit sum to (prime) 97. Additionally, a parallel observation can be drawn about the behavior of companion sequence A119449. Also, this sequence appears to be a subset of A156756. - Bill McEachen, Mar 26 2017

Crossrefs

Primes with even digit sum A119449.

Programs

  • Maple
    select(t -> isprime(t) and convert(convert(t,base,10),`+`)::odd, [seq(i,i=3..1000,2)]); # Robert Israel, Feb 13 2017
  • Mathematica
    Select[Prime@ Range@ 108, OddQ@ Total@ IntegerDigits@ # &] (* Michael De Vlieger, Feb 11 2017 *)
  • PARI
    is(n)=isprime(n) && sumdigits(n)%2 \\ Charles R Greathouse IV, Feb 14 2017

Formula

a(n) = A000040(A200260(n)). - Jon Maiga, Jul 03 2021
{A000040(k) : A104638(k) odd}. - R. J. Mathar, Jul 13 2025

A243586 Primes p such that sum of digits + 3 is prime.

Original entry on oeis.org

2, 11, 13, 17, 19, 31, 37, 53, 59, 71, 73, 79, 97, 101, 103, 107, 109, 127, 149, 163, 167, 181, 211, 233, 239, 251, 257, 271, 277, 293, 307, 347, 349, 367, 383, 389, 419, 431, 433, 439, 457, 479, 491, 503, 509, 521, 523, 541, 547, 563, 569, 587, 613, 617
Offset: 1

Views

Author

Vincenzo Librandi, Jun 07 2014

Keywords

Comments

Naturally, this sequence is not the same as A119449. First disagreement at index 44: a(44)=503, A119449(44)=499.

Crossrefs

Cf. primes p such that sum of digits + k is prime: A166561 (k=1), this sequence (k=3), A176985 (k=5), A243587 (k=7), A243588 (k=9).

Programs

  • Magma
    [p: p in PrimesUpTo(700) | IsPrime(q) where q is 3+&+Intseq(p)];
  • Mathematica
    Select[Prime[Range[200]], PrimeQ[Plus@@IntegerDigits[#] + 3]&]

A062338 Primes whose sum of digits is a multiple of 4.

Original entry on oeis.org

13, 17, 31, 53, 71, 79, 97, 103, 107, 211, 233, 251, 277, 349, 367, 389, 431, 439, 457, 479, 503, 521, 547, 569, 587, 619, 659, 673, 677, 691, 701, 709, 727, 839, 853, 857, 907, 929, 947, 983, 1021, 1061, 1069, 1087, 1151, 1201, 1223, 1249, 1289, 1429
Offset: 1

Views

Author

Amarnath Murthy, Jun 21 2001

Keywords

Examples

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

Crossrefs

Subsequence of A119449.

Programs

  • Magma
    [ p: p in PrimesUpTo(10000) | &+Intseq(p) mod 4 eq 0 ]; /* Vincenzo Librandi, Apr 02 2011 */
    
  • Maple
    filter:= x -> (convert(convert(x,base,10),`+`) mod 4 = 0) and isprime(x);
    A062338:= select(filter, [seq(2*i+1,i=0..1000)]); # Robert Israel, Apr 20 2014
  • PARI
    is(n)=isprime(n) && sumdigits(n)%4==0 \\ Charles R Greathouse IV, Mar 09 2022

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jul 06 2001

A200259 Numbers k such that k-th prime has an even digit sum.

Original entry on oeis.org

1, 5, 6, 7, 8, 11, 12, 16, 17, 20, 21, 22, 25, 26, 27, 28, 29, 31, 35, 38, 39, 42, 47, 51, 52, 54, 55, 58, 59, 62, 63, 69, 70, 73, 76, 77, 81, 83, 84, 85, 88, 92, 94, 95, 96, 97, 98, 99, 100, 101, 103, 104, 107, 112, 113, 114, 115, 119, 120, 122, 123, 125
Offset: 1

Views

Author

N. J. A. Sloane, Nov 15 2011

Keywords

Crossrefs

Programs

  • Magma
    [ n: n in [1..169] | IsEven(&+Intseq(NthPrime(n)))]; // Bruno Berselli, Nov 15 2011
  • Mathematica
    Select[Range[1000], EvenQ[Total[IntegerDigits[Prime[#]]]] &] (* T. D. Noe, Nov 21 2011 *)

A186647 Even numbers whose decimal digits sum to a prime.

Original entry on oeis.org

2, 12, 14, 16, 20, 30, 32, 34, 38, 50, 52, 56, 58, 70, 74, 76, 92, 94, 98, 102, 104, 106, 110, 120, 122, 124, 128, 140, 142, 146, 148, 160, 164, 166, 182, 184, 188, 200, 210, 212, 214, 218, 230, 232
Offset: 1

Views

Author

Giovanni Teofilatto, Feb 25 2011

Keywords

Crossrefs

Cf. A119449.

Programs

  • Mathematica
    Select[2*Range[0,200],PrimeQ[Total[IntegerDigits[#]]]&] (* Harvey P. Dale, Oct 05 2019 *)

A247797 Lexicographically earliest permutation of prime numbers, such that adjacent terms have coprime sums of digits in decimal representation.

Original entry on oeis.org

2, 3, 5, 7, 11, 23, 13, 29, 17, 41, 31, 43, 19, 47, 37, 61, 53, 67, 59, 83, 71, 89, 73, 137, 79, 113, 97, 131, 101, 139, 103, 151, 107, 157, 109, 173, 127, 179, 149, 191, 163, 193, 167, 197, 181, 199, 211, 223, 227, 229, 233, 241, 251, 263, 239, 269, 257
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 25 2014

Keywords

Comments

A049084(a(n)) defines a permutation of the positive integers, cf. A250552.

Crossrefs

Programs

  • Haskell
    import Data.List (delete)
    a247797 n = a247797_list !! (n-1)
    a247797_list = f 1 $ zip a000040_list a007605_list where
       f q' vws = g vws where
         g  ((p,q):pqs) = if gcd q q' == 1
                             then p : f q (delete (p,q) vws) else g pqs

A338976 Primes p such that p*A007953(p)+1 is prime.

Original entry on oeis.org

2, 11, 13, 17, 19, 59, 71, 97, 107, 109, 149, 167, 181, 239, 271, 419, 431, 499, 509, 523, 547, 563, 613, 631, 691, 727, 811, 853, 859, 983, 1009, 1063, 1087, 1117, 1151, 1193, 1229, 1409, 1427, 1487, 1559, 1579, 1601, 1759, 1823, 1913, 1973, 2039, 2099, 2161, 2237, 2251, 2309, 2411, 2437, 2473
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Dec 18 2020

Keywords

Examples

			a(3) = 13 is a term because 13 and 13*(1+3)+1 = 53 are prime.
		

Crossrefs

Subsequence of A119449.

Programs

  • Maple
    select(t -> isprime(t) and isprime(t*convert(convert(t,base,10),`+`)+1), [$2..10^4]);
  • PARI
    isok(p) = isprime(p) && isprime(p*sumdigits(p)+1); \\ Michel Marcus, Dec 18 2020

A199339 a(n) = number of primes with an even digit sum among the first n primes minus the number with an odd digit sum.

Original entry on oeis.org

1, 0, -1, -2, -1, 0, 1, 2, 1, 0, 1, 2, 1, 0, -1, 0, 1, 0, -1, 0, 1, 2, 1, 0, 1, 2, 3, 4, 5, 4, 5, 4, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 0, -1, -2, -1, -2, -3, -4, -3, -2, -3, -2, -1, -2, -3, -2, -1, -2, -3, -2, -1, -2, -3, -4, -5, -6, -5, -4, -5, -6, -5, -6
Offset: 1

Views

Author

M. F. Hasler, Nov 14 2011

Keywords

Examples

			a(1)=1 because the first prime has an even sum of digits.
a(2)=0, a(3)=-1, a(4)=-2 because the following primes (3,5,7) have odd sum of digits.
a(5)=-1, a(6)=0, a(7)=1, a(8)=2 because the 5th, 6th, 7th and 8th prime (11, 13, 17, 19) have an even sum of digits.
		

Crossrefs

Programs

  • Mathematica
    a[1] := 1; a[n_] := a[n] = a[n - 1] + (-1)^(Plus@@IntegerDigits[Prime[n]]); Table[a[n], {n, 74}] (* Alonso del Arte, Nov 14 2011 *)
  • PARI
    s=0;vector(90,n,s+=(-1)^A007953(prime(n)))

Formula

a(n)=sum_{k=1...n} (-1)^A007605(n).
Equals A200262 - A200264.

A227785 Primes p such that p - ssd(p) is the square of a prime, where ssd(k) is the sum of the squared decimal digits of k.

Original entry on oeis.org

11, 2903, 3533, 3803, 5197, 9533, 18973, 24763, 37321, 73561, 96953, 113621, 124777, 129097, 134837, 139241, 398341, 830003, 1100509, 1585201, 1661789, 2211257, 4541309, 4871077, 4897709, 5340949, 5958751, 7393123, 8185501, 8744003, 11485559, 15343039, 15343079
Offset: 1

Views

Author

Underwood Dudley, Will Gosnell, Charles R Greathouse IV, and Robert Israel, Aug 09 2013

Keywords

Examples

			11 is a member since 11 - 2 = 3^2 where 3 is prime. 2903 is a member since 2903 - 94 = 53^2 where 53 is prime.
		

Crossrefs

Subsequence of A119449. ssd(n) = A003132(n).

Programs

  • Maple
    ssd:= n->add(d^2,d=convert(n,base,10));
    S:= select(t -> type(sqrt(t - ssd(t)),prime), [seq(ithprime(j),j=1..10^5)]);
  • Mathematica
    fQ[n_] := PrimeQ[ Sqrt[ n - Total[ IntegerDigits[ n]^2]]]; p = 2; lst = {}; While[p < 15500000, If[ fQ@ p, AppendTo[ lst, p]]; p = NextPrime@ p]; lst (* Robert G. Wilson v, Jun 01 2014 *)
  • PARI
    ssd(n)=my(d=digits(n));sum(i=1,#d,d[i]^2)
    v=List();forprime(p=2,1e5,if(issquare(p-ssd(p),&t) && isprime(t), listput(v,p))); Vec(v)
Showing 1-9 of 9 results.