|
|
A320471
|
|
a(n) = floor(sqrt(n)) mod ceiling(sqrt(n)).
|
|
2
|
|
|
0, 1, 1, 0, 2, 2, 2, 2, 0, 3, 3, 3, 3, 3, 3, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 0, 9, 9, 9, 9, 9, 9
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,5
|
|
COMMENTS
|
Sequence consists of zeros interleaved with the positive integers, each positive integer k appearing 2k times.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = binomial(ceiling(sqrt(n)),floor(sqrt(n))) - 1.
a(k^2) = 0.
a(m) = floor(sqrt(m)) for nonsquare m. (End)
|
|
MAPLE
|
a:= proc(n) modp(floor(sqrt(n)), ceil(sqrt(n))) end: seq(a(n), n=1..100); # Muniru A Asiru, Oct 17 2018
|
|
MATHEMATICA
|
Array[Mod[Floor@ #, Ceiling@ #] &@ Sqrt@ # &, 99] (* or *)
Array[IntegerPart@ # - If[IntegerQ@ #, #, 0] &@ Sqrt@ # &, 99] (* or *)
|
|
PROG
|
(PARI) a(n) = sqrtint(n) % (1+sqrtint(n-1)); \\ Michel Marcus, Nov 04 2018
(Magma)
[Binomial(Ceiling(Sqrt(n)), Floor(Sqrt(n))) - 1: n in [1..100]]; // Vincenzo Librandi, Dec 02 2018
(Python)
from math import isqrt
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|