OFFSET
1,1
COMMENTS
If p = a(n) is a prime solution, then (n+1)*(p-1) = n*(p+1) and p = 2n+1, so position for p if it is in fact a minimal solution is at n = (p-1)/2. E.g. 29 appears at 14th position shown by A005097. On the other hand large and (seemingly always composite) solutions arise at indices shown essentially by A047845. Also, differences between the sites of two consecutive small prime solutions appears to be d/2, half the difference between consecutive primes (A001223).
LINKS
Donovan Johnson, Table of n, a(n) for n = 1..456
MATHEMATICA
max = 10^7; a[n_] := For[m = 3, m <= max, m++, If[(n+1)*EulerPhi[m] == n*DivisorSigma[1, m], Print[m]; Return[m]]] /. Null -> -1; Array[a, 50] (* Jean-François Alcover, Oct 08 2016 *)
PROG
(Python)
from itertools import count
from math import prod
from sympy import factorint
def A065824(n):
for m in count(1):
f = factorint(m)
if (n+1)*m*prod((p-1)**2 for p in f)==n*prod(p**(e+2)-p for p, e in f.items()):
return m # Chai Wah Wu, Aug 12 2024
CROSSREFS
KEYWORD
nice,nonn
AUTHOR
Labos Elemer, Nov 23 2001
STATUS
approved