%I #70 Sep 12 2022 09:52:30
%S 1,1,2,3,1,2,3,4,5,1,2,3,4,5,6,7,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,
%T 10,11,1,2,3,4,5,6,7,8,9,10,11,12,13,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
%U 15,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,1,2,3,4,5,6,7,8,9,10,11
%N Restart counting after each new odd integer (a fractal sequence).
%C The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446.
%C This is also a triangle read by rows in which row n lists the first 2*n-1 positive integers, n >= 1 (see example). - _Omar E. Pol_, May 29 2012
%C a(n) mod 2 = A071028(n). - _Boris Putievskiy_, Jul 24 2013
%C The triangle in the example is the triangle used by Kircheri in 1664. See the link "Mundus Subterraneus". - _Charles Kusniec_, Sep 11 2022
%H Reinhard Zumkeller, <a href="/A071797/b071797.txt">Table of n, a(n) for n = 1..1000</a>
%H Glen Joyce C. Dulatre, Jamilah V. Alarcon, Vhenedict M. Florida, Daisy Ann A. Disu, <a href="http://www.dmmmsu-sluc.com/wp-content/uploads/2018/03/CAS-Monitor-2016-2017-1.pdf">On Fractal Sequences</a>, DMMMSU-CAS Science Monitor (2016-2017) Vol. 15 No. 2, 109-113.
%H C. Kimberling, <a href="http://matwbn.icm.edu.pl/ksiazki/aa/aa73/aa7321.pdf">Numeration systems and fractal sequences</a>, Acta Arithmetica 73 (1995) 103-117.
%H Athanasii Kircheri, <a href="https://archive.org/details/athanasiikircher00kirc_4/page/n53/mode/2up">Mundus Subterraneus</a>, (1664), pg. 24.
%H F. Smarandache, <a href="http://www.gallup.unm.edu/~smarandache/OPNS.pdf">Only Problems, Not Solutions!</a>, Phoenix,AZ: Xiquan,1993.
%H Michael Somos, <a href="/A073189/a073189.txt">Sequences used for indexing triangular or square arrays</a>
%F a(n) = 1 + A053186(n-1).
%F a(n) = n - 1 - ceiling(sqrt(n))*(ceiling(sqrt(n))-2); n > 0.
%F a(n) = n - floor(sqrt(n-1))^2, distance between n and the next smaller square. - _Marc LeBrun_, Jan 14 2004
%e a(1)=1; a(9)=5; a(10)=1;
%e From _Omar E. Pol_, May 29 2012: (Start)
%e Written as a triangle the sequence begins:
%e 1;
%e 1, 2, 3;
%e 1, 2, 3, 4, 5;
%e 1, 2, 3, 4, 5, 6, 7;
%e 1, 2, 3, 4, 5, 6, 7, 8, 9;
%e 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11;
%e 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13;
%e 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15;
%e Row n has length 2*n - 1 = A005408(n-1). (End)
%p A071797 := proc(n)
%p n-A048760(n-1) ;
%p end proc: # _R. J. Mathar_, May 29 2016
%t Array[Range[2# - 1]&, 10] // Flatten (* _Jean-François Alcover_, Jan 30 2018 *)
%o (PARI) a(n)=if(n<1,0,n-sqrtint(n-1)^2)
%o (Haskell)
%o import Data.List (inits)
%o a071797 n = a071797_list !! (n-1)
%o a071797_list = f $ tail $ inits [1..] where
%o f (xs:_:xss) = xs ++ f xss
%o -- _Reinhard Zumkeller_, Apr 14 2014
%Y Cf. A002260, A004737, A006590, A027052, A071028, A078358, A078446.
%Y Cf. A074294.
%Y Row sums give positive terms of A000384.
%K easy,nonn,tabf
%O 1,3
%A _Antonio Esposito_, Jun 06 2002