OFFSET
0,2
COMMENTS
This sequence is a rare non-periodic case of the recurrence where x(0)=1 and x(n+1) is obtained from m*x(n) by removing all digits k and all trailing zeros in base b. In fact, except for (m, b, k) = (5, 10, 7) (this sequence), x is eventually periodic whenever m <= 5 and 2 <= b <= 32, or m <= 16 and 2 <= b <= 16. However, for negative b it seems that x is non-periodic more frequently, for example when (m, b, k) is (2, -5, 1) or (2, -8, 1).
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,100000,0,0,0,-100000).
FORMULA
a(n) = a(n-4) + 100000*(a(n-16) - a(n-20)) for n > 22.
Recurrence (for n > 2):
a(n+1) = 5*a(n) if n is 1, 3, 4, 5, 7, 8, 9, 11, 13, or 15 mod 16 (these are the cases where 5*a(n) doesn't contain any 7's);
a(n+1) = (a(n) + 625)/2 if n is 2, 6, 10, or 14 mod 16;
a(n+1) = 5*a(n) - 7*10^(5*n/16 + 2) if n is 0 mod 16;
a(n+1) = 5*a(n) - 115*10^(5*(n + 4)/16) if n is 12 mod 16.
Explicit expressions:
a(16*n) = (37*2^4*10^(5*n - 2) - 1)*5^5/123 for n >= 1;
a(16*n + 1) = (2^12*10^(5*n - 4) - 1)*5^6/123 for n >= 1;
a(16*n + 2) = (2^12*10^(5*n - 4) - 1)*5^7/123 for n >= 1;
a(16*n + 3) = (2^8*10^(5*n - 1) - 1)*5^4/123 for n >= 0;
a(16*n + 4) = (2^8*10^(5*n - 1) - 1)*5^5/123 for n >= 0;
a(16*n + 5) = (2^8*10^(5*n - 1) - 1)*5^6/123 for n >= 0;
a(16*n + 6) = (2^8*10^(5*n - 1) - 1)*5^7/123 for n >= 0;
a(16*n + 7) = (2^4*10^(5*n + 2) - 1)*5^4/123 for n >= 0;
a(16*n + 8) = (2^4*10^(5*n + 2) - 1)*5^5/123 for n >= 0;
a(16*n + 9) = (2^4*10^(5*n + 2) - 1)*5^6/123 for n >= 0;
a(16*n + 10) = (2^4*10^(5*n + 2) - 1)*5^7/123 for n >= 0;
a(16*n + 11) = (10^(5*n + 5) - 1)*5^4/123 for n >= 0;
a(16*n + 12) = (10^(5*n + 5) - 1)*5^5/123 for n >= 0;
a(16*n + 13) = (37*2^8*10^(5*n) - 1)*5^6/123 for n >= 0;
a(16*n + 14) = (37*2^8*10^(5*n) - 1)*5^7/123 for n >= 0;
a(16*n + 15) = (37*2^4*10^(5*n + 3) - 1)*5^4/123 for n >= 0.
EXAMPLE
For n <= 6, no 7's occur in 5^n, so a(n) = 5^n. Deleting the 7 in 5*a(6) = 78125, we obtain a(7) = 8125.
MATHEMATICA
Remove7[n_] := FromDigits[Select[IntegerDigits[n], # != 7 &]]; a[0] = 1; a[n_] := a[n] = Remove7[5 * a[n - 1]]; Array[a, 29, 0] (* Amiram Eldar, Jun 20 2020 *)
PROG
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Pontus von Brömssen, Jun 13 2020
STATUS
approved