A174806 a(n) = n-floor(sqrt(n))^2-floor(sqrt(n-floor(sqrt(n))^2))^2; difference between n and sum of two largest distinct squares <= n.
0, 0, 0, 1, 0, 0, 1, 2, 0, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 3, 4, 0, 0, 1, 2, 0, 1, 2, 3, 4, 0, 1, 0, 0, 1, 2, 0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 0, 1, 2, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 0, 0, 1, 2, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 0, 0, 0, 1, 2, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 0, 0, 1, 2, 0
Offset: 0
Keywords
Examples
24=4^2+8;8-2^2=4, 115=10^2+15;15-3^2=6,..
Links
- Michel Marcus, Table of n, a(n) for n = 0..10000
Programs
-
Mathematica
a[n_]:=n-Floor[Sqrt[n]]^2-Floor[Sqrt[n-Floor[Sqrt[n]]^2]]^2; Table[a[n], {n,0,6!}]
-
PARI
a(n) = my(x=sqrtint(n)^2); n - x - sqrtint((n-x))^2; \\ Michel Marcus, Dec 17 2022
Comments