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-10 of 12 results. Next

A053610 Number of positive squares needed to sum to n using the greedy algorithm.

Original entry on oeis.org

1, 2, 3, 1, 2, 3, 4, 2, 1, 2, 3, 4, 2, 3, 4, 1, 2, 3, 4, 2, 3, 4, 5, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 4, 5, 1, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 4, 5, 3, 4, 1, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 4, 5, 3, 4, 5, 2, 1, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 4, 5, 3, 4, 5, 2, 3, 4, 1, 2, 3, 4
Offset: 1

Views

Author

Jud McCranie, Mar 19 2000

Keywords

Comments

Define f(n) = n - x^2 where (x+1)^2 > n >= x^2. a(n) = number of iterations in f(...f(f(n))...) to reach 0.
a(n) = 1 iff n is a perfect square.
Also sum of digits when writing n in base where place values are squares, cf. A007961. - Reinhard Zumkeller, May 08 2011
The sequence could have started with a(0)=0. - Thomas Ordowski, Jul 12 2014
The sequence is not bounded, see A006892. - Thomas Ordowski, Jul 13 2014

Examples

			7=4+1+1+1, so 7 requires 4 squares using the greedy algorithm, so a(7)=4.
		

Crossrefs

Cf. A006892 (positions of records), A055401, A007961.
Cf. A000196, A000290, A057945 (summing triangular numbers).

Programs

  • Haskell
    a053610 n = s n $ reverse $ takeWhile (<= n) $ tail a000290_list where
      s _ []                 = 0
      s m (x:xs) | x > m     = s m xs
                 | otherwise = m' + s r xs where (m',r) = divMod m x
    -- Reinhard Zumkeller, May 08 2011
    
  • Maple
    A053610 := proc(n)
        local a,x;
        a := 0 ;
        x := n ;
        while x > 0 do
            x := x-A048760(x) ;
            a := a+1 ;
        end do:
        a ;
    end proc: # R. J. Mathar, May 13 2016
  • Mathematica
    f[n_] := (n - Floor[Sqrt[n]]^2); g[n_] := (m = n; c = 1; While[a = f[m]; a != 0, c++; m = a]; c); Table[ g[n], {n, 1, 105}]
  • PARI
    A053610(n,c=1)=while(n-=sqrtint(n)^2,c++);c \\ M. F. Hasler, Dec 04 2008
    
  • Python
    from math import isqrt
    def A053610(n):
        c = 0
        while n:
            n -= isqrt(n)**2
            c += 1
        return c # Chai Wah Wu, Aug 01 2023

Formula

a(n) = A007953(A007961(n)). - Henry Bottomley, Jun 01 2000
a(n) = a(n - floor(sqrt(n))^2) + 1 = a(A053186(n)) + 1 [with a(0) = 0]. - Henry Bottomley, May 16 2000
A053610 = A002828 + A062535. - M. F. Hasler, Dec 04 2008

A057944 Largest triangular number less than or equal to n; write m-th triangular number m+1 times.

Original entry on oeis.org

0, 1, 1, 3, 3, 3, 6, 6, 6, 6, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 15, 21, 21, 21, 21, 21, 21, 21, 28, 28, 28, 28, 28, 28, 28, 28, 36, 36, 36, 36, 36, 36, 36, 36, 36, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 66, 66, 66, 66, 66, 66
Offset: 0

Views

Author

Henry Bottomley, Oct 05 2000

Keywords

Examples

			a(35) = 28 since 28 and 36 are successive triangular numbers and 28 <= 35 < 36.
		

Crossrefs

Programs

  • Haskell
    a057944 n = a057944_list !! n          -- common flat access
    a057944_list = concat a057944_tabl
    a057944' n k = a057944_tabl !! n !! k  -- access when seen as a triangle
    a057944_row n = a057944_tabl !! n
    a057944_tabl = zipWith ($) (map replicate [1..]) a000217_list
    -- Reinhard Zumkeller, Feb 03 2012
    
  • Maple
    A057944 := proc(n)
            k := (-1+sqrt(1+8*n))/2 ;
            k := floor(k) ;
            k*(k+1)/2 ;
    end proc; # R. J. Mathar, Nov 05 2011
  • Mathematica
    f[n_] := Block[{a = Floor@ Sqrt[1 + 8 n]}, Floor[(a - 1)/2]*Floor[(a + 1)/2]/2]; Array[f, 72, 0]
    t0=0; t1=1; k=1; Table[If[n < t1, t0, k++; t0=t1; t1=t1+k; t0], {n, 0, 72}]
    With[{nn=15},Table[#[[1]],#[[2]]+1]&/@Thread[{Accumulate[Range[ 0,nn]],Range[ 0,nn]}]]//Flatten (* Harvey P. Dale, Mar 01 2020 *)
  • PARI
    a(n)=my(t=(sqrtint(8*n+7)-1)\2);t*(t+1)/2 \\ Charles R Greathouse IV, Jan 26 2013
    
  • Python
    from math import comb, isqrt
    def A057944(n): return comb((m:=isqrt(k:=n+1<<1))+(k>m*(m+1)),2) # Chai Wah Wu, Nov 09 2024

Formula

a(n) = floor((sqrt(1+8*n)-1)/2)*floor((sqrt(1+8*n)+1)/2)/2 = (trinv(n)*(trinv(n)-1))/2 = A000217(A003056(n)) = n - A002262(n)
a(n) = (1/2)*t*(t-1), where t = floor(sqrt(2*n+1)+1/2) = A002024(n+1). - Ridouane Oudra, Oct 20 2019
Sum_{n>=1} 1/a(n)^2 = 2*Pi^2/3 - 4. - Amiram Eldar, Aug 14 2022

Extensions

Keyword tabl added by Reinhard Zumkeller, Feb 03 2012

A061336 Smallest number of triangular numbers which sum to n.

Original entry on oeis.org

0, 1, 2, 1, 2, 3, 1, 2, 3, 2, 1, 2, 2, 2, 3, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 2, 3, 2, 1, 2, 2, 2, 3, 3, 2, 3, 1, 2, 2, 2, 3, 3, 2, 2, 3, 1, 2, 3, 2, 2, 3, 2, 3, 3, 3, 1, 2, 2, 2, 3, 2, 2, 3, 3, 2, 2, 1, 2, 3, 2, 2, 3, 2, 2, 3, 3, 2, 3, 1, 2, 3, 2, 3, 2, 2, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 3, 3, 2, 3, 2, 2, 2, 2, 3, 3
Offset: 0

Views

Author

Henry Bottomley, Apr 25 2001

Keywords

Comments

a(n)=3 if n=5 or 8 mod 9, since triangular numbers are {0,1,3,6} mod 9.
From Bernard Schott, Jul 16 2022: (Start)
In September 1636, Fermat, in a letter to Mersenne, made the statement that every number is a sum of at most three triangular numbers. This was proved by Gauss, who noted this event in his diary on July 10 1796 with the notation:
EYPHKA! num = DELTA + DELTA + DELTA (where Y is in fact the Greek letter Upsilon and DELTA is the Greek letter of that name).
This proof was published in his book Disquisitiones Arithmeticae, Leipzig, 1801. (End)

Examples

			a(3)=1 since 3=3, a(4)=2 since 4=1+3, a(5)=3 since 5=1+1+3, with 1 and 3 being triangular.
		

References

  • Elena Deza and Michel Marie Deza, Fermat's polygonal number theorem, Figurate numbers, World Scientific Publishing (2012), Chapter 5, pp. 313-377.
  • C. F. Gauss, Disquisitiones Arithmeticae, Yale University Press, 1966, New Haven and London, p. 342, art. 293.

Crossrefs

Cf. A100878 (analog for A000326), A104246 (analog for A000292), A283365 (analog for A000332), A283370 (analog for A000389).

Programs

  • Mathematica
    t[n_]:=n*(n+1)/2; a[0]=0; a[n_]:=Block[ {k=1, tt= t/@ Range[Sqrt[2*n]]}, Off[IntegerPartitions::take]; While[{} == IntegerPartitions[n, {k}, tt, 1], k++]; k]; a/@ Range[0, 104] (* Giovanni Resta, Jun 09 2015 *)
  • PARI
    \\ see A283370 for generic code, working but not optimized for this case of triangular numbers. - M. F. Hasler, Mar 06 2017
    
  • PARI
    a(n)=my(m=n%9,f); if(m==5 || m==8, return(3)); f=factor(4*n+1); for(i=1,#f~, if(f[i,2]%2 && f[i,1]%4==3, return(3))); if(ispolygonal(n,3), n>0, 2) \\ Charles R Greathouse IV, Mar 17 2022

Formula

a(n) = 0 if n=0, otherwise 1 if n is in A000217, otherwise 2 if n is in A051533, otherwise 3 in which case n is in A020757.
a(n) <= 3 (proposed by Fermat and proved by Gauss). - Bernard Schott, Jul 16 2022

A006893 Smallest number whose representation requires n triangular numbers with greedy algorithm; also number of 1-2 rooted trees of height n.

Original entry on oeis.org

1, 2, 5, 20, 230, 26795, 359026205, 64449908476890320, 2076895351339769460477611370186680, 2156747150208372213435450937462082366919951682912789656986079991220
Offset: 1

Views

Author

Keywords

References

  • M. Abert and P. Diaconis, paper in preparation, 2002.
  • D. Parisse, The Tower of Hanoi and the Stern-Brocot-Array, Thesis, Munich, 1997.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Where records occur in A057945, n >= 1.
Cf. A007501.

Programs

  • Maple
    A006893 := proc(n) option remember; if n=1 then 1 else A006893(n-1)*(A006893(n-1)+3)/2; fi; end;
  • Mathematica
    RecurrenceTable[{a[1] == 1, a[n] == a[n-1]*(a[n-1] + 3)/2}, a[n], {n, 10}] (* Vaclav Kotesovec, Dec 17 2014 *)
  • PARI
    a=vector(20); a[1]=1; for(n=2, #a, a[n]=a[n-1]*(a[n-1]+3)/2); a \\ Altug Alkan, Apr 04 2018

Formula

a(n) = A007501(n-1) - 1.
a(n+1) = a(n)*(a(n)+3)/2, a(1)=1.
a(0) = 1, a(n) = Sum_{i=0..n-1} t(a(i)), where t(n)=n*(n+1)/2. - Jon Perry, Feb 14 2004
a(n) ~ 2 * c^(2^n), where c = 1.16007248510653786919452141287945841802404855231102953089... . - Vaclav Kotesovec, Dec 17 2014

Extensions

Additional description from Andreas M. Hinz and Daniele Parisse

A000462 Numbers written in base of triangular numbers.

Original entry on oeis.org

1, 2, 10, 11, 12, 100, 101, 102, 110, 1000, 1001, 1002, 1010, 1011, 10000, 10001, 10002, 10010, 10011, 10012, 100000, 100001, 100002, 100010, 100011, 100012, 100100, 1000000, 1000001, 1000002, 1000010, 1000011, 1000012, 1000100, 1000101, 10000000, 10000001
Offset: 1

Views

Author

John Radu (Suttones(AT)aol.com)

Keywords

Comments

A003056 and A057945 give lengths and sums. - Reinhard Zumkeller, Mar 27 2011

Examples

			The digits (from right to left) have values 1, 3, 6, 10, etc. (A000217), hence a(20) = 10012 because 20 = 1*15 + 0*10 + 0*6 + 1*3 + 2*1. - _Stefano Spezia_, Apr 25 2024
		

References

  • F. Smarandache, "Properties of the numbers", Univ. of Craiova Archives, 1975; Arizona State University Special Collections, Tempe, AZ.

Crossrefs

Programs

  • Haskell
    a000462 n = g [] n $ reverse $ takeWhile (<= n) $ tail a000217_list where
       g as 0 []     = read $ concat $ map show $ reverse as :: Integer
       g as x (t:ts) = g (a:as) r ts where (a,r) = divMod x t
    -- Reinhard Zumkeller, Mar 27 2011
  • Mathematica
    A000217[n_]:=n(n+1)/2; a[n_]:=Module[{k=0}, num=n; digits={}; k=Floor[(Sqrt[1+8num]-1)/2]; While[num>0, AppendTo[digits, Floor[num/A000217[k]]]; num=Mod[num, A000217[k]]; kold=k; k=Floor[(Sqrt[1+8num]-1)/2]; While[kStefano Spezia, Apr 25 2024 *)

A280053 "Nachos" sequence based on squares.

Original entry on oeis.org

1, 2, 3, 4, 1, 2, 3, 4, 5, 2, 3, 4, 5, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 2, 3, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 4, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 4, 5, 6, 7, 3, 4, 2, 3, 4, 5, 6, 3
Offset: 1

Views

Author

N. J. A. Sloane, Jan 07 2017

Keywords

Comments

The nachos sequence based on a sequence of positive numbers S starting with 1 is defined as follows: To find a(n) we start with a pile of n nachos.
During each phase, we successively remove S(1), then S(2), then S(3), ..., then S(i) nachos from the pile until fewer than S(i+1) remain. Then we start a new phase, successively removing S(1), then S(2), ..., then S(j) nachos from the pile until fewer than S(j+1) remain. Repeat. a(n) is the number of phases required to empty the pile.
Suggested by the Fibonachos sequence A280521, which is the case when S is 1,1,2,3,5,8,13,... (A000045).
If S = 1,2,3,4,5,... we get A057945.
If S = 1,2,3,5,7,11,... (A008578) we get A280055.
If S = triangular numbers we get A281367.
If S = squares we get the present sequence.
If S = powers of 2 we get A100661.
Needs a more professional Maple program.
Comment from Matthew C. Russell, Jan 30 2017 (Start):
Theorem: Any nachos sequence based on a sequence S = {1=s1 < s2 < s3 < ...} is unbounded.
Proof: S is the (infinite) set of numbers that we are allowed to subtract. (In the case of Fibonachos, this is the set of Fibonaccis themselves, not the partial sums.)
Suppose that n is a positive integer, with the number of stages of the process denoted by a(n).
Let s_m be the smallest element of S that is greater than n.
Then, if you start the process at N = n + s1 + s2 + s3 + ... + s_(m-1), you will get stuck when you hit n, and will have to start the process over again. Thus you will take a(n) + 1 stages of the process here, so a(N) = a(n) + 1.
(End)

Examples

			If n = 10, in the first phase we successively remove 1, then 4 nachos, leaving 5 in the pile. The next square is 9, which is bigger than 5, so we start a new phase. We remove 1, then 4 nachos, and now the pile is empty. There were two phases, so a(10)=2.
		

Crossrefs

For indices of first occurrences of 1,2,3,4,... see A280054.

Programs

  • Maple
    S:=[seq(i^2,i=1..1000)];
    phases := proc(n) global S; local a,h,i,j,ipass;
    a:=1; h:=n;
    for ipass from 1 to 100 do
       for i from 1 to 100 do
          j:=S[i];
          if j>h then a:=a+1; break; fi;
          h:=h-j;
          if h=0 then return(a); fi;
                           od;
    od;
    return(-1);
    end;
    t1:=[seq(phases(i),i=1..1000)];
    # 2nd program
    A280053 := proc(n)
        local a,nres,i ;
        a := 0 ;
        nres := n;
        while nres > 0 do
            for i from 1 do
                if A000330(i) > nres then
                    break;
                end if;
            end do:
            nres := nres-A000330(i-1) ;
            a := a+1 ;
        end do:
        a ;
    end proc:
    seq(A280053(n),n=1..80) ; # R. J. Mathar, Mar 05 2017
  • Mathematica
    A280053[n_] := Module[{a, nres, i}, a = 0; nres = n; While[nres > 0, For[i = 1, True, i++, If[i(i+1)(2i+1)/6 > nres, Break[]]]; nres = nres - i(i-1)(2i-1)/6; a++]; a];
    Table[A280053[n], {n, 1, 90}] (* Jean-François Alcover, Mar 16 2023, after R. J. Mathar *)

A281367 "Nachos" sequence based on triangular numbers.

Original entry on oeis.org

1, 2, 3, 1, 2, 3, 4, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 4, 5, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 2, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 2, 3, 4, 5, 3, 4, 5, 6, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 4, 5, 3, 4
Offset: 1

Views

Author

N. J. A. Sloane, Jan 30 2017

Keywords

Comments

The nachos sequence based on a sequence of positive numbers S starting with 1 is defined as follows: To find a(n) we start with a pile of n nachos.
During each phase, we successively remove S(1), then S(2), then S(3), ..., then S(i) nachos from the pile until fewer than S(i+1) remain. Then we start a new phase, successively removing S(1), then S(2), ..., then S(j) nachos from the pile until fewer than S(j+1) remain. Repeat. a(n) is the number of phases required to empty the pile.
Suggested by the Fibonachos sequence A280521, which is the case when S is 1,1,2,3,5,8,13,... (A000045).
If S = 1,2,3,4,5,... we get A057945.
If S = 1,2,3,5,7,11,... (A008578) we get A280055.
If S = triangular numbers we get the present sequence.
If S = squares we get A280053.
If S = powers of 2 we get A100661.
More than the usual number of terms are shown in order to distinguish this sequence from A104246.

Examples

			If n = 14, in the first phase we successively remove 1, then 3, then 6 nachos, leaving 4 in the pile. The next triangular number is 10, which is bigger than 4, so we start a new phase. We remove 1, then 3 nachos, and now the pile is empty. There were two phases, so a(14)=2.
		

Crossrefs

For indices of first occurrences of 1,2,3,4,... see A281368.
Different from A104246.

Programs

  • Maple
    S:=[seq(i*(i+1)/2,i=1..1000)];
    phases := proc(n) global S; local a,h,i,j,ipass;
    a:=1; h:=n;
    for ipass from 1 to 100 do
    for i from 1 to 100 do
    j:=S[i];
    if j>h then a:=a+1; break; fi;
    h:=h-j;
    if h=0 then return(a); fi;
    od;
    od;
    return(-1);
    end;
    t1:=[seq(phases(i),i=1..1000)];
    # 2nd program
    A281367 := proc(n)
        local a,nres,i ;
        a := 0 ;
        nres := n;
        while nres > 0 do
            for i from 1 do
                if A000292(i) > nres then
                    break;
                end if;
            end do:
            nres := nres-A000292(i-1) ;
            a := a+1 ;
        end do:
        a ;
    end proc:
    seq(A281367(n),n=1..80) ; # R. J. Mathar, Mar 05 2017
  • Mathematica
    tri[n_] := n (n + 1) (n + 2)/6;
    A281367[n_] := Module[{a = 0, nres = n, i}, While[nres > 0, For[i = 1, True, i++, If[tri[i] > nres, Break[]]]; nres -= tri[i-1]; a++]; a];
    Table[A281367[n], {n, 1, 99}] (* Jean-François Alcover, Apr 11 2024, after R. J. Mathar *)

A120246 a(1) = 1. a(m(m+1)/2 + k) = m + a(k), 1 <= k <= m+1, m >= 1.

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 4, 5, 6, 6, 5, 6, 7, 7, 8, 6, 7, 8, 8, 9, 10, 7, 8, 9, 9, 10, 11, 10, 8, 9, 10, 10, 11, 12, 11, 12, 9, 10, 11, 11, 12, 13, 12, 13, 14, 10, 11, 12, 12, 13, 14, 13, 14, 15, 15, 11, 12, 13, 13, 14, 15, 14, 15, 16, 16, 15, 12, 13, 14, 14, 15, 16, 15, 16, 17, 17, 16, 17, 13
Offset: 1

Views

Author

Leroy Quet, Jun 12 2006

Keywords

Comments

When calculating a(n) using the recurrence, the number of steps to reach a(1) is A057945(n-1). - Kevin Ryde, Aug 23 2022

Crossrefs

Programs

  • PARI
    \\ See links.

Extensions

Extended by Ray Chandler, Jun 19 2006

A364885 Triangle T(n, k), n >= 0, k = 0..n, read by rows; T(0, 0) = 0, and for any n > 0, k = 0..n, T(n, k) is the least number obtained by turning a 0 into a 1 in the binary expansion of the k-th term of the (0-based) flattened sequence.

Original entry on oeis.org

0, 1, 3, 2, 5, 7, 4, 9, 11, 6, 8, 17, 19, 10, 13, 16, 33, 35, 18, 21, 15, 32, 65, 67, 34, 37, 23, 12, 64, 129, 131, 66, 69, 39, 20, 25, 128, 257, 259, 130, 133, 71, 36, 41, 27, 256, 513, 515, 258, 261, 135, 68, 73, 43, 14, 512, 1025, 1027, 514, 517, 263, 132, 137, 75, 22, 24
Offset: 0

Views

Author

Rémy Sigrist, Aug 12 2023

Keywords

Comments

In other words, T(n, k) = a(k) OR 2^e for some e >= 0 (where OR denotes the bitwise OR operator).
As a flat sequence, this is a permutation of the nonnegative integers (as, for any h >= 0, the sequence contains all numbers with Hamming weight h); see A365080 for the inverse.

Examples

			Triangle begins:
    0
    1, 3
    2, 5, 7
    4, 9, 11, 6
    8, 17, 19, 10, 13
    16, 33, 35, 18, 21, 15
    32, 65, 67, 34, 37, 23, 12
    64, 129, 131, 66, 69, 39, 20, 25
    128, 257, 259, 130, 133, 71, 36, 41, 27
    256, 513, 515, 258, 261, 135, 68, 73, 43, 14
    512, 1025, 1027, 514, 517, 263, 132, 137, 75, 22, 24
    ...
		

Crossrefs

See A364884 for a similar sequence.
Cf. A000120, A057945, A365080 (inverse).

Programs

  • PARI
    See Links section.

Formula

T(n, 0) = 2^(n-1) for any n > 0.
A000120(a(n)) = A057945(n).

A145172 Number of pentagonal numbers needed to represent n with greedy algorithm.

Original entry on oeis.org

1, 2, 3, 4, 1, 2, 3, 4, 5, 2, 3, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 2, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 2, 3, 4, 5, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 2, 3, 4, 5, 6, 3, 4, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 2, 3, 4, 5, 6, 3, 4, 5, 6
Offset: 1

Views

Author

Christina Steffan (christina.steffan(AT)gmx.at), Oct 03 2008

Keywords

Comments

Sequence is unbounded.

Examples

			a(21)=6 since 21 = 12+5+1+1+1+1.
		

Crossrefs

Cf. A000326 (pentagonal numbers), A053610, A057945, A180447, A192988.

Programs

  • PARI
    a(n)={my(s=0); forstep(k=(sqrtint(24*n+1)+1)\6, 1, -1, my(t=k*(3*k-1)/2); s+=n\t; n%=t); s} \\ Andrew Howroyd, Apr 21 2021

Extensions

Terms a(41) and beyond from Andrew Howroyd, Apr 21 2021
Showing 1-10 of 12 results. Next