login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A254732 a(n) is the least k > n such that n divides k^2. 4
2, 4, 6, 6, 10, 12, 14, 12, 12, 20, 22, 18, 26, 28, 30, 20, 34, 24, 38, 30, 42, 44, 46, 36, 30, 52, 36, 42, 58, 60, 62, 40, 66, 68, 70, 42, 74, 76, 78, 60, 82, 84, 86, 66, 60, 92, 94, 60, 56, 60, 102, 78, 106, 72, 110, 84, 114, 116, 118, 90, 122, 124, 84, 72 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
A073353(n) <= a(n) <= 2*n. Any prime that divides n must also divide a(n), and because n divides (2*n)^2.
LINKS
FORMULA
a(n) = sqrt(n*A072905(n)).
a(n) = A019554(n)*(A000188(n)+1).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = 1 + zeta(3)/zeta(2) = 1 + A253905 = 1.73076296940143849872... . - Amiram Eldar, Feb 17 2024
EXAMPLE
a(12) = 18 because 12 divides 18^2, but 12 does not divide 13^2, 14^2, 15^2, 16^2, or 17^2.
MATHEMATICA
lk[n_]:=Module[{k=n+1}, While[!Divisible[k^2, n], k++]; k]; Array[lk, 70] (* Harvey P. Dale, Nov 05 2017 *)
PROG
(Ruby)
def a(n)
(n+1..2*n).find { |k| k**2 % n == 0 }
end
(PARI)
a(n)=for(k=n+1, 2*n, if(k^2%n==0, return(k)))
vector(100, n, a(n)) \\ Derek Orr, Feb 06 2015
(PARI) a(n)=my(t=factorback(factor(n)[, 1])); forstep(k=n+t, 2*n, t, if(k^2%n==0, return(k))) \\ Charles R Greathouse IV, Feb 07 2015
(Haskell)
a254732 n = head [k | k <- [n + 1 ..], mod (k ^ 2) n == 0]
-- Reinhard Zumkeller, Feb 07 2015
(Python)
def A254732(n):
....k = n + 1
....while pow(k, 2, n):
........k += 1
....return k # Chai Wah Wu, Feb 15 2015
CROSSREFS
Cf. A254733 (similar, with k^3), A254734 (similar, with k^4), A073353 (similar, with limit m->infinity of k^m).
Cf. A253905.
Sequence in context: A073353 A254734 A254733 * A299541 A066820 A309796
KEYWORD
nonn,easy
AUTHOR
Peter Kagey, Feb 06 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 23:26 EDT 2024. Contains 371917 sequences. (Running on oeis4.)