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.
%I A358982 #22 Dec 19 2022 15:05:26 %S A358982 8,87,887,8887,99868,978887,7978887,96699868,987978887,9896699868, %T A358982 89987978887,969896699868,7969896699868,97969896699868, %U A358982 897969896699868,9988999939998887,99988999939998887,999988999939998887,8999988999939998887,78999988999939998887 %N A358982 In base 10, for all numbers with n digits, a(n) is the number where the sum of digits of a(n) minus the sum of the last n digits of a(n)^3 reaches a record maximum. %C A358982 The corresponding last n digits of a(n)^3 are 2, 03, 103, 0103, 00032, 110103, 1110103, 00100032, 011110103, 0300100032, ... %C A358982 The corresponding differences between the digit sums are 6, 12, 19, 27, 35, 41, 47, 55, 63, 69, 77, 84, 91, 99, 107, 115, 124, 132, ... %C A358982 Question: what constant does the ratio between the maximum differences and n converge to? %C A358982 In case of a tie, only the smallest example is given. For example, n=7, a(n)=9899868 would also meet the criterion. Other cases of a tie happen at n=10, 12, 13, 14, 28, 29, 31, ... %H A358982 Martin Raab, <a href="/A358982/b358982.txt">Table of n, a(n) for n = 1..250</a> %H A358982 Johannes F. Morgenbesser, <a href="http://dx.doi.org/10.4064/aa148-4-4">The sum of digits of floor(n^c)</a>, Acta Arithmetica 148 (2011), 367-393. %e A358982 The digit sum of 7978887 is 54, the digit sum of 7978887^3 mod 10^7 = 1110103 is 7. 54-7=47, which means that randomly finding numbers for which the sum of digits of x^3 is smaller than the sum of digits of x is easiest when choosing x with the given seven ending digits (that is, of course, depending on the preferred size of x). %e A358982 Heuristically it can be conjectured that there are infinitely many numbers x for which the digit sum of x^3 is smaller than the digit sum of x. %o A358982 (PARI) a(n)={r=0; i=10^n; for(x=1, i-1, s1=sumdigits(x); s2=sumdigits(x^3%i); d=s2-s1; if(d<r, r=d; b=x)); b} %o A358982 (PARI) %o A358982 /* The following program finds the first 69 terms, and also many of the larger terms, correctly. The 70th term will be incorrect because of the truncation to 10^4*(9/10)=9000 record numbers for each number of digits; if the truncation is increased to 10^5*(9/10) records (n=5 at the beginning), the first 237 terms give a(n) with corresponding maxima. (Further restrictions on ending digits find optimal solutions for a higher number of digits.) */ %o A358982 {n=4; d=10^n; v=vector(d*9/10); print("keeping "#v" record numbers"); w=vector(d*9); for(x=1, d-1, if(x%10, y=sumdigits((x^3)%d); z=sumdigits(x); v[9*(x\10)+(x%10)]=x+d*(y-z))); v=vecsort(v); while(d<10^250, for(i=1, #v, for(j=0, 9, x=d*j+v[i]%d; y=sumdigits((x^3)%(d*10)); z=sumdigits(x); w[10*(i-1)+j+1]=x+d*10*(y-z))); d*=10; n++; w=vecsort(w); v=vecextract(w,Str("1.."#v)); print(n" digits - record differences: "vecextract(v,"1..5")\d" / record mod "10"^"n": "v[1]%d))} %Y A358982 Cf. A000578, A004164. %K A358982 nonn,base %O A358982 1,1 %A A358982 _Martin Raab_, Dec 08 2022