When d(m) = d(m+n) = n

Martin Fuller martin_n_fuller at btinternet.com
Sun Apr 20 23:52:21 CEST 2008


--- Jack Brennen <jb at brennen.net> wrote:

> Maximilian Hasler wrote:
> >>  a(n) = smallest positive integer such that
> >>  d(a(n)) = d(a(n)+2n) = 2n,
> >>  where d(m) is the number of positive divisors of
> >>  m.
> >>
> >>  The sequence begins: 3,6,12,70,...
> > 
> > lq080419(n,a)={n*=2;until(numdiv(a)==n && numdiv(a+n)==n,a++);a}
> > 
> > for(i=1,99,print1(lq080419(i)", "))
> > 3, 6, 12, 70, 600281, 60, 1458, 264, 450, 266875,
> >   *** until: user interrupt after 1mn, 18,250 ms.
> > (next term seems quite large, maybe the function should be made a
> bit
> > more intelligent....)
> > Maximilian
> > 
> > 
> 
> 
> 11th term is <= 12670498046853.
> 
> Proving whether that is the minimal one should be doable
> without too much trouble...
> 
> 

Here are the first 20 terms, confirming the 11th term above.

3, 6, 12, 70, 600281, 60, 1458, 264, 450, 266875, 12670498046853, 480,
3998684814453099, 11968722, 299538, 3640, 49921080474853515591, 1980,
6107691150665283203125, 14960

n=11,13,17,19 have a(n) and a(n)+n*2 as prime multiples of 3^(n-1) and
5^(n-1).  This continues for prime n up to 47 at least.  Is it likely
there will always be a solution of this form?

Martin Fuller

/* PARI/GP */
A_simple(n)=local(m=2);n*=2;until(numdiv(m)==n&numdiv(m+n)==n,m++);m

A_try_pair(p,q,n,limit)=
{
/* Helper for A_prime() */
/* Look for solution which is 0 mod p^(n-1) and -n*2 mod q^(n-1) */
  local(m = chinese(Mod(0,p^(n-1)), Mod(-n*2,q^(n-1))));
  forstep(x=lift(m), limit, component(m,1),
    if(isprime(x\p^(n-1)) & isprime((x+n*2)\q^(n-1)), return(x)));
  limit
}

A_try_above_below(m,n)=
{
/* Helper for A_prime() */
/* Function presumes that numdiv(m)==n*2 */
  if(numdiv(m-n*2)==n*2, limit=m-n*2,
    if(numdiv(m+n*2)==n*2, limit=m,
    0))
}

A_prime(n,limit,pairmax=30)=
{
  if (n%2==0 | !isprime(n), error("Only works for odd primes"));

  if (default(primelimit) < limit\nextprime(pairmax+1)^(n-1),
    default(primelimit, limit\nextprime(pairmax+1)^(n-1));
  );

/* Evens with numdiv==n*2 are {2^(n*2-1)} u {2*p^(n-1)} u {2^(n-1)*p}
*/
/* Potential solutions must come from different sets */
/* Try above and below first two sets */
  A_try_above_below(2^(n*2-1),n);
  forprime(p=3, (limit\2)^(1/(n-1)),
    if (A_try_above_below(2*p^(n-1),n), break));

/* Odd numbers with numdiv==n*2 are {p^(n*2-1)} u {p^(n-1)*q} */
/* Try where a(n) and a(n)+n*2 are (small prime)^(n-1)*(big prime) */
  forprime(p=3, pairmax, forprime(q=3, pairmax,
    if (p!=q, limit = A_try_pair(p,q,n,limit))));
  
/* Try above and below all other odd numbers with numdiv==n*2 */
  forprime(p=pairmax+1, (limit\3)^(1/(n-1)),
    forprime(q=3, limit\p^(n-1),
      if (p!=q & A_try_above_below(p^(n-1)*q,n), break)));

  forprime(p=3, limit^(1/21),
    if (A_try_above_below(p^21,n), break));

  limit
}






More information about the SeqFan mailing list