OFFSET
0,3
COMMENTS
The only primes in this sequence are: 2, 7 and 19553. The squares in this sequence begin: 0, 1, 4, 196.
FORMULA
EXAMPLE
a(14) = 0 + 1 + 1 + 2 + 3 + 5 + 8 + 13 + 39 + 124 + 514 + 836 + 1053 + 4139 + 12815 = 19553 is prime. a(31) = 0 + 1 + 1 + 2 + 3 + 5 + 8 + 13 + 39 + 124 + 514 + 836 + 1053 + 4139 + 12815 + 61135 + 104937 + 792517 + 1454698 + 9679838 + 17354310 + 9735140 + 1760750 + 986050 + 621360 + 113815 + 581437 + 1252496 + 7676706 + 13019288 + 94367798 + 178067380.
MATHEMATICA
nxt[{a_, b_}]:={b, Total[FromDigits/@Reverse/@IntegerDigits[{a, b}]]}; Accumulate[ Transpose[NestList[nxt, {0, 1}, 40]][[1]]] (* Harvey P. Dale, Apr 04 2015 *)
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Jonathan Vos Post, Feb 06 2010
STATUS
approved