A211422 Number of ordered triples (w,x,y) with all terms in {-n,...,0,...,n} and w^2 + x*y = 0.
1, 9, 17, 25, 41, 49, 57, 65, 81, 105, 113, 121, 137, 145, 153, 161, 193, 201, 225, 233, 249, 257, 265, 273, 289, 329, 337, 361, 377, 385, 393, 401, 433, 441, 449, 457, 505, 513, 521, 529, 545, 553, 561, 569, 585, 609, 617, 625, 657, 713, 753, 761
Offset: 0
Keywords
A122197 Fractal sequence: count up to successive integers twice.
1, 1, 1, 2, 1, 2, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5
Offset: 1
Comments
Fractal - deleting the first occurrence of each integer leaves the original sequence. Also, deleting all the 1's leaves the original sequence plus 1. New values occur at square indices. 1's occur at indices m^2+1 and m^2+m+1. Ordinal transform of A122196.
Except for its initial 1, A122197 is the natural fractal sequence of A002620; that is, A122197(n+1) is the number of the row of A194061 that contains n. See A194029 for definition of natural fractal sequence. - Clark Kimberling, Aug 12 2011
From Johannes W. Meijer, Sep 09 2013: (Start)
Triangle read by rows formed from antidiagonals of triangle A002260.
Examples
The first few rows of the sequence a(n) as a triangle T(n, k): n/k 1 2 3 1 1 2 1 3 1, 2 4 1, 2 5 1, 2, 3 6 1, 2, 3
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
import Data.List (transpose, genericIndex) a122197 n k = genericIndex (a122197_row n) (k - 1) a122197_row n = genericIndex a122197_tabf (n - 1) a122197_tabf = concat $ transpose [a002260_tabl, a002260_tabl] a122197_list = concat a122197_tabf -- Reinhard Zumkeller, Aug 07 2015, Jul 19 2012
-
Maple
From Johannes W. Meijer, Sep 09 2013: (Start) a := proc(n) local t: t := floor((sqrt(4*n-3)-1)/2): (n-1) mod (t+1) + 1 end: seq(a(n), n=1..105); # End first program T := proc(n, k): if n < 1 then return(0) elif k < 1 or k> floor((n+1)/2) then return(0) else k fi: end: seq(seq(T(n, k), k=1..floor((n+1)/2)), n=1..19); # End second program. (End)
-
Mathematica
With[{c=Table[Range[n],{n,10}]},Flatten[Riffle[c,c]]] (* Harvey P. Dale, Apr 19 2013 *)
-
PARI
a(n)=n - (sqrtint(4*n) + 1)\2*sqrtint(n-1) \\ Charles R Greathouse IV, Jun 08 2020
-
Python
from math import isqrt def A122197(n): return 1 if n<=1 else 1+((n-1)%((m:=isqrt(n-1))+int(n-1>m*(m+1)))) # Chai Wah Wu, Jun 05 2025
Formula
From Boris Putievskiy, Sep 09 2013: (Start)
a(n) = ((n-1) mod (t+1)) + 1, where t = floor((sqrt(4*n-3)-1)/2). (End)
From Johannes W. Meijer, Sep 09 2013: (Start)
T(n, k) = k for n >= 1 and 1 <= k <= (n+1)/2; T(n, k) = 0 elsewhere.
T(n, k) = A002260(n-k, k). (End)
a(n) = n - floor(sqrt(n) + 1/2)*floor(sqrt(n-1)). - Ridouane Oudra, Jun 08 2020
a(n) = A339399(2n-1). - Wesley Ivan Hurt, Jan 09 2022
Comments
Examples
Links
Crossrefs
Programs
Mathematica