OFFSET
2,1
COMMENTS
A rearrangement of numbers beginning with 2.
LINKS
Robert Israel, Table of n, a(n) for n = 2..2000
EXAMPLE
a(40) = 232 = 2^3 * 29 as 40 = 2^3 * 5.
MAPLE
se := {seq(20+k, k=0..9), seq(200+k, k=0..99), seq(2000+k, k=0..999), seq(20000+k, k=0..9999), seq(200000+k, k=0..99999)}: a[2] := 2:for n from 3 to 60 do l := sort(convert(se, list)): ifa := ifactors(n):no := nops(ifa[2]): prisig := sort([seq(ifa[2][j][2], j=1..no)]):h := 0:while(true) do h := h+1: ifa := ifactors(l[h]): no2 := nops(ifa[2]):prisig2 := sort([seq(ifa[2][j][2], j=1..no2)]):ok := true: if(no<>no2) then ok := false: else for w from 1 to no do if(prisig[w]<>prisig2[w]) then ok := false:break:fi:od:fi: if(ok=true) then a[n] := l[h]:se := se minus {l[h]}:break:fi:od:od:seq(a[q], q=2..60); # Sascha Kurz
# alternative
ps:= proc(n) local t; sort(map(t -> t[2], ifactors(n)[2])) end proc:
R:= NULL: PS:= 'PS':
with(queue):
PS[[6]]:= new(17^6, 37^6): PS[[5]]:= new(3^5, 19^5): PS[[9]]:= new(11^9, 31^9 ):
PS[[10]]:= new(7^10):
d:= 0: x:= 1:
for n from 2 to 1000 while x < 10^7 do
X:= ps(n);
if not assigned(PS[X]) then PS[X]:= new() fi;
flag:= empty(PS[X]);
while flag do
x:= x+1;
if x >= 3*10^d then d:= d+1; x:= 2*10^d fi;
Y:= ps(x);
if not assigned(PS[Y]) then PS[Y]:= new() fi;
if empty(PS[Y]) or x > front(PS[Y]) then enqueue(PS[Y], x) fi;
flag:= (Y<>X);
od;
y:= dequeue(PS[X]);
R:= R, y;
od:
R; # Robert Israel, Apr 19 2021
MATHEMATICA
Block[{a = {}, s = PositionIndex@ Table[ToString@ Sort[FactorInteger[n][[All, -1]]], {n, Product[Prime@ i, {i, 6}]}]}, Do[AppendTo[a, #] &@ SelectFirst[Lookup[s, ToString@ Sort[FactorInteger[n][[All, -1]]] ], And[First@ IntegerDigits@ # == 2, FreeQ[a, #]] &], {n, 2, 55}]; a] (* Michael De Vlieger, Aug 15 2017 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Aug 30 2003
EXTENSIONS
Corrected and extended by Sascha Kurz, Sep 22 2003
STATUS
approved