|
|
A079644
|
|
n (mod sqrtint(n)).
|
|
1
|
|
|
0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 3, 0, 1, 2, 3, 0, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 0, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 1, 2, 3, 4, 5
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,11
|
|
COMMENTS
|
Record values: given an m>=0, the first n for which a(n)=m is n = (m+1)^2+m = A028387(m). Also, for n>3, n is a square if and only if a(n)=0 and a(n-1)=0. - Stanislav Sykora, Aug 13 2014
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 0 if n or n+1 or 4*n+1 is a square, otherwise a(n) = a(n-1)+1. - Robert Israel, Aug 13 2014
G.f.: sum(r=2..infinity, x^(r^2) * (x^r + 1) * ((r-1)*x^(r+1) - r*x^r + x)/(1 - x)^2. - Robert Israel, Aug 13 2014
|
|
MAPLE
|
a:= proc(n) local r;
r:= isqrt(n);
if r^2 > n then r:= r-1 fi;
n mod r;
end proc:
|
|
MATHEMATICA
|
Table[Mod[n, Floor[Sqrt[n]]], {n, 110}] (* Harvey P. Dale, Apr 10 2016 *)
|
|
PROG
|
(PARI) a(n)=n%sqrtint(n)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|