OFFSET
1,1
COMMENTS
Values of k are 4, 4, 4, 8, 8, 7, 7, 8, 9, 13, 5, 19, 14, 14, 5, 17, 11, 21, 17, 5, 12, 10, 22, 14, 23, 24, 19, 17, 18, 22, 34, 8, 38, 35, ...
LINKS
EXAMPLE
For 94, consider the prime factors of the previous 4 numbers, 90, 91, 92, 93: 2, 3, 3, 5; 7, 13; 2, 2, 23; 3, 31. Their sum is 2 + 3 + 3 + 5 + 7 + 13 + 2 + 2 + 23 + 3 + 31 = 94.
For 123, consider the prime factors of the previous 4 numbers, 119, 120, 121, 122: 7, 17; 2, 2, 2, 3, 5; 11, 11; 2, 61. Their sum is 7 + 17 + 2 + 2 + 2 + 3 + 5 + 11 + 11 + 2 + 61 = 123.
MAPLE
with(numtheory): P:= proc(q) local a, d, j, k, n;
for n from 2 to q do if not 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);
PROG
(PARI) sopfr(n) = my(f=factor(n)); sum(k=1, #f~, f[k, 1]*f[k, 2]);
isok(n) = {my(s = 0); my(k = 1); while (s < n, s += sopfr(n-k); k++); s == n; }
lista(nn) = {forcomposite(n=2, nn, if (isok(n), print1(n, ", ")); ); } \\ Michel Marcus, May 27 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo P. Lava, Apr 28 2015
STATUS
approved