A280964 a(n) is the least term that is not a power of p, the n-th prime, in the sequence of numbers whose consecutive divisors have a ratio satisfying numerator - denominator = p-1.
6, 15, 725, 91, 15851, 30589, 6977093777, 703
Offset: 1
Examples
a(1) = 6 is the first non-(prime power) of 2 (the 1st prime) in A140110. a(2) = 15 is the first non-(prime power) of 3 (the 2nd prime) in A280963. For n=3, p=5, the sequence begins: 1, 5, 25, 125, 625, 725, ... so a(3)=725. For n=4, p=7, the sequence begins: 1, 7, 49, 91, 343, ... so a(4)=91.
Programs
-
Mathematica
Table[Function[p, SelectFirst[Range[10^5], Function[n, And[! IntegerQ@ Log[p, n], Times @@ Boole@ Map[Abs[Numerator@ # - Denominator@ #] == p - 1 &[#2/#1] & @@ # &, Partition[Divisors@ n, 2, 1]] > 0]] ]]@ Prime@ n /. k_ /; MissingQ@ k -> Nothing, {n, 6}] (* Michael De Vlieger, Jan 13 2017, Version 10.2 *)
-
PARI
isok(n, plus) = {my(vd = divisors(n)); for (k=1, #vd - 1, r = vd[k+1]/vd[k]; if (numerator(r) != denominator(r) + plus, return(0));); return(1);} isokp(k) = (k!= 1) && !isprime(k) && ! isprimepower(k); findnp(n) = {k = 1; ok = 0; nb = 0; while (! ok, okk = isok(k, n); if (okk, ok = isokp(k); if (! ok, nb++);); if (!ok, k++);); k;} lista(nn) = for(n=1, nn, print1(findnp(prime(n)-1), ", "));
-
PARI
/ * alternate program; does it give the least terms? */ isokplus(n, plus) = {my(vd = divisors(n)); for (k=1, #vd - 1, r = vd[k+1]/vd[k]; if (numerator(r) != denominator(r) + plus, return(0));); return(1);} findqq(p) = {ok = 0; ip = 1; while (!ok, ik = 1; while (!ok, if (isprime(q= ik*p^ip+(p-1)) && isokplus(p^ip*q, p-1), return([p^ip, q])); ik++; if (ik > p, break);); ip ++;); return ([]);} listff(nn) = {for (n=1, nn, p = prime(n); v = findqq(p); pp = v[1]; q = v[2]; print1(pp*q, ", "););}
Comments