|
|
A061588
|
|
a(1) = 2; thereafter a(n) is the number obtained by replacing each digit of a(n-1) with its square.
|
|
4
|
|
|
2, 4, 16, 136, 1936, 181936, 164181936, 13616164181936, 193613613616164181936, 1819361936193613613616164181936, 1641819361819361819361936193613613616164181936
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
For integer n > 5,
a(n) = a(n-4)*10^(L(a(n-5))+L(a(n-1))) + a(n-5)*10^(L(a(n-1))) + a(n-1), where L(x) is the number of digits in x.
L(a(n)) = (W^(n-1)*[s1]^T)^T*[d]^T, where W is the 5 X 5 square matrix [(0 1 0 0 0) (0 0 1 0 0) (0 0 0 1 0) (0 0 0 0 1) (1 1 0 0 1)], [s1] = [1 2 3 4 6], [d] = [1 0 0 0 0], and T denotes transpose.
To determine the initial digits of a(n), n > 5, let b = ((n+2) mod 4) + 2. Then a(n) begins with a(b). E.g. let n = 100, b = 4, then a(100) = 1936... (End)
|
|
EXAMPLE
|
After 136: the squares of 1, 3, 6 are 1, 9, 36 respectively hence the next term is 1936.
a(11) = a(7)*10^L(a(6)+a(10))+a(6)*10^L(a(10))+a(10)
= 13616164181936*10^55 + 164181936*10^46 +
1641819361819361819361936193613613616164181936
= 136161641819361641819361641819361819361819361936193613613616164181936
a(100) = 1936...*10^L(a(96)+a(99))+136...*10^L(a(99))+136...936, where L(100) has approximately 2.74*10^17 digits. - William Davidson, Aug 15 2012
|
|
PROG
|
(Python)
def digits(n):
.d=[]
.while n>0:
..d.append(n%10)
..n=n//10
.return d
def sqdig(n):
.new=0
.num=digits(n)
.spacing=0
.while num:
..k=num.pop(0)
..new+=(10**(spacing))*(k**2)
..if k>3:
...spacing+=1
..spacing+=1
.return new
def davidson(n):
.i=2
.while n>1:
..i=sqdig(i)
..n-=1
.return i
(Python)
from itertools import accumulate
def f(an, _): return int("".join(str(int(d)**2) for d in str(an)))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|