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.

Original entry on oeis.org

18, 24, 25, 46, 57, 161, 203, 209, 288, 319, 323, 391, 736, 798, 837, 858, 928, 930, 1035, 1088, 1089, 1218, 1300, 1376, 1690, 2254, 2418, 2478, 2673, 2842, 2871, 3045, 3220, 3325, 3458, 3510, 3588, 4186, 4508, 4617, 4824, 5054, 5180, 5248, 5472, 6069
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1999

Keywords

Examples

			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.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local r, s, t;
      if isprime(n) then return false fi;
      t:= 0: s:= n;
      do
       r:= s;
       s:= s + add(p[1]*p[2],p=ifactors(s)[2]);
       t:= t + numtheory:-pi(s-1) - numtheory:-pi(r);
       if isprime(s) then return t=5 fi;
       if t > 5 then return false fi;
      od;
    end proc:
    select(filter, [$2..10000]); # Robert Israel, May 08 2020
  • Mathematica
    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 *)

Extensions

Offset changed to 1 by Robert Israel, May 08 2020