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-8 of 8 results.

A276612 Simple self-inverse permutation of natural numbers: after a(0)=0, list each block of A261229(n) numbers in reverse order, from A261227(n) to A261228(1+n).

Original entry on oeis.org

0, 1, 4, 3, 2, 10, 9, 8, 7, 6, 5, 19, 18, 17, 16, 15, 14, 13, 12, 11, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 108
Offset: 0

Views

Author

Antti Karttunen, Sep 07 2016

Keywords

Comments

Maps between A276613 and A276614.

Crossrefs

Programs

A055401 Number of positive cubes needed to sum to n using the greedy algorithm.

Original entry on oeis.org

0, 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, 6, 7, 8, 2, 3, 4, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7, 8, 9, 10, 4, 5, 6, 2, 3, 4, 5, 6, 7, 8, 9, 3, 4, 1, 2, 3, 4, 5, 6, 7, 8, 2, 3, 4, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7, 8, 9, 10, 4, 5, 6, 2, 3, 4, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7
Offset: 0

Views

Author

Henry Bottomley, May 16 2000

Keywords

Comments

Define f(n) = n - k^3 where (k+1)^3 > n >= k^3; a(n) = number of steps such that f(f(...f(n)))= 0.
Also sum of digits when writing n in base where place values are positive cubes, cf. A000433. [Reinhard Zumkeller, May 08 2011]

Examples

			a(32)=6 because 32=27+1+1+1+1+1 (not 32=8+8+8+8).
a(33)=7 because 33=27+1+1+1+1+1+1 (not 33=8+8+8+8+1).
		

Crossrefs

Cf. A002376 (least number of positive cubes needed to represent n; differs from this sequence for the first time at n=32, where a(32)=6, while A002376(32)=4).

Programs

  • Haskell
    a055401 n = s n $ reverse $ takeWhile (<= n) $ tail a000578_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
    (Scheme, with memoization-macro definec)
    (definec (A055401 n) (if (zero? n) n (+ 1 (A055401 (A055400 n)))))
    ;; Antti Karttunen, Aug 16 2015
  • Maple
    f:= proc(n,k) local m, j;
    if n = 0 then return 0 fi;
    for j from k by -1 while j^3 > n do od:
    m:= floor(n/j^3);
    m + procname(n-m*j^3, j-1);
    end proc:
    seq(f(n,floor(n^(1/3))),n=0..100); # Robert Israel, Aug 17 2015
  • Mathematica
    a[0] = 0; a[n_] := {n} //. {b___, c_ /; !IntegerQ[c^(1/3)], d___} :> {b, f = Floor[c^(1/3)]^3, c - f, d} // Length; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Aug 17 2015 *)
  • PARI
    F=vector(30,n,n^3); /* modify to get other sequences of "greedy representations" */ last_leq(v,F)=
    { /* Return last element <=v in sorted array F[] */
        local(j=1);
        while ( F[j]<=v, j+=1 );
        return( F[j-1] );
    }
    greedy(n,F)=
    {
        local(v=n,ct=0);
        while ( v,  v-=last_leq(v,F); ct+=1; );
        return(ct);
    }
    vector(min(100,F[#F-1]),n,greedy(n,F)) /* show terms */
    /* Joerg Arndt, Apr 08 2011 */
    

Formula

a(0) = 0; for n >= 1, a(n) = a(n-floor(n^(1/3))^3)+1 = a(A055400(n))+1 = a(n-A048762(n))+1.

Extensions

a(0) = 0 prepended by Antti Karttunen, Aug 16 2015

A261223 a(n) = number of steps to reach 0 when starting from k = (n*n)-1 and repeatedly applying the map that replaces k with k - A053610(k), where A053610(k) = the number of positive squares that sum to k using the greedy algorithm.

Original entry on oeis.org

0, 1, 3, 5, 8, 11, 14, 18, 23, 28, 34, 40, 47, 54, 61, 69, 77, 86, 96, 106, 117, 128, 140, 152, 164, 177, 190, 204, 218, 233, 248, 264, 281, 298, 316, 334, 353, 372, 391, 411, 432, 453, 474, 496, 518, 541, 564, 588, 612, 637, 663, 689, 716, 743, 771, 799, 827, 856, 886, 916, 947, 978, 1009, 1041, 1073, 1106, 1139, 1173, 1207, 1242, 1277, 1313, 1350, 1387, 1425, 1463, 1502, 1541
Offset: 1

Views

Author

Antti Karttunen, Aug 12 2015

Keywords

Crossrefs

One less than A261222.
Cf. also A260733, A261228.

Programs

  • Mathematica
    Table[-2 + Length@ NestWhileList[# - Block[{m = #, c = 1}, While[a = (# - Floor[Sqrt@ #]^2) &@ m; a != 0, c++; m = a]; c] &, (n + 1)^2, # != 0 &], {n, 0, 77}] (* Michael De Vlieger, Sep 08 2016, after Jud McCranie at A053610 *)

Formula

a(n) = A261221((n^2)-1).
a(n) = A261222(n)-1.

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.]

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).

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)).

A276611 After a(0)=0, each n occurs A261229(n) times.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 07 2016

Keywords

Comments

Auxiliary function for computing A276612 & A276613.

Crossrefs

Programs

  • Scheme
    (define (A276611 n) (let loop ((k 0)) (if (>= (A261228 (+ 1 k)) n) k (loop (+ 1 k)))))
Showing 1-8 of 8 results.