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

A158473 Primes whose digit sum contains one or more digits of the same prime.

Original entry on oeis.org

2, 3, 5, 7, 19, 109, 127, 137, 139, 149, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 271, 281, 283, 307, 317, 337, 347, 367, 373, 379, 397, 419, 461, 463, 467, 491, 541, 557, 571, 613, 617, 619, 631, 641, 643, 647, 661, 673, 691, 719, 733, 739, 743, 751
Offset: 1

Views

Author

Parthasarathy Nambi, Mar 20 2009

Keywords

Examples

			139 is a prime whose digit sum of 13 contains the digits 1 and 3 which are also in the prime.
149 is a prime whose digit sum of 14 contains the digits 1 and 4 which are also in the prime.
419 is a prime whose digit sum of 14 contains the digits 1 and 4 which are also in the prime.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,s;
      L:= convert(n,base,10);
      s:= convert(L,`+`);
      convert(convert(s,base,10),set) intersect convert(L,set) <> {}
    end proc:
    select(filter, [seq(ithprime(i),i=1..100)]); # Robert Israel, Feb 27 2023
  • PARI
    isok(p) = isprime(p) && (#setintersect(Set(digits(p)), Set(digits(sumdigits(p)))) >= 1); \\ Michel Marcus, Nov 12 2017

Extensions

Single-digit primes added by R. J. Mathar, Jul 08 2009
Typos in data corrected by D. S. McNeil and Andrew Weimholt, Aug 17 2010

A158571 Primes whose digit sum is a single-digit nonprime.

Original entry on oeis.org

13, 17, 31, 53, 71, 103, 107, 211, 233, 251, 431, 503, 521, 701, 1021, 1061, 1151, 1201, 1223, 1511, 1601, 2011, 2141, 2213, 2411, 3001, 3023, 3041, 3203, 3221, 4013, 4211, 5003, 5021, 6011, 6101, 7001, 10007, 10061, 10111, 10133, 10151, 10223, 10313
Offset: 1

Views

Author

Parthasarathy Nambi, Mar 21 2009

Keywords

Comments

It is interesting to observe that it is hard to find (I found none) primes whose digit sum is 6. On the contrary, it is easier to find primes whose digit sum is 8.
The digit sum 6 does not occur here because a number with digit sum 6 is divisible by 3 and therefore not prime. - R. J. Mathar, Mar 26 2009

Examples

			1061 is a prime whose digit sum is 8, which is a single-digit nonprime.
		

Crossrefs

Cf. A158217.

Programs

  • Maple
    for i from 1 to 8 do if member(i,[1,3,7]) then S[1,i]:= {i} else S[1,i]:= {} fi od:
    for d from 2 to 5 do
      for x from 1 to 8 do
        S[d,x]:= {};
        for y from 0 to x-1 do
          S[d,x]:= S[d,x] union map(t -> 10^(d-1)*y + t, S[d-1,x-y])
    od od od:
    select(isprime, S[5,4] union S[5,8]); # Robert Israel, Apr 14 2021

Formula

Union of A062339 and A062343. - R. J. Mathar, Mar 26 2009

Extensions

Extended by R. J. Mathar, Mar 26 2009
Showing 1-2 of 2 results.