OFFSET
1,1
COMMENTS
LINKS
FORMULA
a(n) = 9*n - 3 + (-1)^n.
a(n) = a(n-1) + 7 (odd n), a(n) = a(n-1) + 11 (even n) with a(1) = 5.
G.f. x*(5 + 11*x + 2*x^2) / ((1-x)^2 * (1+x)). - Joerg Arndt, May 17 2013
EXAMPLE
For n=23, the digital root of n is 5. 2^n equals 8388608 so the digital root of 2^n is 5 as well.
MATHEMATICA
digitalRoot[n_] := Module[{r = n}, While[r > 9, r = Total[IntegerDigits[ r]]]; r]; Select[Range[448], digitalRoot[2^#] == digitalRoot[#] &] (* T. D. Noe, May 19 2013 *)
LinearRecurrence[{1, 1, -1}, {5, 16, 23}, 60] (* Harvey P. Dale, Dec 29 2018 *)
PROG
(PARI) forstep(n=16, 500, [7, 11], print1(n", ")) \\ Charles R Greathouse IV, May 19 2013
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Marcus Hedbring, May 17 2013
STATUS
approved