login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


Numbers n such that sum(i=1..n, sigma(i)) is prime.
0

%I #14 Oct 23 2023 11:38:43

%S 7,12,18,23,24,32,49,66,84,87,90,92,111,112,113,114,129,130,132,133,

%T 137,138,199,238,239,271,275,278,283,285,307,313,314,317,319,322,340,

%U 342,352,357,392,394,397,399,442,443,491,492,494,499,500,505,507,508,541,545,551,552,573,574,589,590,597,598,599,600,610,619,622,648,649,650

%N Numbers n such that sum(i=1..n, sigma(i)) is prime.

%C Numbers n such that A024916(n) is prime.

%t Flatten[Table[If[PrimeQ[Sum[DivisorSigma[1, i], {i, 1, n}]], n, {}], {n, 1, 300}]].

%t Position[Accumulate[DivisorSigma[1,Range[650]]],_?PrimeQ]//Flatten (* _Harvey P. Dale_, Oct 12 2020 *)

%o (PARI) t=0;for(n=1,1e3,if(isprime(t+=sigma(n)),print1(n", "))) \\ _Charles R Greathouse IV_, Nov 07 2011

%o (Python)

%o from itertools import count, islice

%o from math import isqrt

%o from sympy import isprime

%o def A142337_gen(startvalue=1): # generator of terms >= startvalue

%o return filter(lambda n: isprime(-(s:=isqrt(n))**2*(s+1) + sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1))>>1), count(max(startvalue,1)))

%o A142337_list = list(islice(A142337_gen(),30)) # _Chai Wah Wu_, Oct 23 2023

%Y Cf. A024916.

%K nonn

%O 1,1

%A _Roger L. Bagula_ and _Gary W. Adamson_, Sep 18 2008

%E Corrected and extended by _Harvey P. Dale_, Oct 12 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 22 04:37 EDT 2024. Contains 376096 sequences. (Running on oeis4.)