OFFSET
1,1
COMMENTS
This process produces a family of similar sequences when using different constant multipliers. See crossrefs below.
LINKS
Wikipedia, Multiplicative order
Index entries for linear recurrences with constant coefficients, signature (6,-4,-6,5).
FORMULA
a(n) = t + k, where t = A004526(n+1) and k = A020699(n), since 4^t == 4^(t+k) (mod 10^n). Here, t is the "transient" portion and k = ord_5^n(4), the multiplicative order of 4 modulo 5^n, is the period of the orbit. - Michael S. Branicky, Apr 22 2023
EXAMPLE
For n = 2, we begin with 1, iteratively multiply by 4 and count the number of terms before the last 2 digits begin to repeat. We obtain 1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, ... . The next term is 4194304, which repeats the last 2 digits 04. Thus, the number of distinct terms is a(2) = 11.
PROG
(Python)
def a(n):
s, x, M = set(), 1, 10**n
while x not in s: s.add(x); x = (x<<2)%M
return len(s), x
print([a(n) for n in range(1, 11)]) # Michael S. Branicky, Apr 22 2023
(Python)
def A362468(n): return (n+1>>1)+(5**(n-1)<<1) # Chai Wah Wu, Apr 24 2023
(PARI) a(n)=(n+1)\2*2*5^(n-1) \\ Charles R Greathouse IV, Apr 28 2023
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Gil Moses, Apr 21 2023
EXTENSIONS
a(13) and beyond from Michael S. Branicky, Apr 22 2023
STATUS
approved