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 A228018 #21 Sep 18 2024 08:43:35 %S A228018 9,49,243,961,16129,67092481,17179607041,274876858369, %T A228018 4611686014132420609 %N A228018 Prime powers p (A025475) such that the sum of the proper divisors of p is also a prime power. %C A228018 Numbers k such that both k and A001065(k) are in A025475. %C A228018 Eight of the first nine terms are squares of Mersenne primes (A133049). %C A228018 From _Pontus von Brömssen_, Sep 17 2024: (Start) %C A228018 All squares of Mersenne primes are terms. %C A228018 10^20 < a(10) <= A133049(9) = (2^61-1)^2. %C A228018 All terms are odd. Otherwise, 2^k would be a term for some positive k >= 2 and then A001065(2^k) = 2^k-1 would be a prime power in A025475, which is impossible by Catalan's conjecture (Mihăilescu's theorem). %C A228018 (End) %e A228018 Proper divisors of 243 are 1, 3, 9, 27, 81, their sum is 121 = 11^2, so 243 is in the sequence. %o A228018 (C) %o A228018 #include <stdio.h> %o A228018 #include <stdlib.h> %o A228018 #define TOP (1ULL<<32) %o A228018 typedef unsigned long long U64; %o A228018 int compare64(const void *p1, const void *p2) { %o A228018 if (*(U64*)p1== *(U64*)p2) return 0; %o A228018 return (*(U64*)p1 < *(U64*)p2) ? -1 : 1; %o A228018 } %o A228018 U64 findElement(U64 *a, U64 start, U64 end, U64 element) { %o A228018 if (start+1==end) return (a[start]==element); %o A228018 U64 mid = (start+end)/2; %o A228018 if (a[mid] > element) %o A228018 return findElement(a, start, mid, element); %o A228018 return findElement(a, mid, end, element); %o A228018 } %o A228018 int main() { %o A228018 U64 i, j, p, n=0, *pp = (U64*)malloc(TOP/2), sum; %o A228018 unsigned char *c = (unsigned char *)malloc(TOP/16); %o A228018 if (!c || !pp) exit(1); %o A228018 memset(c, 0, TOP/16); %o A228018 pp[n++] = 1; %o A228018 for (i=1; i < TOP; i+=2) { %o A228018 if ((c[i>>4] & (1<<((i>>1) & 7)))==0) { %o A228018 for (p=i+(i==1), j = p*p; ; j*=p) { %o A228018 pp[n++] = j; %o A228018 double k = ((double)j) * ((double)p); %o A228018 if (k >= ((double)(1ULL<<60)*16.0)) break; %o A228018 } %o A228018 if (i>1) %o A228018 for (j=i*i>>1; j<TOP/2; j+=i) c[j>>3] |= 1<<(j&7); %o A228018 } %o A228018 if ((i&(i-2))==1) printf("%llu ", i); %o A228018 } %o A228018 printf("// %llu\n\n", n); %o A228018 qsort(pp, n, 8, compare64); %o A228018 for (i=1; i < TOP; i+=2) %o A228018 if ((c[i>>4] & (1<<((i>>1) & 7)))==0) %o A228018 for (p=i+(i==1), sum=1+p, j = p*p; ; j*=p) { %o A228018 if (findElement(pp, 0, n, sum)) printf("%llu, ", j); %o A228018 sum += j; %o A228018 double k = ((double)j) * ((double)p); %o A228018 if (k >= ((double)(1ULL<<60)*16.0)) break; %o A228018 } %o A228018 return 0; %o A228018 } %o A228018 (PARI) for(n=1,10^6,if(!isprime(n),v=factor(n);if(matsize(v)[1]==1,s=sumdiv(n,d,d)-n;if(!isprime(s),vv=factor(s);if(matsize(vv)[1]==1,print(n)))))) /* _Ralf Stephan_, Aug 05 2013 */ %Y A228018 Cf. A025475, A001065, A133049. %K A228018 nonn,more %O A228018 1,1 %A A228018 _Alex Ratushnyak_, Aug 02 2013