A071797 Restart counting after each new odd integer (a fractal sequence).
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, 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, 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
Offset: 1
Examples
a(1)=1; a(9)=5; a(10)=1; From _Omar E. Pol_, May 29 2012: (Start) Written as a triangle the sequence begins: 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, 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, 15; Row n has length 2*n - 1 = A005408(n-1). (End)
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
- Glen Joyce C. Dulatre, Jamilah V. Alarcon, Vhenedict M. Florida, Daisy Ann A. Disu, On Fractal Sequences, DMMMSU-CAS Science Monitor (2016-2017) Vol. 15 No. 2, 109-113.
- C. Kimberling, Numeration systems and fractal sequences, Acta Arithmetica 73 (1995) 103-117.
- Athanasii Kircheri, Mundus Subterraneus, (1664), pg. 24.
- F. Smarandache, Only Problems, Not Solutions!, Phoenix,AZ: Xiquan,1993.
- Michael Somos, Sequences used for indexing triangular or square arrays
Crossrefs
Programs
-
Haskell
import Data.List (inits) a071797 n = a071797_list !! (n-1) a071797_list = f $ tail $ inits [1..] where f (xs:_:xss) = xs ++ f xss -- Reinhard Zumkeller, Apr 14 2014
-
Maple
A071797 := proc(n) n-A048760(n-1) ; end proc: # R. J. Mathar, May 29 2016
-
Mathematica
Array[Range[2# - 1]&, 10] // Flatten (* Jean-François Alcover, Jan 30 2018 *)
-
PARI
a(n)=if(n<1,0,n-sqrtint(n-1)^2)
Formula
a(n) = 1 + A053186(n-1).
a(n) = n - 1 - ceiling(sqrt(n))*(ceiling(sqrt(n))-2); n > 0.
a(n) = n - floor(sqrt(n-1))^2, distance between n and the next smaller square. - Marc LeBrun, Jan 14 2004
Comments