|
|
A257930
|
|
Primes equal to the sum of the prime factors, with multiplicity, of the previous k numbers, for some k.
|
|
4
|
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Values of k are 2, 5, 4, 12, 12, 19, 37, ...
|
|
LINKS
|
|
|
EXAMPLE
|
For 23, consider the prime factors of the previous 2 numbers, 21, 22: 3, 7; 2, 11. Their sum is 3 + 7 + 2 + 11 = 23.
For 269, consider the prime factors of the previous 5 numbers, 264, 265, 266, 267, 268: 2, 2, 2, 3, 11; 5, 53; 2, 7, 19; 3, 89; 2, 2, 67. Their sum is 2 + 2 + 2 + 3 + 11 + 5 + 53 + 2 + 7 + 19 + 3 + 89 + 2 + 2 + 67 = 269.
|
|
MAPLE
|
with(numtheory): P:= proc(q) local a, d, j, k, n;
for n from 3 to q do if isprime(n) then a:=0; k:=0;
while a<n do k:=k+1; d:=ifactors(n-k)[2];
d:=add(d[j][1]*d[j][2], j=1..nops(d));
a:=a+d; od; if a=n then print(n);
fi; fi; od; end: P(10^9);
|
|
MATHEMATICA
|
sopfr[n_] := Plus @@ Times @@@ FactorInteger@ n; fQ[n_] := Block[{k = n - 1, s = 0}, While[s += sopfr@ k; s < n, k--]; s == n]; p = 5; lst = {}; While[p < 100000000, If[ fQ@ p, AppendTo[lst, p]]; p = NextPrime@ p]; lst (* Robert G. Wilson v, May 15 2015 *)
|
|
PROG
|
(PARI) sopfr(n)=my(f=factor(n)); sum(i=1, #f[, 1], f[i, 1]*f[i, 2]);
is(n)=if(n<23, return(0)); my(s); for(k=1, n, s+=sopfr(n-k); if(s>=n, return(n==s && isprime(n)))) \\ Charles R Greathouse IV, May 15 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|