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

A052019 Sum of digits of prime p is substring of p.

Original entry on oeis.org

2, 3, 5, 7, 109, 139, 149, 179, 199, 911, 919, 1009, 1063, 1109, 1163, 1181, 1327, 1381, 1409, 1427, 1481, 1609, 1627, 1663, 1709, 1811, 2099, 2137, 2399, 2699, 2711, 2713, 2719, 2999, 3613, 3617, 4513, 4517, 4519, 5413, 5417, 5419, 6113, 6133, 6143
Offset: 1

Views

Author

Patrick De Geest, Nov 15 1999

Keywords

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Block[ {id = IntegerDigits@ n}, pid = Plus @@ id; MemberQ[ Partition[id, IntegerLength@ pid, 1], IntegerDigits@ pid]]; Select[ Prime@ Range@ 802, fQ] (* Robert G. Wilson v, Aug 16 2011 *)
    Select[Prime[Range[1000]],SequenceCount[IntegerDigits[#], IntegerDigits[ Total[ IntegerDigits[ #]]]]> 0&] (* The program uses the SequenceCount function from Mathematica version 10 *)  (* Harvey P. Dale, Sep 30 2015 *)

A360979 Primes that share no digits with their digit sum.

Original entry on oeis.org

11, 13, 17, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 113, 131, 151, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 277, 293, 311, 313, 331, 349, 353, 359, 383, 389, 401, 409, 421, 431, 433, 439, 443, 449, 457, 479, 487, 499, 503, 509, 521, 523
Offset: 1

Views

Author

Robert Israel, Feb 27 2023

Keywords

Examples

			a(5) = 29 is a term because 29 is prime and 2+9 = 11 shares no digits with 29.
		

Crossrefs

Primes not in A158473.

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..1000)]);
  • Mathematica
    Select[Prime[Range[99]],!IntersectingQ[IntegerDigits[#],List[Total[IntegerDigits[#]]]]&] (* Stefano Spezia, Feb 28 2023 *)
  • PARI
    isok(p) = isprime(p) && !#setintersect(Set(digits(sumdigits(p))), Set(digits(p))); \\ Michel Marcus, Feb 27 2023

A360986 Primes whose sum of decimal digits has the same set of decimal digits as the prime.

Original entry on oeis.org

2, 3, 5, 7, 199, 919, 991, 2999, 9929, 11177, 11717, 17117, 31333, 33331, 71171, 71711, 161611, 616111, 999499, 1111333, 1131133, 1131331, 1133131, 1313311, 3111313, 3111331, 3131113, 3131311, 3133111, 3311131, 3337777, 3377377, 3773377, 3773773, 7377373, 7733377, 7737337, 7737733, 32333333
Offset: 1

Views

Author

Robert Israel, Feb 27 2023

Keywords

Examples

			a(5) = 199 is a term because 199 is prime and 1+9+9 = 19 has the same set {1,9} of decimal digits as 199.
		

Crossrefs

Primes in A249515.

Programs

  • Maple
    dmax:= 7: # for terms with up to dmax digits
    dsets:= proc(s, S) option remember;
    # nondecreasing lists [x_1, ..., x_n] with sum s and set of elements S
       local i, x1;
       if S = {} then if s = 0 then return {[]} else return {} fi fi;
       x1:= min(S);
       `union`(seq(map(t -> [x1$i, op(t)], procname(s-i*x1, S minus {x1})), i=1..`if`(x1=0,dmax,floor(s/x1))))
    end proc:
    R:= {2,3,5,7}: count:= 4:
    for s from 2 to 9*dmax-1 do
      if s mod 3 = 0 then next fi;
      ds:= convert(convert(s,base,10),set);
      DS:= select (t -> nops(t) > 1 and nops(t) <= dmax, dsets(s,ds));
      for r in DS do
         for v in remove(t -> member(t[1],[0,2,4,5,6,8]) or t[-1]=0,combinat:-permute(r)) do
           p:= add(v[i]*10^(i-1),i=1..nops(v));
           if isprime(p) then R:= R union {p}; count:= count+1;
          fi
    od od od:
    sort(convert(R,list));
  • PARI
    isok(p) = if (isprime(p), my(d=digits(p)); Set(d) == Set(digits(vecsum(d)))); \\ Michel Marcus, Feb 28 2023
Showing 1-3 of 3 results.