%I #9 Nov 06 2022 07:33:37
%S 3,10,12,141,278,387,421
%N Numbers k such that the aliquot sequence of 2^k ends with the prime 7.
%H Jean-Luc Garambois, <a href="http://www.aliquotes.com/aliquotes_puissances_entieres/aliquotes_puissances_entieres.html">Aliquot sequences starting on integer powers n^i</a>, n^i project.
%H Mersenne forum, <a href="https://mersenneforum.org/showpost.php?p=617134&postcount=2053">n^i project</a>.
%F Define s(i) = sigma(i) - i = A000203(i) - i. Then k is a term of this sequence if the aliquot sequence obtained by repeatedly applying the mapping i->s(i) taking as initial value 2^k terminates in the prime 7.
%e a(4)=141 because the aliquot sequence that starts with the integer 2^141 ends with the prime number 7 and there are only three smaller powers of 2 that do the same: 2^3, 2^10 and 2^12.
%o (PARI) f(n) = if (n==1, return(2)); my(list = List(), s=2^n); for (i=1, oo, s = sigma(s) - s; if (#select(x->(x==s), list), return(0)); if (isprime(s), return (s)); listput(list, s); );
%o isok(m) = f(m) == 7;
%Y Cf. A127164, A358239.
%K nonn,hard,more
%O 1,1
%A _Jean Luc Garambois_, Nov 06 2022