OFFSET
1,3
COMMENTS
P_3(i) = the i-th triangular number.
As a triangle [1; 1,2; 2,3,4; ...], row sums = A064808: (1, 3, 9, 22, 45, 81, ...). - Gary W. Adamson, Aug 10 2007
a(n) = n - A003056(n-1). - Reinhard Zumkeller, Feb 12 2012
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Grady D. Bullington, The Connell Sum Sequence, J. Integer Seq. 10 (2007), Article 07.2.6. (includes direct formula for a(n))
Douglas E. Iannucci and Donna Mills-Taylor, On Generalizing the Connell Sequence, J. Integer Sequences, Vol. 2, 1999, #99.1.7.
J. W. Meijer and M. Nepveu, Euler's ship on the Pentagonal Sea, Acta Nova, Volume 4, No.1, December 2008. pp. 176-187. [From Johannes W. Meijer, Jun 21 2010]
FORMULA
a(n) = A001614(n) - n + 1.
MATHEMATICA
nxt[{n_, a_}]:={n+1, If[OddQ[Sqrt[8n+1]], a, a+1]}; NestList[nxt, {1, 1}, 100][[All, 2]] (* Harvey P. Dale, Oct 10 2018 *)
PROG
(Haskell)
a122797 n = a122797_list !! (n-1)
a122797_list = 1 : zipWith (+) a122797_list (map ((1 -) . a010054) [1..])
-- Reinhard Zumkeller, Feb 12 2012
(PARI) isTriang(n) = {if (! issquare(8*n+1), return (0)); return (1); }
lista(m) = {aa = 1; for (i=1, m, print1(aa, ", "); if (! isTriang(i), aa = aa + 1); ); } \\ Michel Marcus, Apr 01 2013
(Python)
from math import isqrt
def A122797(n): return n+1-(k:=isqrt(m:=n<<1))-int((m<<2)>(k<<2)*(k+1)+1) # Chai Wah Wu, Jul 26 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Grady Bullington (bullingt(AT)uwosh.edu), Sep 14 2006
EXTENSIONS
Definition corrected by Michel Marcus, Apr 01 2013
STATUS
approved