OFFSET
1,1
LINKS
Felix Huber, Table of n, a(n) for n = 1..10000
FORMULA
If t is a term, then t*(p_1*p_2)^m = t*A007947(t)^m is also a term for any positive integer m.
EXAMPLE
160 = 2^5*5^1 has exactly two prime-power factors with distinct exponents and the lattice distance between (2, 5) and (5, 1) is an integer: sqrt((5 - 2)^2 + (1 - 5)^2) = 5. Hence, 160 is a term.
MAPLE
A387172:=proc(N) # To get all terms <= N
local p, i, j, k, l, m, x, y, u, v;
l:=[];
for x from 2 while min(2^(2*x+1)*(x^2+1), 2^(x^2)*(2*x+2))<=N do
for y to x-1 do
if gcd(x, y)=1 and is(x-y, odd) then
u:=x^2-y^2;
v:=2*x*y;
for i while min(2^(u*i+1)*(v*i+2), 2^(v*i+1)*(u*i+2))<=N do
l:=[op(l), i*[v, u]];
l:=[op(l), i*[u, v]];
od
fi
od
od;
m:=[];
for k in l do
for i while ithprime(i)^(k[1]+1)*(ithprime(i)+k[2])<=N do
p:=ithprime(i);
for j while p^(k[1]+j)*(p+k[2])^j<=N do
if isprime(p+k[2]) then
m:=[op(m), p^(k[1]+j)*(p+k[2])^j];
if p^j*(p+k[2])^(k[1]+j)<=N then
m:=[op(m), p^j*(p+k[2])^(k[1]+j)];
fi
fi
od
od
od;
return op(sort(m))
end proc;
A387172(5316979);
CROSSREFS
KEYWORD
nonn
AUTHOR
Felix Huber, Oct 06 2025
STATUS
approved
