cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A320471 a(n) = floor(sqrt(n)) mod ceiling(sqrt(n)).

This page as a plain text file.
%I A320471 #81 Feb 12 2023 14:48:35
%S A320471 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,
%T A320471 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,
%U A320471 8,8,8,8,8,8,8,8,8,8,8,8,0,9,9,9,9,9,9
%N A320471 a(n) = floor(sqrt(n)) mod ceiling(sqrt(n)).
%C A320471 Sequence consists of zeros interleaved with the positive integers, each positive integer k appearing 2k times.
%F A320471 a(n) = A000196(n) - A037213(n).
%F A320471 a(n) = A000196(n)*A049240(n).
%F A320471 a(n) = A000196(n) mod A003059(n).
%F A320471 a(n) = (n - A173517(n)) - A037213(n)^2.
%F A320471 a(n) = binomial(ceiling(sqrt(n)),floor(sqrt(n))) - 1.
%F A320471 From _David A. Corneth_, Nov 04 2018: (Start)
%F A320471 a(k^2) = 0.
%F A320471 a(m) = floor(sqrt(m)) for nonsquare m. (End)
%p A320471 a:= proc(n) modp(floor(sqrt(n)),ceil(sqrt(n))) end: seq(a(n),n=1..100); # _Muniru A Asiru_, Oct 17 2018
%t A320471 Array[Mod[Floor@ #, Ceiling@ #] &@ Sqrt@ # &, 99] (* or *)
%t A320471 Array[IntegerPart@ # - If[IntegerQ@ #, #, 0] &@ Sqrt@ # &, 99] (* or *)
%t A320471 Flatten@ Array[{0}~Join~ConstantArray[#, 2 #] &, 9] (* _Michael De Vlieger_, Oct 15 2018 *)
%o A320471 (PARI) a(n) = sqrtint(n) % (1+sqrtint(n-1)); \\ _Michel Marcus_, Nov 04 2018
%o A320471 (PARI) a(n) = sqrtint(n-1) * !issquare(n) \\ _David A. Corneth_, Nov 04 2018
%o A320471 (Magma)
%o A320471 [Binomial(Ceiling(Sqrt(n)), Floor(Sqrt(n))) - 1: n in [1..100]]; // _Vincenzo Librandi_, Dec 02 2018
%o A320471 (Python)
%o A320471 from math import isqrt
%o A320471 def A320471(n): return 0 if (m:=isqrt(n))**2==n else m # _Chai Wah Wu_, Jul 29 2022
%Y A320471 Cf. A000196, A003059, A037213, A049240, A173517.
%K A320471 nonn
%O A320471 1,5
%A A320471 _Kritsada Moomuang_, Oct 13 2018
%E A320471 Corrected by _Michel Marcus_, Jun 14 2022