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

A372924
a(n) = (sum_digits(n^3)-n)/3.
1
0, 0, 2, 2, 2, 1, 1, 1, 0, 3, -3, -1, 2, 2, 1, 1, 1, 0, 0, 3, -4, -1, -1, -2, -2, -2, 0, 0, -3, -1, -7, -1, -2, -2, -5, -3, -3, -6, -4, -4, -10, -5, -5, -5, -6, -9, -6, -10, -10, -7, -14, -11, -11, -6, -9, -9, -10, -10, -13, -11, -17, -11, -12, -15, -15, -13, -10
OFFSET
0,3
COMMENTS
a(n) + floor((n+1)/3) is always a multiple of 3. - Jon E. Schoenfield, May 18 2024
FORMULA
a(n) = (A004164(n)-n)/3.
EXAMPLE
For n=42, 42^3 = 74088 has sum of digits 27 so a(42) = (27 - 42)/3 = -5.
MAPLE
read("transforms"):
A372924 := proc(n)
(digsum(n^3)-n)/3 ;
end proc:
seq(A372924(n), n=0..80) ; # R. J. Mathar, Jul 03 2024
MATHEMATICA
Table[(DigitSum[n^3] - n)/3, {n, 0, 100}] (* Paolo Xausa, Jul 03 2024 *)
PROG
(C)
#include <stdint.h>
#include <stdio.h>
int32_t sumDigits(int64_t num)
{
int32_t sum = 0;
while (num > 0)
{
sum += num % 10;
num /= 10;
}
return sum;
}
int main()
{
for (int64_t i=0; i<10000; ++i)
{
int64_t num = i * i * i;
int32_t sum = sumDigits(num);
printf("%ld, ", (sum - i)/3);
}
return 0;
}
CROSSREFS
Cf. A004164.
Sequence in context: A274886 A325955 A337311 * A004571 A204429 A292560
KEYWORD
sign,base,easy
AUTHOR
Guy Harari, May 16 2024
STATUS
approved