login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A054792
Earliest sequence with a(a(n)) = n^3.
1
0, 1, 3, 8, 5, 64, 7, 216, 27, 10, 729, 12, 1331, 14, 2197, 16, 3375, 18, 4913, 20, 6859, 22, 9261, 24, 12167, 26, 15625, 512, 29, 21952, 31, 27000, 33, 32768, 35, 39304, 37, 46656, 39, 54872, 41, 64000, 43, 74088, 45, 85184, 47, 97336, 49, 110592, 51
OFFSET
0,3
FORMULA
If n is a cube then a(n) = a(n^(1/3))^3, otherwise if the difference between n and the highest cube less than n is odd then a(n) = n+1, otherwise a(n) = (n-1)^3.
MATHEMATICA
a[n_] := a[n] = Which[r = n^(1/3); IntegerQ[r], a[r]^3, OddQ[n - Floor[r]^3], n+1, True, (n-1)^3]; a[0]=0; a[1]=1; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Aug 07 2012, after formula *)
CROSSREFS
Sequence in context: A086872 A363421 A323760 * A144872 A090347 A374922
KEYWORD
nice,nonn
AUTHOR
Henry Bottomley, Apr 27 2000
STATUS
approved