|
|
A163522
|
|
a(1)=2; for n>1, a(n) = sum of digits of a(n-1)^2.
|
|
2
|
|
|
2, 4, 7, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16, 13, 16
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
G.f.: x*(2 + 4*x + 5*x^2 + 9*x^3 + 9*x^4)/((1 - x)*(1 + x)). - Bruno Berselli, May 29 2014
|
|
EXAMPLE
|
a(2)=4 because 2^2=4;
a(3)=7 because 4^2=16 and 6+1=7;
a(4)=13 because 7^2=49 and 4+9=13.
Other similar sequences, starting from 3, 5, 7 respectively:
. 3, 9 (9 repeated);
. 5, 7, 13, 16, 13 (13, 16 repeated);
. 8, 10, 1 (1 repeated).
|
|
MATHEMATICA
|
Join[{2, 4, 7}, LinearRecurrence[{0, 1}, {13, 16}, 50]] (* or *) CoefficientList[Series[x*(2 + 4*x + 5*x^2 + 9*x^3 + 9*x^4)/((1 - x)*(1 + x)), {x, 0, 50}], x] (* G. C. Greubel, Jul 27 2017 *)
|
|
PROG
|
(PARI) x='x+O('x^50); Vec(x*(2 + 4*x + 5*x^2 + 9*x^3 + 9*x^4)/((1 - x)*(1 + x))) \\ G. C. Greubel, Jul 27 2017
(Scheme) (define (A163522 n) (cond ((<= n 2) (expt 2 n)) ((= 3 n) 7) ((even? n) 13) (else 16))) ;; Antti Karttunen, Sep 14 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|