cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A266726 Indices of even terms in A006019.

Original entry on oeis.org

0, 2, 4, 9, 11, 13, 18, 20, 22, 24, 26, 29, 31, 37, 39, 41, 42, 44, 46, 48, 50, 51, 52, 56, 58, 60, 61, 62, 63, 65, 67, 72, 74, 79, 83, 84, 85, 86, 88, 90, 92, 94, 98, 99, 101, 103, 108, 110, 112, 119, 126, 128, 130, 135, 137, 139, 141, 142, 143, 144, 150, 151, 152, 154, 156, 158
Offset: 1

Views

Author

N. J. A. Sloane, Jan 03 2016

Keywords

References

  • E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 1982, see p. 502.
  • R. K. Guy, Fair Game: How to play impartial combinatorial games, COMAP's Mathematical Exploration Series, 1989; see p. 88.

Crossrefs

Cf. A006019.

Extensions

Extended beyond 72 by R. J. Mathar, May 07 2016

A057945 Number of triangular numbers needed to represent n with greedy algorithm.

Original entry on oeis.org

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
Offset: 0

Views

Author

Henry Bottomley, Oct 05 2000

Keywords

Comments

a(n) = sum of digits of A000462(n). - Reinhard Zumkeller, Mar 27 2011
The length of (number of moves in) Simon Norton's game in A006019 starting with an initial heap of n if both players always take, never put. - R. J. Mathar, May 13 2016

Examples

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

Crossrefs

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

Programs

  • 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
  • Maple
    A057945 := proc(n)
        local a,x;
        a := 0 ;
        x := n ;
        while x > 0 do
            x := x-A057944(x) ;
            a := a+1 ;
        end do:
        a ;
    end proc: # R. J. Mathar, May 13 2016
  • Mathematica
    A057944[n_] := With[{k = Floor[Sqrt[8n+1]]}, Floor[(k-1)/2]* Floor[(k+1)/2]/2];
    a[n_] := Module[{k = 0, x = n}, While[x>0, x = x - A057944[x]; k++]; k];
    Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Mar 10 2019, after R. J. Mathar *)

Formula

a(0)=0, otherwise a(n)=a(A002262(n))+1.
Showing 1-2 of 2 results.