login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A228018 Prime powers p (A025475) such that sum of proper divisors of p is also a prime power. 0
9, 49, 243, 961, 16129, 67092481, 17179607041, 274876858369, 4611686014132420609 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Intersection of A025475(n) and A001065(A025475(n)).

Eight of the first nine terms are squares of Mersenne primes (A133049).

LINKS

Table of n, a(n) for n=1..9.

EXAMPLE

Proper divisors of 243 are 1, 3, 9, 27, 81, their sum is 121 = 11^2, so 243 is in the sequence.

PROG

(C)

#include <stdio.h>

#include <stdlib.h>

#define TOP (1ULL<<32)

typedef unsigned long long U64;

int compare64(const void *p1, const void *p2) {

  if (*(U64*)p1== *(U64*)p2) return 0;

  return (*(U64*)p1 < *(U64*)p2) ? -1 : 1;

}

U64 findElement(U64 *a, U64 start, U64 end, U64 element) {

  if (start+1==end)  return (a[start]==element);

  U64 mid = (start+end)/2;

  if (a[mid] > element)

    return findElement(a, start, mid, element);

  return findElement(a, mid, end, element);

}

int main() {

  U64 i, j, p, n=0, *pp = (U64*)malloc(TOP/2), sum;

  unsigned char *c = (unsigned char *)malloc(TOP/16);

  if (!c || !pp) exit(1);

  memset(c, 0, TOP/16);

  pp[n++] = 1;

  for (i=1; i < TOP; i+=2) {

    if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {

      for (p=i+(i==1), j = p*p; ; j*=p) {

        pp[n++] = j;

        double k = ((double)j) * ((double)p);

        if (k >= ((double)(1ULL<<60)*16.0)) break;

      }

      if (i>1)

        for (j=i*i>>1; j<TOP/2; j+=i)  c[j>>3] |= 1<<(j&7);

    }

    if ((i&(i-2))==1)  printf("%llu ", i);

  }

  printf("// %llu\n\n", n);

  qsort(pp, n, 8, compare64);

  for (i=1; i < TOP; i+=2)

    if ((c[i>>4] & (1<<((i>>1) & 7)))==0)

      for (p=i+(i==1), sum=1+p, j = p*p; ; j*=p) {

        if (findElement(pp, 0, n, sum)) printf("%llu, ", j);

        sum += j;

        double k = ((double)j) * ((double)p);

        if (k >= ((double)(1ULL<<60)*16.0)) break;

      }

  return 0;

}

(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 */

CROSSREFS

Cf. A025475, A001065, A133049.

Sequence in context: A080026 A060867 A192814 * A081655 A181539 A224473

Adjacent sequences:  A228015 A228016 A228017 * A228019 A228020 A228021

KEYWORD

nonn,more

AUTHOR

Alex Ratushnyak, Aug 02 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 20 14:54 EST 2019. Contains 329337 sequences. (Running on oeis4.)