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.

A274773 a(n) = floor(sqrt(2*n-1) + 1/2) - abs(2*(n-1) - (floor(sqrt(2*n-1) + 1/2))^2) + 1.

This page as a plain text file.
%I A274773 #50 Feb 16 2025 08:33:36
%S A274773 1,1,3,1,3,3,1,3,5,3,1,3,5,5,3,1,3,5,7,5,3,1,3,5,7,7,5,3,1,3,5,7,9,7,
%T A274773 5,3,1,3,5,7,9,9,7,5,3,1,3,5,7,9,11,9,7,5,3,1,3,5,7,9,11,11,9,7,5,3,1,
%U A274773 3,5,7,9,11,13,11,9,7,5,3,1,3,5,7,9,11,13,13,11,9,7,5,3,1,3,5,7,9,11,13,15,13,11,9,7,5,3,1,3,5,7,9,11,13,15,15,13,11,9,7,5,3
%N A274773 a(n) = floor(sqrt(2*n-1) + 1/2) - abs(2*(n-1) - (floor(sqrt(2*n-1) + 1/2))^2) + 1.
%C A274773 First bisection of A004738.
%C A274773 All terms are odd.
%H A274773 Chai Wah Wu, <a href="/A274773/b274773.txt">Table of n, a(n) for n = 1..10000</a>
%H A274773 Ilya Gutkovskiy, <a href="/A274773/a274773.pdf">Illustrations</a>
%H A274773 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SmarandacheSequences.html">Smarandache Sequences</a>
%e A274773 Triangle begins:
%e A274773   1;
%e A274773   1, 3;
%e A274773   1, 3, 3;
%e A274773   1, 3, 5, 3;
%e A274773   1, 3, 5, 5, 3;
%e A274773   1, 3, 5, 7, 5, 3;
%e A274773   1, 3, 5, 7, 7, 5, 3;
%e A274773   1, 3, 5, 7, 9, 7, 5, 3;
%e A274773   1, 3, 5, 7, 9, 9, 7, 5, 3;
%e A274773   ...
%e A274773 Read like the Ulam spiral, starting with 1:
%e A274773     x  7  x  5  x  3  x  1
%e A274773     7  x  5  x  3  x  1  x
%e A274773     x  5  x  3  x  1  x  3
%e A274773     5  x  3  x  1  x  3  x
%e A274773     x  3  x  1  x  3  x  5
%e A274773     3  x  1  x  3  x  5  x
%e A274773     x  1  x  3  x  5  x  7
%e A274773     1  x  3  x  5  x  7  x
%t A274773 Table[Floor[Sqrt[2 n - 1] + 1/2] - Abs[2 (n - 1) - Floor[Sqrt[2 n - 1] + 1/2]^2] + 1, {n, 1, 120}]
%o A274773 (Python)
%o A274773 from gmpy2 import isqrt_rem
%o A274773 def A274773(n):
%o A274773     i, j = isqrt_rem(2*n-1)
%o A274773     return int(i+2 - abs(j-2*(i+1)) if 4*(i-j) + 1 <= 0 else i+1 - abs(j-1)) # _Chai Wah Wu_, Aug 15 2016
%Y A274773 Cf. A004738, A005408.
%K A274773 nonn,easy,tabl
%O A274773 1,3
%A A274773 _Ilya Gutkovskiy_, Aug 11 2016