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!)
A332198 Start with the empty sum; if the sum is composite with prime factors occurring among the terms of the sum, remove these; then add to the terms of the sum the next larger prime which yields a new number; repeat. 0
0, 2, 5, 10, 8, 15, 18, 31, 48, 67, 90, 119, 126, 163, 204, 247, 262, 315, 374, 424, 438, 509, 582, 661, 744, 802, 899, 971, 1074, 1181, 1290, 1360, 1487, 1618, 1755, 1894, 2043, 2194, 2351, 2514, 2681, 2854, 3033, 3214, 3405, 3598, 3795, 3971, 4182, 4364, 4591, 4820, 5053, 5129, 5147, 5398, 5655, 5918, 6187 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
The clause "which yields a new number" is there to avoid a loop: if it is omitted, the sequence enters a cycle at 37 + 47 + ... + 257 + 263 = 6178, 6178 + 269 = 6187 = 23 * 269, 6187 - 269 = 6178. With the additional clause, the next step is to add the next larger prime 271.
One may ignore the initial a(0) = 0 and consider the sequence starting at a(1) = 2, this avoids asking about prime factors of the empty sum.
On the StackExchange web site it has been asked (a) whether any prime will eventually be removed from the sum, and (b) whether there are infinitely many "cyclic primes" that would yield a loop without the additional clause.
Up to 10^5 steps, the only cyclic primes are 269 occurring in a(58) = 6187 and 94793 occurring in a(9141) = 377844898.
LINKS
TheSimpliFier, Can we remove any prime number with this strange process?, math.StackExchange, July 8, 2019
EXAMPLE
The empty sum has nothing to remove, so we add the smallest prime to get a(1) = 2.
This is a prime so again we don't remove anything and add the next larger prime to get a(2) = 2 + 3 = 5.
This is again a prime so we add to the sum the next larger prime after the largest term 3, to get a(3) = 2 + 3 + 5 = 10.
Now 10 = 2 * 5, so we remove the primes 2 and 5 from the sum and get 3, then we add the next larger prime to get a(4) = 3 + 5 = 8.
Now 8 = 2^3 but there's no term 2 in the sum that could be removed, so we add the next larger prime to get a(5) = 3 + 5 + 7 = 15.
Now 15 = 3 * 5 so we remove terms 3 and 5 from the sum, and after adding the next larger prime get a(6) = 7 + 11 = 18.
MAPLE
R:= [0, 2]: S:= {2}: s:= 2:
for iter from 1 to 100 do
if not isprime(s) then
T:= select(p -> s mod p = 0, S);
S:= S minus T;
s:= s - convert(T, `+`);
fi;
p:= nextprime(max(S));
while member(s+p, R) do p:= nextprime(p) od:
S:= S union {p}; s:= s+p; R:= [op(R), s];
od:
R; # Robert Israel, Aug 28 2020
PROG
(PARI) A332198_vec(N, s=[2], n(s)=nextprime(s[#s]+1))={vector(N, i, #s>1 && s=setminus(s, factor(vecsum(s))[, 1]~); if(i<2, N=2, N==N=vecsum(s=concat(s, n(s))), printf("cyclic %d in a(%d)=%d, ", s[#s], i-1, N); N-=s[#s]-s[#s]=n(s), N))+print("least non-removed prime: ", s[1])}
CROSSREFS
Sequence in context: A324503 A126842 A291933 * A154680 A323728 A140469
KEYWORD
nonn
AUTHOR
M. F. Hasler, Aug 28 2020
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 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)