login
Primes equal to the sum of the prime factors, with multiplicity, of the previous k numbers, for some k.
4

%I #29 May 28 2015 11:00:51

%S 23,269,1049,1277,8869951,972928919,74885169679

%N Primes equal to the sum of the prime factors, with multiplicity, of the previous k numbers, for some k.

%C Values of k are 2, 5, 4, 12, 12, 19, 37, ...

%C a(8) > 10^12. - _Giovanni Resta_, May 15 2015

%C Subsequence of prime terms of A257976. - _Robert G. Wilson v_, May 19 2015

%e 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.

%e 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.

%p with(numtheory): P:= proc(q) local a,d,j,k,n;

%p for n from 3 to q do if isprime(n) then a:=0; k:=0;

%p while a<n do k:=k+1; d:=ifactors(n-k)[2];

%p d:=add(d[j][1]*d[j][2],j=1..nops(d));

%p a:=a+d; od; if a=n then print(n);

%p fi; fi; od; end: P(10^9);

%t 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 *)

%o (PARI) sopfr(n)=my(f=factor(n));sum(i=1,#f[,1],f[i,1]*f[i,2]);

%o 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

%Y Cf. A257367, A257524.

%K nonn,more

%O 1,1

%A _Paolo P. Lava_, May 13 2015

%E a(6)-a(7) from _Giovanni Resta_, May 15 2015