cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A350588 a(n) is the number of distinct numbers of steps required for the last n digits of integers to repeat themselves by iterating the map m -> m^5.

This page as a plain text file.
%I A350588 #5 Feb 17 2022 01:11:13
%S A350588 1,2,3,4,6,9,14,23,33,45,59,75,93,113,135,159,184,211,240,271,304,339,
%T A350588 376,415,456,499,544,591,640,691,744,799,855,913,973,1035,1099,1165,
%U A350588 1233,1303,1375,1449,1525,1603,1683,1765,1849,1935,2023,2113,2205,2299
%N A350588 a(n) is the number of distinct numbers of steps required for the last n digits of integers to repeat themselves by iterating the map m -> m^5.
%F A350588 For n >= 9, a(n) = a(n-1) + 2*n - 4 - ceiling(log_2 (n)) or a(n) = n^2 - 3*n - 17 - Sum_{i=9..n} ceiling(log_2 (i)).
%e A350588 a(1) = 1. It takes one step to repeat the last digit by iterating the map on an integer. For example, 2^5 = 32 and 9^5 = 59049. Thus, the distinct number of steps for n = 1 is {1} and a(1) = 1.
%e A350588 a(2) = 2. It takes 1 or 2 steps for an integer to repeat its last two digits. For example, 24 -> 7962624; 27 -> 14348907 -> 608266787713357709119683992618861307. Thus, a(2) = 2: {1, 2}.
%e A350588 a(3)  =  3: {1..3}.
%e A350588 a(4)  =  4: {1..4}.
%e A350588 a(5)  =  6: {1..6}.
%e A350588 a(6)  =  9: {1..9}.
%e A350588 a(7)  = 14: {1..14}.
%e A350588 a(8)  = 23: {1..23}.
%e A350588 a(9)  = 33: {1..24, 32..40}.
%e A350588 a(10) = 45: {1..25, 32..41, 64..73}.
%e A350588 a(11) = 59: {1..26, 32..42, 64..74, 128..138}.
%o A350588 (Python)
%o A350588 from math import log, ceil
%o A350588 def A350588(n):
%o A350588     if n <= 8:
%o A350588         b, S = 10**n, set()
%o A350588         for i in range(b):
%o A350588             t, s, T = i, 0, set()
%o A350588             while t not in T: T.add(t); t = (t**5)%b; s += 1
%o A350588             S.add(s)
%o A350588         return(len(S))
%o A350588     else: return n*n - 3*n - 17 - sum(ceil(log(i, 2)) for i in range(9, n+1))
%Y A350588 Cf. A000584, A348338, A348339, A349744.
%K A350588 nonn,base
%O A350588 1,2
%A A350588 _Ya-Ping Lu_, Jan 07 2022