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!)
A355618 a(n) is the least prime that is the sum of a list of numbers > 1 whose product is n, or -1 if there is no such prime. 1
2, 3, -1, 5, 5, 7, -1, -1, 7, 11, 7, 13, -1, -1, -1, 17, 11, 19, -1, -1, 13, 23, 11, -1, -1, -1, 11, 29, 11, 31, -1, -1, 19, -1, 11, 37, -1, -1, 11, 41, 13, 43, -1, 11, -1, 47, 11, -1, -1, -1, 17, 53, 11, -1, 13, -1, 31, 59, 13, 61, -1, 13, -1, -1, 17, 67, -1, -1, 17, 71, 13, 73, -1, 13, 23, -1 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,1
COMMENTS
a(n) = n if and only if n is prime.
If n is in A046315, a(n) = -1.
LINKS
EXAMPLE
a(12) = 7 because 7 = 3+4 is prime where 12 = 3*4, and no smaller prime works. This could also be done as 7 = 2+2+3 where 12 = 2*2*3.
MAPLE
G:= proc(S, n) option remember; local s, Sp;
if n = 1 then return {[]} fi;
Sp:= select(t -> n mod t = 0, S);
if Sp = {} then return {} fi;
s:= Sp[1];
map(t -> [s, op(t)], procname(S, n/s)) union procname(S[2..-1], n)
end proc:
f:= proc(n) local S;
S:= map(t -> convert(t, `+`), G(numtheory:-divisors(n) minus {1}, n));
subs(infinity=-1, min(select(isprime, S)))
end proc:
map(f, [$2..100]);
PROG
(PARI) mpartitions(k) = my(v, u); v=[[k]]; fordiv(k, d, if(d>1 && d<=sqrt(k), if(isprime(k/d), v=concat(v, [[d, k/d]]), u=mpartitions(k/d)); for(j=1, #u, if(vecprod(concat(d, u[j])) == k, v = concat(v, [vecsort(concat(d, u[j]))]))))); vecsort(Set(v))
a(n) = n=vecmin(apply(p->if(isprime(p=vecsum(p)), p, oo), mpartitions(n))); if(n<oo, n, -1) \\ Iain Fox, Jul 10 2022
CROSSREFS
Cf. A046315.
Sequence in context: A114690 A336364 A294223 * A238122 A214059 A195508
KEYWORD
sign,look
AUTHOR
J. M. Bergot and Robert Israel, Jul 10 2022
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 April 23 06:04 EDT 2024. Contains 371906 sequences. (Running on oeis4.)