|
|
A065642
|
|
a(1) = 1; for n > 1, a(n) = Min {m > n | m has same prime factors as n ignoring multiplicity}.
|
|
37
|
|
|
1, 4, 9, 8, 25, 12, 49, 16, 27, 20, 121, 18, 169, 28, 45, 32, 289, 24, 361, 40, 63, 44, 529, 36, 125, 52, 81, 56, 841, 60, 961, 64, 99, 68, 175, 48, 1369, 76, 117, 50, 1681, 84, 1849, 88, 75, 92, 2209, 54, 343, 80, 153, 104, 2809, 72, 275, 98, 171, 116, 3481, 90, 3721
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
After the initial 1, a permutation of the nonsquarefree numbers A013929. The array A284457 is obtained as a dispersion of this sequence. - Antti Karttunen, Apr 17 2017
Numbers such that a(n)/n is not an integer are listed in A284342.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(10) = a(2 * 5) = 2 * 2 * 5 = 20; a(12) = a(2^2 * 3) = 2 * 3^2 = 18.
|
|
MAPLE
|
with(numtheory): P:=proc(n) local k; if n=1 then 1 else k:=n+1; while phi(k)/k<>phi(n)/n
do k:=k+1; od; k; fi; end: seq(P(i), i=1..10^2); # Paolo P. Lava, Jul 21 2017
|
|
MATHEMATICA
|
ffi[x_]:= Flatten[FactorInteger[x]]; lf[x_]:= Length[FactorInteger[x]]; ba[x_]:= Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}]; cor[x_]:= Apply[Times, ba[x]]; Join[{1}, Table[Min[Flatten[Position[Table[cor[w], {w, n+1, n^2}]-cor[n], 0]]+n], {n, 2, 100}]] (* This code is suitable since prime factor set is invariant iff squarefree kernel is invariant. *) (* G. C. Greubel, Oct 31 2018 *)
Array[If[# == 1, 1, Function[{n, c}, SelectFirst[Range[n + 1, n^2], Times @@ FactorInteger[#][[All, 1]] == c &]] @@ {#, Times @@ FactorInteger[#][[All, 1]]}] &, 61] (* Michael De Vlieger, Oct 31 2018 *)
|
|
PROG
|
(Haskell)
a065642 1 = 1
a065642 n = head [x | let rad = a007947 n, x <- [n+1..], a007947 x == rad]
(PARI) a(n)=if(n<2, return(1)); my(f=factor(n), r, mx, mn, t); if(#f~==1, return(f[1, 1]^(f[1, 2]+1))); f=f[, 1]; r=factorback(f); mn=mx=n*f[1]; forvec(v=vector(#f, i, [1, logint(mx/r, f[i])+1]), t=prod(i=1, #f, f[i]^v[i]); if(t<mn && t>n, mn=t)); mn \\ Charles R Greathouse IV, Oct 18 2017
(Scheme) (define (A065642 n) (if (= 1 n) n (let ((k (A007947 n))) (let loop ((n (+ n k))) (if (= (A007947 n) k) n (loop (+ n k))))))) ;; (Semi-naive implementation) - Antti Karttunen, Apr 17 2017
(Python)
from sympy import primefactors, prod
def a007947(n): return 1 if n < 2 else prod(primefactors(n))
def a(n):
if n==1: return 1
r=a007947(n)
n += r
while a007947(n)!=r:
n+=r
return n
|
|
CROSSREFS
|
|
|
KEYWORD
|
nice,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|