login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A083920 Number of nontriangular numbers <= n. 14
0, 0, 1, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 27, 28, 28, 29, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 60, 61, 62 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
COMMENTS
An alternative description: the sequence of nonnegative integers with the triangular numbers repeated.
a(t(n)) = t(n+1), where t(n)=A000217(n)=n(n+1)/2, the n-th triangular number. For n>=1, a(n)=a(n-1) if and only if n is a triangular number; otherwise, a(n)=1+a(n-1).
LINKS
R. K. Guy, Sets of integers whose subsets have distinct sums, pp. 141-154 of Theory and practice of combinatorics. Ed. A. Rosa, G. Sabidussi and J. Turgeon. Annals of Discrete Mathematics, 12. North-Holland 1982. See Table 1, column (4).
FORMULA
a(n) = n-floor((x-1)/2) = n-A003056(n), where x = sqrt(8*n+1).
A005318(n+1) = 2*A005318(n)-A205744(n), A205744(n) = A005318(a(n)), a(n) = n - A002024(n). - N. J. A. Sloane, Feb 11 2012
G.f.: 1/(1 - x)^2 - (1/(1 - x))*Product_{k>=1} (1 - x^(2*k))/(1 - x^(2*k-1)). - Ilya Gutkovskiy, May 30 2017
a(n) = n - floor(sqrt(2*n + 1) - 1/2). - Ridouane Oudra, Jun 19 2019
EXAMPLE
a(7)=4 counts the nontriangular numbers, 2,4,5,7, that are <=7.
MATHEMATICA
f[n_] := n - Floor[(Sqrt[8n + 1] - 1)/2]; Table[ f[n], {n, 0, 73}] (* Robert G. Wilson v, Oct 22 2005 *)
Accumulate[Table[If[OddQ[Sqrt[8n+1]], 0, 1], {n, 0, 120}]] (* Harvey P. Dale, Oct 14 2014 *)
PROG
(Haskell)
a083920 n = a083920_list !! n
a083920_list = scanl1 (+) $ map (1 -) a010054_list
-- Reinhard Zumkeller, Feb 12 2012
(PARI) a(n)=n-(sqrtint(8*n+1)-1)\2 \\ Charles R Greathouse IV, Sep 02 2015
(Magma) [n-Floor((Sqrt(8*n+1)-1)/2):n in [1..75]]; // Marius A. Burtea, Jun 19 2019
CROSSREFS
Essentially partial sums of A023532.
Number of nonzero terms in row n+1 of A342557.
Sequence in context: A366860 A214449 A118168 * A066508 A319413 A307727
KEYWORD
nonn
AUTHOR
Clark Kimberling, May 08 2003
EXTENSIONS
Added alternative definition and Guy reference. - N. J. A. Sloane, Feb 09 2012
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)