A112677 Sum of digits of the sum of the previous 4 terms.
1, 1, 1, 1, 4, 7, 4, 7, 4, 4, 10, 7, 7, 10, 7, 4, 10, 4, 7, 7, 10, 10, 7, 7, 7, 4, 7, 7, 7, 7, 10, 4, 10, 4, 10, 10, 7, 4, 4, 7, 4, 10, 7, 10, 4, 4, 7, 7, 4, 4, 4, 10, 4, 4, 4, 4, 7, 10, 7, 10, 7, 7, 4, 10, 10, 4, 10, 7, 4, 7, 10, 10, 4, 4, 10, 10, 10, 7, 10, 10, 10, 10
Offset: 0
Examples
a(0)=a(1)=a(2)=a(3)=1. a(4) = SOD(1+1+1+1) = SOD(4) = 4. a(5) = SOD(1+1+1+4) = SOD(7) = 7. a(10) = SOD(4+7+4+4) = SOD(19) = 10, note that we do not iterate SOD to reduce 10 to 1.
Programs
-
Maple
A112677 := proc(n) option remember: if(n<=3)then return 1:fi: return add(d,d=convert(procname(n-1) + procname(n-2) + procname(n-3) + procname(n-4),base,10)): end: seq(A112677(n),n=0..100); # Nathaniel Johnston, May 04 2011
-
Mathematica
nxt[{a_,b_,c_,d_}]:={b,c,d,Total[IntegerDigits[a+b+c+d]]}; Transpose[ NestList[ nxt,{1,1,1,1},90]][[1]] (* or *) PadRight[{1,1,1,1},120,{10,10,10,10,4,7,4,7,4,4,10,7,7,10,7,4,10,4,7,7,10,10,7,7,7,4,7,7,7,7,10,4,10,4,10,10,7,4,4,7,4,10,7,10,4,4,7,7,4,4,4,10,4,4,4,4,7,10,7,10,7,7,4,10,10,4,10,7,4,7,10,10,4,4,10,10,10,7}](* Harvey P. Dale, Mar 05 2016 *)
Formula
a(0)=a(1)=a(2)=a(3)=1. a(n) = SumDigits(a(n-1) + a(n-2) + a(n-3) + a(n-4)).
a(n) = SumDigits(A000288(n)).
a(n) = A007953(a(n-1) + a(n-2) + a(n-3) + a(n-4)). - Nathaniel Johnston, May 04 2011
Extensions
Name corrected by Nathaniel Johnston, May 04 2011
Comments