OFFSET
1,1
COMMENTS
The corresponding primes are 2, 3, 7, 53, 31, 307, 59, 223, 331, 277, 167, 397, 853, 809, 359, 1973, 727, 1237, ...
The squares of the sequence are 4, 16, 144, 3600, ...
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..1000
EXAMPLE
a(4)=28 because the sum of the last 4 divisors of 28: 28+14+7+4 = 53 is a prime number.
MAPLE
M:= 20000: # to get all terms before the first term > M
R:= 'R':
for k from 2 to M do
F:= ListTools:-PartialSums(sort(convert(
numtheory:-divisors(k), list), `>`));
for n in select(t -> isprime(F[t]), [$1..nops(F)]) do
if not assigned(R[n]) then R[n]:= k fi
od
od:
inds:= map(op, {indices(R)}):
N:= min({$1..max(inds)+1} minus inds):
seq(R[i], i=1..N-1); # Robert Israel, Jul 24 2017
MATHEMATICA
Table[k=1; While[Nand[Length@#>=n, PrimeQ[Total@Take[PadLeft[#, n], n]]]&@Divisors@k, k++]; k, {n, 1, 20}](* Program from Michael De Vlieger adapted for this sequence. See A289776 *)
PROG
(PARI) a(n) = {my(i = 2, d); while(1, d = divisors(i); if(#d >= n, if(isprime(sum(j=#d-n+1, #d, d[j])), return(i), i++), i++)); i} \\ David A. Corneth, Jul 20 2017
(Python)
from sympy import divisors, isprime
def A290126(n):
i = 1
while len(divisors(i)) < n or not isprime(sum(divisors(i)[-n:])):
i += 1
return i # Chai Wah Wu, Aug 05 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Jul 20 2017
STATUS
approved