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.

A254078 a(n) is the number of steps after which n variables with increasing value ranges all have equal values when the values of all variables are decreased by 1 at each step and the value is set to the maximum value again when the resulting value would be 0.

This page as a plain text file.
%I A254078 #41 May 22 2025 10:21:42
%S A254078 4,10,58,58,418,838,2518,2518,27718,27718,360358,360358,360358,720718,
%T A254078 12252238,12252238,232792558,232792558,232792558,232792558,5354228878,
%U A254078 5354228878,26771144398,26771144398,80313433198,80313433198,2329089562798
%N A254078 a(n) is the number of steps after which n variables with increasing value ranges all have equal values when the values of all variables are decreased by 1 at each step and the value is set to the maximum value again when the resulting value would be 0.
%C A254078 The k-th variable can take k+1 different values.
%C A254078 From _Charlie Neder_, Oct 01 2018: (Start)
%C A254078 a(n) is the smallest k congruent to m-2 modulo m for 2 <= m <= n+1.
%C A254078 Proof: All variables will be equal for the first time precisely when they all are equal to 2, in which case each variable has changed from its maximum value m to 2. Additionally, this k is lcm(2,3,...,m) - 2, since advancing two more steps will return all variables to their maximum values.
%C A254078 Adding a variable that only takes one value {1} results in A070198 (LCM - 1). (End)
%H A254078 Felix Fröhlich, <a href="/A254078/a254078.pdf">Visual representation of a(3)</a>
%F A254078 a(n) = A003418(n+1) - 2. - _Charlie Neder_, Oct 02 2018
%e A254078 In case of two variables, the first can take two values (1 and 2) and the second three values (1, 2 and 3). Performing the operation on the variables generates sequences of values 2, 1, 2, 1, 2, 1, ... for first variable and 3, 2, 1, 3, 2, 1, ... for second variable. After four steps, the value of both variables is 2, so a(2) = 4.
%o A254078 (PARI) a(n) = my(v=vector(n, x, x++), w=v, i=0); while(1, if(vecmax(v)==vecmin(v), return(i)); for(k=1, #v, if(v[k]==1, v[k]=w[k], v[k]--)); i++) \\ _Felix Fröhlich_, Feb 19 2017
%o A254078 (Python)
%o A254078 from math import gcd
%o A254078 lcm = 2
%o A254078 for n in range(3,53):
%o A254078   lcm *= n // gcd(lcm,n)
%o A254078   print(n-1,lcm-2) # _Charlie Neder_, Oct 02 2018
%Y A254078 Cf. A070198 (LCM - 1), A003418 (LCM), A075059 (LCM + 1).
%K A254078 nonn
%O A254078 2,1
%A A254078 _Felix Fröhlich_, Jan 25 2015
%E A254078 Value of a(6) corrected and more terms from _Felix Fröhlich_, Mar 25 2015
%E A254078 Illustration and program replaced with improved versions by _Felix Fröhlich_, Feb 19 2017
%E A254078 Corrected and extended by _Charlie Neder_, Oct 01 2018