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.

A050772 Iterated procedure 'composite k added to sum of its prime factors reaches a prime' yields 5 skipped primes.

This page as a plain text file.
%I A050772 #16 Nov 22 2021 10:10:13
%S A050772 18,24,25,46,57,161,203,209,288,319,323,391,736,798,837,858,928,930,
%T A050772 1035,1088,1089,1218,1300,1376,1690,2254,2418,2478,2673,2842,2871,
%U A050772 3045,3220,3325,3458,3510,3588,4186,4508,4617,4824,5054,5180,5248,5472,6069
%N A050772 Iterated procedure 'composite k added to sum of its prime factors reaches a prime' yields 5 skipped primes.
%H A050772 Robert Israel, <a href="/A050772/b050772.txt">Table of n, a(n) for n = 1..1000</a>
%e A050772 18 is a term because 18 + (2+3+3) = 26 + (2+13) = ending prime 41. Between 18 and 41 one finds 5 primes 19, 23, 29, 31 and 37.
%p A050772 filter:= proc(n) local r, s, t;
%p A050772   if isprime(n) then return false fi;
%p A050772   t:= 0: s:= n;
%p A050772   do
%p A050772    r:= s;
%p A050772    s:= s + add(p[1]*p[2],p=ifactors(s)[2]);
%p A050772    t:= t + numtheory:-pi(s-1) - numtheory:-pi(r);
%p A050772    if isprime(s) then return t=5 fi;
%p A050772    if t > 5 then return false fi;
%p A050772   od;
%p A050772 end proc:
%p A050772 select(filter, [$2..10000]); # _Robert Israel_, May 08 2020
%t A050772 ok[n_] := CompositeQ[n] && Block[{k=n, p = NextPrime[n, 6]}, While[k < p, k += Total[ Times @@@ FactorInteger[k]]]; k == p]; Select[Range@ 6069, ok] (* _Giovanni Resta_, May 08 2020 *)
%Y A050772 Cf. A050703, A050710.
%K A050772 nonn
%O A050772 1,1
%A A050772 _Patrick De Geest_, Sep 15 1999
%E A050772 Offset changed to 1 by _Robert Israel_, May 08 2020