OFFSET
2,1
COMMENTS
Finding the first appearance of 2023 was the subject of an Internet puzzle in September 2023. (See web link.) The least such n for which a(n) = 2023 is 26273633422851562500 = 2^2 * 3^16 * 5^16.
LINKS
Jane Street, Getting from a to b, September 2023.
EXAMPLE
a(4) = 7, as "4^4 = a^b" has 7 integer solutions: 2^8, (-2)^8, 4^4, (-4)^4, 16^2, (-16)^2, 256^1.
MAPLE
a:= n-> add(2-irem(d, 2), d=numtheory[divisors](
igcd(map(i-> i[2], ifactors(n)[2])[])*n)):
seq(a(n), n=2..100); # Alois P. Heinz, Oct 02 2023
MATHEMATICA
intPowCount[n_] := Module[{m, F, i, t},
m = n (GCD @@ FactorInteger[n][[All, 2]]);
t = 0;
While[Mod[m, 2] == 0,
t++;
m = m/2];
t = 2 t + 1;
F = FactorInteger[m][[All, 2]];
If[m > 1,
For[i = 1, i <= Length[F], i++,
t = t (F[[i]] + 1)];
];
Return[t]]
PROG
(Python)
from math import gcd
from sympy import divisor_count, factorint
def A366161(n): return divisor_count((m:=n*gcd(*factorint(n).values()))>>(t:=(m-1&~m).bit_length()))*(t<<1|1) # Chai Wah Wu, Oct 04 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Andy Niedermaier, Oct 02 2023
STATUS
approved