A183079 Tree generated by the triangular numbers: a(1) = 1; a(2n) = nontriangular(a(n)), a(2n+1) = triangular(a(n+1)), where triangular = A000217, nontriangular = A014132.
1, 2, 3, 4, 6, 5, 10, 7, 21, 9, 15, 8, 55, 14, 28, 11, 231, 27, 45, 13, 120, 20, 36, 12, 1540, 65, 105, 19, 406, 35, 66, 16, 26796, 252, 378, 34, 1035, 54, 91, 18, 7260, 135, 210, 26, 666, 44, 78, 17, 1186570, 1595, 2145, 76, 5565, 119, 190, 25, 82621, 434
Offset: 1
A220348 Index of row where n occurs in A183079.
1, 2, 3, 3, 4, 4, 4, 5, 5, 4, 5, 6, 6, 5, 5, 6, 7, 7, 6, 6, 5, 7, 8, 8, 7, 7, 6, 5, 8, 9, 9, 8, 8, 7, 6, 6, 9, 10, 10, 9, 9, 8, 7, 7, 6, 10, 11, 11, 10, 10, 9, 8, 8, 7, 5, 11, 12, 12, 11, 11, 10, 9, 9, 8, 6, 6, 12, 13, 13, 12, 12, 11, 10, 10, 9, 7, 7, 7, 13
Offset: 1
Keywords
Comments
A183079 seen as flattened sequence is a permutation of the natural numbers, therefore for each n there exists exactly 1 row in A183079 containing n.
In this sequence each n >= 2 occurs a total of 2^(n-2) times. - Antti Karttunen, May 18 2015
Links
- Reinhard Zumkeller (first 250 terms) & Antti Karttunen, Table of n, a(n) for n = 1..10440
Programs
-
Haskell
import Data.List (findIndex) import Data.Maybe (fromJust) a220348 n = fromJust (findIndex (elem n) a183079_tabf) + 1
-
Mathematica
(* b is A220347 *) b[n_] := b[n] = With[{r = (-1 + Sqrt[8n + 1])/2}, Which[n <= 1, n, IntegerQ[r], 2b[Floor[Sqrt[2n] + 1/2]] - 1, True, 2b[n - Floor[r]]]]; a[n_] := 1 + IntegerLength[b[n] - 1, 2]; Array[a, 100] (* Jean-François Alcover, Dec 05 2021 *)
-
Scheme
(define (A220348 n) (+ 1 (A029837 (A220347 n)))) ;; Antti Karttunen, May 18 2015
-
Scheme
(define (A220348 n) (A070941 (+ -1 (A220347 n)))) ;; Antti Karttunen, May 18 2015
Formula
Extensions
Name edited by Michel Marcus, Jan 26 2022
A257797 Permutation of natural numbers: a(1) = 1, a(triangular(n)) = 1+(2*a(n-1)), a(nontriangular(n)) = 2*n, where triangular = A000217, nontriangular = A014132.
1, 2, 3, 4, 6, 5, 8, 12, 10, 7, 16, 24, 20, 14, 9, 32, 48, 40, 28, 18, 13, 64, 96, 80, 56, 36, 26, 11, 128, 192, 160, 112, 72, 52, 22, 17, 256, 384, 320, 224, 144, 104, 44, 34, 25, 512, 768, 640, 448, 288, 208, 88, 68, 50, 21, 1024, 1536, 1280, 896, 576, 416, 176, 136, 100, 42, 15
Offset: 1
Comments
Examples
Links
Crossrefs
Programs
Haskell
Mathematica
Scheme
Formula
Extensions