OFFSET
1,1
COMMENTS
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
For d = 6 = 2*3, we must omit 3*d (because 3 | d) and get a(1) = 5*d = 30.
For d = 28 = 4*7, we get a(2) = 3*d = 84, a(3) = 5*d = 140, we omit 7*d,
a(4) = 11*d = 308, a(5) = 13*d = 364, a(6) = 17*d = 476, a(7) = 19*d = 532,
a(8) = 23*d = 644. So far all terms are in order of increasing size.
For d = 496 = 16*31, we get a(9) = 3*d = 1488 through a(21) = 47*d = 23312 (omitting 31*d), but the next larger term a(22) comes from the next perfect number, see below. Then we get a(23) = 53*d = 26288 through a(29) = 39184, a(31) = 41168 through a(38) = 56048, and a(40) = 62992.
For d = 8128 = 64*127, we get a(22) = 3*d = 24384, a(30) = 5*d = 40640, a(39) = 56896, a(41) = 89408, and all following terms up to 3*4096*8191.
MATHEMATICA
f[p_] := (2^p - 1)*2^(p - 1); evenPerf[n_] := f[MersennePrimeExponent[n]]; sp[p_, max_] := With[{pn = f[p]}, pn * Select[Complement[Range[3, Min[pn - 1, max/pn]], {2^p - 1}], PrimeQ]];
seq[max_] := Module[{s = {}, k = 1}, While[(pn = evenPerf[k]) < max/3, s = Join[s, sp[MersennePrimeExponent[k], max]]; k++]; Union[s]]; seq[60000] (* Amiram Eldar, Aug 05 2023, assuming that there are no odd perfect numbers below max *)
PROG
(PARI) forprime(q=1, 9, isprime(2^q-1)||next; print("\n/* q="q", d=", d=(2^q-1)<<(q-1), " */"); forprime(p=3, d-1, d%p || next; print1(d*p, ", "))) /* Note: This prints the terms in order of increasingly large perfect numbers, not in order of increasing terms: e.g., 243536, the last value for d = 496 = (2^5-1)*2^4, is printed before 24384, first term for d = 8128 = (2^7-1)*2^6. */
(PARI) A165772_upto(N=10^5)=select({
is_A165772(n)=my(v=valuation(n, 2), P); isprime(v+1) && (n=divrem(n>>v, P=2^(v+1)-1))[2]==0 && n[1] < P<<v && n[1]!=P && isprime(n[1]) && isprime(P)
}, [1..N\2]*2) \\ Older code updated and extended by M. F. Hasler, Jul 30 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Oct 11 2009
STATUS
approved