cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A072905 a(n) is the least k > n such that k*n is a square.

This page as a plain text file.
%I A072905 #56 Feb 17 2024 04:03:38
%S A072905 4,8,12,9,20,24,28,18,16,40,44,27,52,56,60,25,68,32,76,45,84,88,92,54,
%T A072905 36,104,48,63,116,120,124,50,132,136,140,49,148,152,156,90,164,168,
%U A072905 172,99,80,184,188,75,64,72,204,117,212,96,220,126,228,232,236,135,244,248
%N A072905 a(n) is the least k > n such that k*n is a square.
%C A072905 From _Peter Kagey_, Jun 22 2015: (Start)
%C A072905 a(n) is a bijection from the positive integers to A013929 (numbers that are not squarefree). Proof:
%C A072905 (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.
%C A072905 (2) Surjection: Given some number k in A013929, a(A007913(k)*(A000188(k)-1)^2.) = k (End)
%H A072905 Peter Kagey, <a href="/A072905/b072905.txt">Table of n, a(n) for n = 1..5000</a>
%F A072905 a(n) = n + A067722(n). - _Peter Kagey_, Feb 05 2015
%F A072905 a(n) = A007913(n)*(A000188(n)+1)^2. - _Peter Kagey_, Feb 06 2015
%F A072905 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
%e A072905 12 is the smallest integer > 3 such that 3*12 = 6^2 is a perfect square, hence a(3) = 12.
%p A072905 f:= proc(n) local F,f,x,y;
%p A072905      F:= ifactors(n)[2];
%p A072905      x:= mul(`if`(f[2]::odd,f[1],1),f=F);
%p A072905      y:= mul(f[1]^floor(f[2]/2),f=F);
%p A072905      x*(y+1)^2
%p A072905 end proc:
%p A072905 map(f, [$1..100]); # _Robert Israel_, Jun 23 2015
%t A072905 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 *)
%o A072905 (PARI) a(n)=if(n<0,0,s=n+1; while(issquare(s*n)==0,s++); s)
%o A072905 (PARI) a(n)=my(c=core(n)); (sqrtint(n/c)+1)^2*c \\ _Charles R Greathouse IV_, Jun 23 2015
%o A072905 (Haskell)
%o A072905 a072905 n = head [k | k <- [n + 1 ..], a010052 (k * n) == 1]
%o A072905 -- _Reinhard Zumkeller_, Feb 07 2015
%o A072905 (Ruby)
%o A072905 def a(n)
%o A072905   k = Math.sqrt(n).to_i
%o A072905   k -= 1 until n % k**2 == 0
%o A072905   n + 2*n/k + n/(k**2)
%o A072905 end # _Peter Kagey_, Jul 27 2015
%Y A072905 Cf. A000188, A007913, A010052, A067722.
%Y A072905 Cf. A182448, A253905.
%K A072905 easy,nonn
%O A072905 1,1
%A A072905 _Benoit Cloitre_, Aug 10 2002