login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A372924 a(n) = (sum_digits(n^3)-n)/3. 1

%I #28 Jul 03 2024 09:27:26

%S 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,

%T -1,-7,-1,-2,-2,-5,-3,-3,-6,-4,-4,-10,-5,-5,-5,-6,-9,-6,-10,-10,-7,

%U -14,-11,-11,-6,-9,-9,-10,-10,-13,-11,-17,-11,-12,-15,-15,-13,-10

%N a(n) = (sum_digits(n^3)-n)/3.

%C a(n) + floor((n+1)/3) is always a multiple of 3. - _Jon E. Schoenfield_, May 18 2024

%F a(n) = (A004164(n)-n)/3.

%e For n=42, 42^3 = 74088 has sum of digits 27 so a(42) = (27 - 42)/3 = -5.

%p read("transforms"):

%p A372924 := proc(n)

%p (digsum(n^3)-n)/3 ;

%p end proc:

%p seq(A372924(n),n=0..80) ; # _R. J. Mathar_, Jul 03 2024

%t Table[(DigitSum[n^3] - n)/3, {n, 0, 100}] (* _Paolo Xausa_, Jul 03 2024 *)

%o (C)

%o #include <stdint.h>

%o #include <stdio.h>

%o int32_t sumDigits(int64_t num)

%o {

%o int32_t sum = 0;

%o while (num > 0)

%o {

%o sum += num % 10;

%o num /= 10;

%o }

%o return sum;

%o }

%o int main()

%o {

%o for (int64_t i=0; i<10000; ++i)

%o {

%o int64_t num = i * i * i;

%o int32_t sum = sumDigits(num);

%o printf("%ld, ", (sum - i)/3);

%o }

%o return 0;

%o }

%Y Cf. A004164.

%K sign,base,easy

%O 0,3

%A _Guy Harari_, May 16 2024

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 26 02:32 EDT 2024. Contains 374615 sequences. (Running on oeis4.)