login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A360986 Primes whose sum of decimal digits has the same set of decimal digits as the prime. 1
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
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.
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));
PROG
(PARI) isok(p) = if (isprime(p), my(d=digits(p)); Set(d) == Set(digits(vecsum(d)))); \\ Michel Marcus, Feb 28 2023
CROSSREFS
Primes in A249515.
Sequence in context: A046478 A046475 A029978 * A122764 A256886 A195302
KEYWORD
nonn,base
AUTHOR
Robert Israel, Feb 27 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 14 00:54 EDT 2024. Contains 374290 sequences. (Running on oeis4.)