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.

A254767 a(n) is the least k > n such that k*n is a cube.

Original entry on oeis.org

8, 4, 9, 16, 25, 36, 49, 27, 24, 100, 121, 18, 169, 196, 225, 32, 289, 96, 361, 50, 441, 484, 529, 72, 40, 676, 64, 98, 841, 900, 961, 54, 1089, 1156, 1225, 48, 1369, 1444, 1521, 200, 1681, 1764, 1849, 242, 75, 2116, 2209, 288, 56, 160, 2601, 338, 2809, 108
Offset: 1

Views

Author

Peter Kagey, Feb 07 2015

Keywords

Comments

a(n) <= n^2 for all n > 1 because n * n^2 = n^3.

Examples

			a(12) = 18 because 12*18 = 6^3 (and 12*13, 12*14, 12*15, 12*16, 12*17 are not perfect cubes).
		

Crossrefs

Cf. A072905 (an analogous sequence for squares).
Cf. A048798 (similar sequence, no restriction that a(n) > n).

Programs

  • Mathematica
    f[n_] := Block[{k = n + 1}, While[! IntegerQ@ Power[k n, 1/3], k++]; k]; Array[f, 54] (* Michael De Vlieger, Mar 17 2015 *)
  • PARI
    a(n)=if (n==1, 8, for(k=n+1, n^2, if(ispower(k*n, 3), return(k))))
    vector(100, n, a(n)) \\ Derek Orr, Feb 07 2015
    
  • PARI
    a(n) = {f = factor(n); for (i=1, #f~, if (f[i,2] % 3, f[i,2] = 3 - f[i,2]);); cb = factorback(f); cbr = sqrtnint(cb*n, 3); cb = cbr^3; k = cb/n; while((type(k=cb/n) != "t_INT") || (k<=n), cbr++; cb = cbr^3;); k;} \\ Michel Marcus, Mar 14 2015
  • Ruby
    def a(n)
      min = (n**(2/3.0)).ceil
      (min..n+1).each { |i| return i**3/n if i**3 % n == 0 && i**3 > n**2 }
    end