OFFSET
1,6
COMMENTS
LINKS
Boris Putievskiy, Table of n, a(n) for n = 1..10000
Boris Putievskiy, Transformations Integer Sequences And Pairing Functions, arXiv:1212.2732 [math.CO], 2012.
FORMULA
a(n) = n1 - t1(t1+1)/2, where n1 = n - t(t+1)/2, t1 = floor[(-1+sqrt(8*n1-7))/2], t=floor[(-1+sqrt(8*n-7))/2]. For example, a(6)=2 since t=2, t1=1, n1=3.
EXAMPLE
A002260 begins
1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, ...
so the first few rows of the new triangle are
1,
1, 1,
1, 1, 2,
1, 1, 2, 1,
1, 1, 2, 1, 2,
1, 1, 2, 1, 2, 3,
...
~
PROG
(Python)
t=int((math.sqrt(8*n-7) - 1)/ 2)
n1=n-t*(t+1)/2
t1=int((math.sqrt(8*n1-7) - 1)/ 2)
a=n1-t1*(t1+1)/2
CROSSREFS
KEYWORD
AUTHOR
Boris Putievskiy, Dec 12 2012
EXTENSIONS
Edited by N. J. A. Sloane, Jun 07 2024
STATUS
approved