cp's OEIS Frontend

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.

A358199 a(n) is the least integer whose sum of the i-th powers of the proper divisors is a prime for 1 <= i <= n, or -1 if no such number exists.

This page as a plain text file.
%I A358199 #30 Nov 16 2022 06:58:01
%S A358199 4,4,981,8829,8829,122029105,2282761881
%N A358199 a(n) is the least integer whose sum of the i-th powers of the proper divisors is a prime for 1 <= i <= n, or -1 if no such number exists.
%e A358199 4 is a term since the strict divisors of 4 are {1, 2}, 1^1 + 2^1 = 3 and 1^2 + 2^2 = 5 are prime and no number < 4 has this property.
%o A358199 (PARI)
%o A358199 card(n)=my(c=1,s=0);s=sigma(n)-n;while(isprime(s),c++;s=sigma(n,c)-n^c);c--
%o A358199 a(n)=my(x=0);for(k=1,+oo,x=card(k);if(x>=n,return(k)))
%o A358199 (Python)
%o A358199 from itertools import count
%o A358199 from math import prod
%o A358199 from sympy import isprime, factorint
%o A358199 def A358199(n):
%o A358199     for m in count(2):
%o A358199         f = factorint(m).items()
%o A358199         if all(map(isprime,(prod((p**((e+1)*i)-1)//(p**i-1) for p,e in f) - m**i for i in range(1,n+1)))):
%o A358199             return m # _Chai Wah Wu_, Nov 15 2022
%Y A358199 Cf. A001065 (s1), A180852, A357324, A057709, A000203, A001157, A001158.
%Y A358199 Subsequence of A037020.
%K A358199 nonn,more
%O A358199 1,1
%A A358199 _Jean-Marc Rebert_, Nov 02 2022