login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A057945 Number of triangular numbers needed to represent n with greedy algorithm. 5
0, 1, 2, 1, 2, 3, 1, 2, 3, 2, 1, 2, 3, 2, 3, 1, 2, 3, 2, 3, 4, 1, 2, 3, 2, 3, 4, 2, 1, 2, 3, 2, 3, 4, 2, 3, 1, 2, 3, 2, 3, 4, 2, 3, 4, 1, 2, 3, 2, 3, 4, 2, 3, 4, 3, 1, 2, 3, 2, 3, 4, 2, 3, 4, 3, 2, 1, 2, 3, 2, 3, 4, 2, 3, 4, 3, 2, 3, 1, 2, 3, 2, 3, 4, 2, 3, 4, 3, 2, 3, 4, 1, 2, 3, 2, 3, 4, 2, 3, 4, 3, 2, 3, 4, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

a(n) = sum of digits of A000462(n). [Reinhard Zumkeller, Mar 27 2011]

LINKS

_Reinhard Zumkeller_, Table of n, a(n) for n = 0..10000

FORMULA

a(0)=0, otherwise a(n)=a(A002262(n))+1.

EXAMPLE

a(35)=3 since 35=28+6+1

PROG

(Haskell)

a057945 n = g n $ reverse $ takeWhile (<= n) $ tail a000217_list where

   g 0 _      = 0

   g x (t:ts) = g r ts + a where (a, r) = divMod x t

-- Reinhard Zumkeller, Mar 27 2011

CROSSREFS

Cf. A000217, A002262, A056944, A057944. See A006893 for records.

Sequence in context: A023115 A194436 A061336 * A194546 A115452 A039676

Adjacent sequences:  A057942 A057943 A057944 * A057946 A057947 A057948

KEYWORD

nonn

AUTHOR

Henry Bottomley, Oct 05 2000

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified May 21 17:10 EDT 2013. Contains 225504 sequences.