login
Replace each prime power in the prime-factorization of n with the next higher prime-power.
3

%I #25 Feb 07 2023 08:09:03

%S 1,3,4,5,7,12,8,9,11,21,13,20,16,24,28,17,19,33,23,35,32,39,25,36,27,

%T 48,29,40,31,84,32,37,52,57,56,55,41,69,64,63,43,96,47,65,77,75,49,68,

%U 53,81,76,80,59,87,91,72,92,93,61,140,64,96,88,67,112,156,71,95,100,168,73

%N Replace each prime power in the prime-factorization of n with the next higher prime-power.

%H Robert Israel, <a href="/A120635/b120635.txt">Table of n, a(n) for n = 1..10000</a>

%e 12 = 2^2 *3^1. 5 is the prime power closest to 2^2 and larger than 2^2. 4 is the prime power closest to 3 and larger than 3. So a(12) = 5*4 = 20.

%p N:= 100: # for a(1)..a(N)

%p PP:= select(t -> nops(numtheory:-factorset(t))=1, [$2..N]):

%p g:= proc(n) local i;

%p if member(n,PP,i) then PP[i+1] fi

%p end proc:

%p f:= proc(n) local F;

%p F:= ifactors(n)[2];

%p convert(map(t -> g(t[1]^t[2]), F), `*`)

%p end proc:

%p map(f, [$1..N]); # _Robert Israel_, Mar 02 2022

%t nextPrimePower[n_] := Module[{k}, For[k = n+1, True, k++, If[PrimeNu[k] == 1, Return[k]]]];

%t a[n_] := If[n == 1, 1, Times @@ (nextPrimePower[Power @@ #]& /@ FactorInteger[n])];

%t Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Feb 07 2023 *)

%o (PARI) { a(n) = local(f,r,k,d); f=factorint(n); r=1; for(i=1,matsize(f)[1], k=f[i,1]^f[i,2]+1; while(!isprime(k) && (!ispower(k,,&d)||!isprime(d)), k++); r*=k); r } \\ _Max Alekseyev_, Feb 01 2007

%Y Cf. A120636.

%K nonn,mult

%O 1,2

%A _Leroy Quet_, Jun 22 2006

%E More terms from _Max Alekseyev_, Feb 01 2007