login
Least m>n with same smallest odd prime factor as n.
2

%I #11 Mar 09 2019 11:32:12

%S 2,4,6,8,10,9,14,16,12,20,22,15,26,28,18,32,34,21,38,25,24,44,46,27,

%T 35,52,30,49,58,33,62,64,36,68,40,39,74,76,42,50,82,45,86,88,48,92,94,

%U 51,56,55,54,104,106,57,65,77,60,116,118,63,122,124,66,128,70,69,134,136

%N Least m>n with same smallest odd prime factor as n.

%C A078701(a(n))=A078701(n), A078701(i)<>A078701(n), n<i<a(n);

%C n + A078701(n) <= a(n) <= 2*n;

%C a(2^k) = 2^(k+1), as A078701(2^k) = 1.

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

%p N:= 100:

%p A:= Vector(N):

%p p:= 2:

%p do

%p p:= nextprime(p);

%p if p > N then break fi;

%p R:= select(k -> A[k] = 0, [$1..N]);

%p S:= select(`<=`,R,N/p);

%p A[p*S]:= Vector(p*R[2..1+nops(S)]);

%p od:

%p for k from 0 to ilog2(N) do A[2^k]:= 2^(k+1) od:

%p convert(A,list); # _Robert Israel_, Oct 25 2017

%t sopf[n_] := SelectFirst[FactorInteger[n][[All, 1]], # > 2&];

%t a[n_] := For[p = sopf[n]; m = n+1, True, m++, If[p == sopf[m], Return[m]]];

%t Array[a, 100] (* _Jean-François Alcover_, Mar 09 2019 *)

%Y Cf. A079432(n) = a(a(n)).

%Y Cf. A078701.

%K nonn,look

%O 1,1

%A _Reinhard Zumkeller_, Jan 09 2003