A215197
Numbers k such that k and k + 1 are both of the form p*q^4 where p and q are distinct primes.
Original entry on oeis.org
2511, 7856, 10287, 15471, 15632, 18063, 20816, 28592, 36368, 40816, 54512, 75248, 88047, 93231, 101168, 126927, 134703, 160624, 163376, 170991, 178767, 210032, 215216, 217808, 220624, 254096, 256527, 274671, 280624, 292976, 334448, 347408, 443151, 482192
Offset: 1
2511 is a member as 2511 = 31*3^4 and 2512 = 157*2^4.
-
with(numtheory):for n from 3 to 500000 do:x:=factorset(n):y:=factorset(n+1):n1:=nops(x):n2:=nops(y):if n1=2 and n2=2 then xx1:=x[1]*x[2]^4 : xx2:=x[2]*x[1]^4:yy1:=y[1]*y[2]^4: yy2:=y[2]*y[1]^4:if (xx1=n or xx2=n) and (yy1=n+1 or yy2=n+1) then printf("%a, ", n):else fi:fi:od:
-
lst={}; Do[f1=FactorInteger[n]; If[Sort[Transpose[f1][[2]]]=={1, 4}, f2=FactorInteger[n+1]; If[Sort[Transpose[f2][[2]]]=={1, 4}, AppendTo[lst, n]]], {n, 3, 55000}]; lst
(* First run program for A178739 *) Select[A178739, MemberQ[A178739, # + 1] &] (* Alonso del Arte, Aug 05 2012 *)
-
is(n)=numdiv(n)==10 && numdiv(n+1)==10 \\ Charles R Greathouse IV, Jun 19 2016
-
is(n)=vecsort(factor(n)[,2])==[1,4]~ && vecsort(factor(n+1)[,2])==[1,4]~ \\ Charles R Greathouse IV, Jun 19 2016
A215199
Smallest number k such that k and k+1 are both of the form p*q^n where p and q are distinct primes.
Original entry on oeis.org
14, 44, 135, 2511, 8991, 29888, 916352, 12393728, 155161088, 2200933376, 6856828928, 689278976, 481758175232, 3684603215871, 35419114668032, 2035980763136, 174123685117952, 9399153082499072, 19047348965998592, 203368956137832447, 24217192574746623, 2503092614937444351
Offset: 1
a(3) = 135 because 135 = 5*3^3 and 136 = 17*2^3;
a(4) = 2511 because 2511 = 31*3^4 and 2512 = 157*2^4.
-
psig := proc(n)
local s,p ;
s := [] ;
for p in ifactors(n)[2] do
s := [op(s),op(2,p)] ;
end do:
sort(s) ;
end proc:
A215199 := proc(n)
local slim,smi,sma,ca,qi,q,p,k ;
for slim from 0 do
smi := slim*1000 ;
sma := (slim+1)*1000 ;
ca := sma ;
q := 2 ;
for qi from 1 do
p := nextprime(floor(smi/q^n)-1) ;
while p*q^n < sma do
if p <> q then
k := p*q^n ;
if psig(k+1) = [1,n] then
ca := min(ca,k) ;
end if;
end if;
p := nextprime(p) ;
end do:
if q^n >= sma then
break;
end if;
q := nextprime(q) ;
end do:
if ca < sma then
return ca ;
end if;
end do:
end proc:
for n from 1 do
print(A215199(n)) ;
end do; # R. J. Mathar, Aug 07 2012
-
from sympy import isprime, nextprime
from sympy.ntheory.modular import crt
def A215199(n):
l = len(str(3**n))-1
l10, result = 10**l, 2*10**l
while result >= 2*l10:
l += 1
l102, result = l10, 20*l10
l10 *= 10
q, qn = 2, 2**n
while qn <= l10:
s, sn = 2, 2**n
while sn <= l10:
if s != q:
a, b = crt([qn,sn],[0,1])
if a <= l102:
a = b*(l102//b) + a
while a < l10:
p, t = a//qn, (a-1)//sn
if p != q and t != s and isprime(p) and isprime(t):
result = min(result,a-1)
a += b
s = nextprime(s)
sn = s**n
q = nextprime(q)
qn = q**n
return result # Chai Wah Wu, Mar 12 2019
A215198
Numbers n such that n and n + 1 are both of the form p*q^5 where p and q are distinct primes.
Original entry on oeis.org
8991, 9375, 335583, 364256, 488672, 535328, 677727, 690848, 755487, 768608, 864351, 908576, 924128, 955232, 1097631, 1377567, 1424223, 1608416, 1688607, 1875231, 2121632, 2124063, 2168288, 2277152, 2541536, 2575071, 2621727, 2901663, 3190624, 3241376, 3409375
Offset: 1
8991 is a member as 8991 = 37*3^5 and 8992 = 281*2^5.
-
with(numtheory):for n from 3 to 10^7 do:x:=factorset(n):y:=factorset(n+1):n1:=nops(x):n2:=nops(y):if n1=2 and n2=2 then xx1:=x[1]*x[2]^5 : xx2:=x[2]*x[1]^5:yy1:=y[1]*y[2]^5: yy2:=y[2]*y[1]^5:if (xx1=n or xx2=n) and (yy1=n+1 or yy2=n+1) then printf("%a, ", n):else fi:fi:od:
-
lst={}; Do[f1=FactorInteger[n]; If[Sort[Transpose[f1][[2]]]=={1, 5}, f2=FactorInteger[n+1]; If[Sort[Transpose[f2][[2]]]=={1, 5}, AppendTo[lst, n]]], {n, 3, 10^7}]; lst
SequencePosition[Table[If[Sort[FactorInteger[n][[;;,2]]]=={1,5},1,0],{n,341*10^4}],{1,1}][[;;,1]] (* Harvey P. Dale, Nov 04 2023 *)
Showing 1-3 of 3 results.
Comments