|
|
A038759
|
|
a(n) = ceiling(sqrt(n))*floor(sqrt(n)).
|
|
4
|
|
|
0, 1, 2, 2, 4, 6, 6, 6, 6, 9, 12, 12, 12, 12, 12, 12, 16, 20, 20, 20, 20, 20, 20, 20, 20, 25, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 36, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 49, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 64, 72, 72, 72, 72, 72, 72, 72
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
a(n) = n iff n is a square or a pronic (or heteromecic) number of form k(k+1). The sequence interleaves individual squares with 2k copies of each pronic.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(31) = 30 since 6 and 5 are on either side of the square root of 31 and 6*5 = 30.
|
|
MATHEMATICA
|
a[n_] := Ceiling[Sqrt[n]]*Floor[Sqrt[n]]; Array[a, 70, 0] (* Amiram Eldar, Dec 04 2022 *)
|
|
PROG
|
(Python)
from math import isqrt
(PARI) a(n) = my(r, s=sqrtint(n, &r)); if(r, n-r+s, n); \\ Kevin Ryde, Jul 30 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|