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.

A213020 Smallest number k such that the sum of prime factors of k (counted with multiplicity) is n times a prime.

This page as a plain text file.
%I A213020 #14 Nov 14 2020 01:28:15
%S A213020 2,4,8,15,21,35,33,39,65,51,57,95,69,115,86,87,93,155,212,111,122,123,
%T A213020 129,215,141,235,158,159,265,371,177,183,194,427,201,335,213,219,365,
%U A213020 511,237,395,249,415,446,267,278,623,964,291,302,303,309,515,321,327
%N A213020 Smallest number k such that the sum of prime factors of k (counted with multiplicity) is n times a prime.
%C A213020 Smallest k such that sopfr(k) = n*p, p prime.
%H A213020 Alois P. Heinz, <a href="/A213020/b213020.txt">Table of n, a(n) for n = 1..5000</a>
%e A213020 a(19) = 212 because 212 = 2^2 * 53 => sum of prime factors = 2*2+53 = 57 = 19*3 where 3 is prime.
%p A213020 sopfr:= proc(n) option remember;
%p A213020           add(i[1]*i[2], i=ifactors(n)[2])
%p A213020         end:
%p A213020 a:= proc(n) local k, p;
%p A213020       for k from 2 while irem (sopfr(k), n, 'p')>0 or
%p A213020         not isprime(p) do od; k
%p A213020     end:
%p A213020 seq (a(n), n=1..100); # _Alois P. Heinz_, Jun 03 2012
%t A213020 sopfr[n_] := Sum[Times @@ f, {f, FactorInteger[n]}];
%t A213020 a[n_] := For[k = 2, True, k++, If[PrimeQ[sopfr[k]/n], Return[k]]];
%t A213020 Array[a, 100] (* _Jean-François Alcover_, Nov 13 2020 *)
%o A213020 (PARI) sopfr(n) = my(f=factor(n)); sum(k=1,#f~,f[k,1]*f[k,2]); \\ A001414
%o A213020 isok(k, n) = my(dr = divrem(sopfr(k), n)); (dr[2]==0) && isprime(dr[1]);
%o A213020 a(n) = {my(k=2); while (!isok(k, n), k++); k;} \\ _Michel Marcus_, Nov 13 2020
%Y A213020 Cf. A001414, A100118, A213015, A213016.
%K A213020 nonn
%O A213020 1,1
%A A213020 _Michel Lagneau_, Jun 02 2012