A120437 Differences of A037314 (sum of base-3 digits of n = sum of base-9 digits of n).
1, 1, 7, 1, 1, 7, 1, 1, 61, 1, 1, 7, 1, 1, 7, 1, 1, 61, 1, 1, 7, 1, 1, 7, 1, 1, 547, 1, 1, 7, 1, 1, 7, 1, 1, 61, 1, 1, 7, 1, 1, 7, 1, 1, 61, 1, 1, 7, 1, 1, 7, 1, 1, 547, 1, 1, 7, 1, 1, 7, 1, 1, 61, 1, 1, 7, 1, 1, 7, 1, 1, 61, 1, 1, 7, 1, 1, 7, 1, 1
Offset: 1
Links
- Michel Marcus, Table of n, a(n) for n = 1..2000
Programs
-
Maple
A037314[0]:= 0; for n from 0 to 33 do for k from 0 to 2 do A037314[3*n+k]:= 9*A037314[n]+k od od: seq(A037314[i]-A037314[i-1],i=1..100); # Robert Israel, Nov 06 2016
-
Mathematica
Differences@ Table[FromDigits[RealDigits[n, 3], 9], {n, 1, 100}] (* Michael De Vlieger, Nov 10 2016, after Clark Kimberling at A037314 *)
-
PARI
a037314(n) = {my(d = digits(n, 3)); subst(Pol(d), x, 9); } a(n) = a037314(n) - a037314(n-1); \\ Michel Marcus, Oct 30 2016
Formula
It appears that the sequence is given by the following recursion: a(n)=1 if n=1, a(n)=9a(3^(k-1))-2 if n=3^k for some k>0, a(n)=a(n-3^(k-1)) if 3^(k-1)0. This recursion formula has been verified for n<=2000.
a(n) = A066443(A007949(n)). (This is equivalent to the conjectured recursion above; that recursion is correct.) - Franklin T. Adams-Watters, Jul 24 2006
G.f. g(x) satisfies g(x) = 9 g(x^3) + x*(1+2*x)/(1+x+x^2). - Robert Israel, Nov 06 2016
Comments