OFFSET
0,1
COMMENTS
Each term is created by calculating the sum of the digits of the previous number, and the product of its digits. The results are concatenated to give the new number. Starting with 8, the second number is 88. The third number is generated as follows: 8+8 = 16, 8*8 = 64, which gives 1664. Continuing this way, the 7th number in this sequence becomes 88, equal to the second number of the sequence. Therefore, the pattern 88, 1664, 17144, 17112, 1214, ... repeats indefinitely.
LINKS
Peter Kagey, Table of n, a(n) for n = 0..9999
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,1).
MATHEMATICA
NestList[FromDigits@ Join[IntegerDigits@ Total@ #, IntegerDigits[Times @@ #]] &@ IntegerDigits@ # &, 8, 48] (* Michael De Vlieger, Aug 26 2016 *)
PadRight[{8}, 50, {1214, 88, 1664, 17144, 17112}] (* Harvey P. Dale, Oct 04 2017 *)
PROG
(Haskell)
a271268 = 8 : cycle [88, 1664, 17144, 17112, 1214]
-- Correction by Peter Kagey, Aug 25 2016
(Python)
from functools import reduce
from operator import mul
def product(seq):
return reduce(mul, seq, 1)
def conversion(n):
n = str(n)
return str(sum(int(i) for i in n)) + \
str(product(int(i) for i in n))
def a271268(n):
if n == 1:
return 8
else:
r = 8
while n > 1:
r = conversion(r)
n -= 1
return int(r)
(Python)
from math import prod # first program for illustration - better use the second one
def A271268_gen(n = 8): # optional parameter defines starting value
while True: yield n; d=list(map(int, str(n))); n=int(f"{sum(d)}{prod(d)}")
def A271268(n = None): # if no n given, generator of "infinite" sequence
return (8, 17112, 1214, 88, 1664, 17144)[n%5+1 if n>1 else 0] if n \
else (A271268(n)for n in range(1, 1<<59)) # M. F. Hasler, Apr 01 2025
(PARI) /* first rather for illustration, second is more efficient to get a(n) */
A271268_first(n)=vector(n, i, n=if(i>1, eval(Str(vecsum(n=digits(n)), vecprod(n))), 8))
apply( {A271268(n)=[8, 17112, 1214, 88, 1664, 17144][n%5+(n>1)*2]}, [1..15]) \\ M. F. Hasler, Apr 01 2025
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Sander Claassen, Apr 03 2016
EXTENSIONS
Offset changed to 0 by Sean A. Irvine, Apr 12 2025
STATUS
approved
