This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A290126 #26 Aug 31 2021 02:43:20 %S A290126 2,2,4,28,16,140,24,90,120,108,60,144,300,288,120,672,252,432,240,630, %T A290126 960,756,480,1200,1080,1728,1680,1008,720,2016,840,3150,2160,2700, %U A290126 1980,4800,2520,3780,3240,8736,3960,3600,6720,6930,10800,6300,4200,16848,9240,5040 %N A290126 Least k such that the sum of the n greatest divisors of k is a prime number. %C A290126 The corresponding primes are 2, 3, 7, 53, 31, 307, 59, 223, 331, 277, 167, 397, 853, 809, 359, 1973, 727, 1237, ... %C A290126 The squares of the sequence are 4, 16, 144, 3600, ... %H A290126 Chai Wah Wu, <a href="/A290126/b290126.txt">Table of n, a(n) for n = 1..1000</a> %e A290126 a(4)=28 because the sum of the last 4 divisors of 28: 28+14+7+4 = 53 is a prime number. %p A290126 M:= 20000: # to get all terms before the first term > M %p A290126 R:= 'R': %p A290126 for k from 2 to M do %p A290126 F:= ListTools:-PartialSums(sort(convert( %p A290126 numtheory:-divisors(k),list),`>`)); %p A290126 for n in select(t -> isprime(F[t]),[$1..nops(F)]) do %p A290126 if not assigned(R[n]) then R[n]:= k fi %p A290126 od %p A290126 od: %p A290126 inds:= map(op,{indices(R)}): %p A290126 N:= min({$1..max(inds)+1} minus inds): %p A290126 seq(R[i],i=1..N-1); # _Robert Israel_, Jul 24 2017 %t A290126 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 *) %o A290126 (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 %o A290126 (Python) %o A290126 from sympy import divisors, isprime %o A290126 def A290126(n): %o A290126 i = 1 %o A290126 while len(divisors(i)) < n or not isprime(sum(divisors(i)[-n:])): %o A290126 i += 1 %o A290126 return i # _Chai Wah Wu_, Aug 05 2017 %Y A290126 Cf. A000290, A027750, A240698, A289776. %K A290126 nonn %O A290126 1,1 %A A290126 _Michel Lagneau_, Jul 20 2017