OFFSET
1,1
COMMENTS
From Peter Kagey, Jun 22 2015: (Start)
a(n) is a bijection from the positive integers to A013929 (numbers that are not squarefree). Proof:
(1) Injection: Suppose that b<c and a(b) == a(c). By definition and assumption, b < c < a(c) = a(b). Because a(c) = a(b), b, c, a(b), and a(c) must all have the same squarefree part, thus b*c must be a perfect square. However c < a(b), so a(b) must not be the minimal solution. This is a contradiction. If b<c, then a(b) != a(c) so the function is an injection.
LINKS
Peter Kagey, Table of n, a(n) for n = 1..5000
FORMULA
a(n) = n + A067722(n). - Peter Kagey, Feb 05 2015
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = 1 + 2*zeta(3)/zeta(2) + Pi^2/15 = 3.11949956554216757204... . - Amiram Eldar, Feb 17 2024
EXAMPLE
12 is the smallest integer > 3 such that 3*12 = 6^2 is a perfect square, hence a(3) = 12.
MAPLE
f:= proc(n) local F, f, x, y;
F:= ifactors(n)[2];
x:= mul(`if`(f[2]::odd, f[1], 1), f=F);
y:= mul(f[1]^floor(f[2]/2), f=F);
x*(y+1)^2
end proc:
map(f, [$1..100]); # Robert Israel, Jun 23 2015
MATHEMATICA
a[n_] := For[k = n+1, True, k++, If[IntegerQ[Sqrt[k*n]], Return[k]]]; Array[a, 100] (* Jean-François Alcover, Jan 26 2018 *)
PROG
(PARI) a(n)=if(n<0, 0, s=n+1; while(issquare(s*n)==0, s++); s)
(PARI) a(n)=my(c=core(n)); (sqrtint(n/c)+1)^2*c \\ Charles R Greathouse IV, Jun 23 2015
(Haskell)
a072905 n = head [k | k <- [n + 1 ..], a010052 (k * n) == 1]
-- Reinhard Zumkeller, Feb 07 2015
(Ruby)
def a(n)
k = Math.sqrt(n).to_i
k -= 1 until n % k**2 == 0
n + 2*n/k + n/(k**2)
end # Peter Kagey, Jul 27 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, Aug 10 2002
STATUS
approved