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 13 results. Next

A261225 n minus the number of positive cubes needed to sum to n using the greedy algorithm: a(n) = n - A055401(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 14, 14, 14, 21, 21, 21, 26, 26, 26, 26, 26, 26, 26, 26, 33, 33, 33, 33, 33, 33, 33, 33, 40, 40, 40, 40, 40, 40, 40, 40, 47, 47, 47, 52, 52, 52, 52, 52, 52, 52, 52, 59, 59, 63, 63, 63, 63, 63, 63, 63, 63, 70, 70, 70, 70, 70, 70, 70, 70, 77, 77, 77, 77, 77, 77, 77, 77, 84, 84, 84, 89
Offset: 0

Views

Author

Antti Karttunen, Aug 16 2015

Keywords

Examples

			a(8) = 7, because when the greedy algorithm partitions 8 into cubes, it first finds 8 (= 2*2*2), thus A055401(8) = 1, and 8-1 = 7.
		

Crossrefs

Formula

a(n) = n - A055401(n).
As a recurrence:
a(0) = 0; for n >= 1, a(n) = -1 + A048762(n) + a(n-A048762(n)). [Where A048762(n) gives the largest cube <= n.]

A261228 a(n) = number of steps to reach 0 when starting from k = (n^3)-1 and repeatedly applying the map that replaces k with k - A055401(k), where A055401(k) = the number of positive cubes needed to sum to k using the greedy algorithm.

Original entry on oeis.org

0, 1, 4, 10, 19, 33, 52, 77, 108, 146, 190, 244, 306, 377, 458, 549, 652, 767, 896, 1038, 1195, 1367, 1554, 1757, 1978, 2216, 2472, 2746, 3040, 3353, 3688, 4045, 4423, 4823, 5247, 5696, 6169, 6668, 7193, 7745, 8324, 8933, 9570, 10236, 10934, 11663, 12423, 13215, 14042, 14902, 15797, 16726, 17693, 18695, 19734, 20811, 21928, 23083, 24278, 25513
Offset: 1

Views

Author

Antti Karttunen, Aug 16 2015

Keywords

Crossrefs

One less than A261227.
First differences: A261229.
Cf. also A261223.

Formula

a(1) = 0; for n > 1, a(n) = A261229(n-1) + a(n-1).
a(n) = A261226((n^3)-1).

A261229 a(n) = number of steps to reach (n^3)-1 when starting from k = ((n+1)^3)-1 and repeatedly applying the map that replaces k with k - A055401(k), where A055401(k) = the number of positive cubes needed to sum to k using the greedy algorithm.

Original entry on oeis.org

1, 3, 6, 9, 14, 19, 25, 31, 38, 44, 54, 62, 71, 81, 91, 103, 115, 129, 142, 157, 172, 187, 203, 221, 238, 256, 274, 294, 313, 335, 357, 378, 400, 424, 449, 473, 499, 525, 552, 579, 609, 637, 666, 698, 729, 760, 792, 827, 860, 895, 929, 967, 1002, 1039, 1077, 1117, 1155, 1195, 1235, 1278, 1318, 1361, 1404, 1448, 1492, 1538, 1583, 1631, 1677, 1725
Offset: 1

Views

Author

Antti Karttunen, Aug 16 2015

Keywords

Crossrefs

First differences of both A261227 and A261228.
Cf. also A261224.

Formula

a(n) = A261226(((n+1)^3)-1) - A261226((n^3)-1). [The definition.]
Equally, for all n >= 1:
a(n) = A261226((n+1)^3) - A261226(n^3).
a(n) = A261227(n+1) - A261227(n).
a(n) = A261228(n+1) - A261228(n).

A276613 The infinite trunk of greedy cubes beanstalk: The only infinite sequence such that a(n-1) = a(n) - number of cubes that sum to a(n) with greedy algorithm (A055401).

Original entry on oeis.org

0, 7, 14, 21, 26, 33, 40, 47, 52, 59, 63, 70, 77, 84, 89, 96, 103, 110, 115, 124, 131, 138, 145, 150, 157, 164, 171, 176, 183, 187, 194, 201, 208, 215, 222, 229, 236, 241, 248, 255, 262, 267, 274, 278, 285, 292, 299, 304, 311, 318, 330, 339, 342, 349, 356, 363, 368, 375, 382, 389, 394, 401, 405, 412, 419, 426, 431, 438, 445
Offset: 0

Views

Author

Antti Karttunen, Sep 07 2016

Keywords

Crossrefs

Cf. A055401, A261225, A276612, A276614, A276615 (first differences).
Cf. also A179016, A259934, A276573, A276583, A276623 for similar constructions.

Programs

Formula

a(n) = A276614(A276612(n)).

A261227 a(n) = number of steps to reach 0 when starting from k = n^3 and repeatedly applying the map that replaces k with k - A055401(k), where A055401(k) = the number of positive cubes needed to sum to k using the greedy algorithm.

Original entry on oeis.org

0, 1, 2, 5, 11, 20, 34, 53, 78, 109, 147, 191, 245, 307, 378, 459, 550, 653, 768, 897, 1039, 1196, 1368, 1555, 1758, 1979, 2217, 2473, 2747, 3041, 3354, 3689, 4046, 4424, 4824, 5248, 5697, 6170, 6669, 7194, 7746, 8325, 8934, 9571, 10237, 10935, 11664, 12424, 13216, 14043, 14903, 15798, 16727, 17694, 18696, 19735, 20812, 21929, 23084, 24279, 25514
Offset: 0

Views

Author

Antti Karttunen, Aug 16 2015

Keywords

Crossrefs

Essentially one more than A261228.
First differences: A261229.
Cf. also A261222.

Formula

a(0) = 0, a(1) = 1; for n >= 2, a(n) = A261229(n-1) + a(n-1).
a(n) = A261226(n^3).

A261226 a(n) = number of steps to reach 0 when starting from k = n and repeatedly applying the map that replaces k with k - A055401(k), where A055401(k) = the number of positive cubes needed to sum to k using the greedy algorithm.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 16 2015

Keywords

Crossrefs

Cf. also A261221.
After a(0) differs from A003108 for the first time at n=32, where a(32)=5, while A003108(32)=6.

Programs

Formula

a(0) = 0; for n >= 1, a(n) = 1 + a(A261225(n)).

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

A002376 Least number of positive cubes needed to sum to n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

No terms are greater than 9, see A002804. - Charles R Greathouse IV, Aug 01 2013

References

  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 81.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • A. R. Zornow, De compositione numerorum e cubis integris positivus, J. Reine Angew. Math., 14 (1835), 276-280.

Crossrefs

Cf. A000578, A003325 (numbers requiring 2 cubes), A047702 (numbers requiring 3 cubes), A047703 (numbers requiring 4 cubes), A047704 (numbers requiring 5 cubes), A046040 (numbers requiring 6 cubes), A018890 (numbers requiring 7 cubes), A018888 (numbers requiring 8 or 9 cubes), A055401 (cubes needed by greedy algorithm).

Programs

  • Maple
    f:= proc(n) option remember;
      min(seq(procname(n - i^3)+1, i=1..floor(n^(1/3))))
    end proc:
    f(0):= 0:
    map(f, [$1..100]); # Robert Israel, Jun 30 2017
  • Mathematica
    CubesCnt[n_] := Module[{k = 1}, While[Length[PowersRepresentations[n, k, 3]] == 0, k++]; k]; Array[CubesCnt, 100] (* T. D. Noe, Apr 01 2011 *)
  • Python
    from itertools import count
    from sympy.solvers.diophantine.diophantine import power_representation
    def A002376(n):
        if n == 1: return 1
        for k in count(1):
            try:
                next(power_representation(n,3,k))
            except:
                continue
            return k # Chai Wah Wu, Jun 25 2024

Formula

The g.f. conjectured by Simon Plouffe in his 1992 dissertation,
-(-1-z-z^2-z^3-z^4-z^5-z^6+6*z^7)/(z+1)/(z^2+1)/(z^4+1)/(z-1)^2, is incorrect: the first wrong coefficient is that of z^26. - Robert Israel, Jun 30 2017

Extensions

More terms from Arlin Anderson (starship1(AT)gmail.com)

A055500 a(0)=1, a(1)=1, a(n) = largest prime <= a(n-1) + a(n-2).

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 11, 17, 23, 37, 59, 89, 139, 227, 359, 577, 929, 1499, 2423, 3919, 6337, 10253, 16573, 26821, 43391, 70207, 113591, 183797, 297377, 481171, 778541, 1259701, 2038217, 3297913, 5336129, 8633983, 13970093, 22604069, 36574151, 59178199, 95752333
Offset: 0

Views

Author

N. J. A. Sloane, Jul 08 2000

Keywords

Comments

Or might be called Ishikawa primes, as he proved that prime(n+2) < prime(n) + prime(n+1) for n > 1. This improves on Bertrand's Postulate (Chebyshev's theorem), which says prime(n+2) < prime(n+1) + prime(n+1). - Jonathan Sondow, Sep 21 2013

Examples

			a(8) = 23 because 23 is largest prime <= a(7) + a(6) = 17 + 11 = 28.
		

Crossrefs

Programs

  • Haskell
    a055500 n = a055500_list !! n
    a055500_list = 1 : 1 : map a007917
                   (zipWith (+) a055500_list $ tail a055500_list)
    -- Reinhard Zumkeller, May 01 2013
    
  • Mathematica
    PrevPrim[n_] := Block[ {k = n}, While[ !PrimeQ[k], k-- ]; Return[k]]; a[1] = a[2] = 1; a[n_] := a[n] = PrevPrim[ a[n - 1] + a[n - 2]]; Table[ a[n], {n, 1, 42} ]
    (* Or, if version >= 6 : *)a[0] = a[1] = 1; a[n_] := a[n] = NextPrime[ a[n-1] + a[n-2] + 1, -1]; Table[a[n], {n, 0, 100}](* Jean-François Alcover, Jan 12 2012 *)
    nxt[{a_,b_}]:={b,NextPrime[a+b+1,-1]}; Transpose[NestList[nxt,{1,1},40]] [[1]] (* Harvey P. Dale, Jul 15 2013 *)
  • Python
    from sympy import prevprime; L = [1, 1]
    for _ in range(36): L.append(prevprime(L[-2] + L[-1] + 1))
    print(*L, sep = ", ")  # Ya-Ping Lu, May 05 2023

Formula

a(n) is asymptotic to C*phi^n where phi = (1+sqrt(5))/2 and C = 0.41845009129953131631777132510164822489... - Benoit Cloitre, Apr 21 2003
a(n) = A007917(a(n-1) + a(n-2)) for n > 1. - Reinhard Zumkeller, May 01 2013
a(n) >= prime(n-1) for n > 1, by Ishikawa's theorem. - Jonathan Sondow, Sep 21 2013

A055400 Cube excess: difference between n and largest cube <= n.

Original entry on oeis.org

0, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
Offset: 0

Views

Author

Henry Bottomley, May 16 2000

Keywords

Examples

			a(12) = 4 because 2^3 <= 12 < 3^3 and 12 - 2^3 = 4.
		

Crossrefs

Programs

Formula

a(n) = n - A048762(n) = n - floor(n^(1/3))^3.
a(n) < 3*n^(2/3) for n > 0. - Charles R Greathouse IV, Sep 02 2015
Showing 1-10 of 13 results. Next