login
The number of n-digit numbers in A270048.
2

%I #25 May 10 2021 03:48:36

%S 4,6,17,45,131,381,1123,3334,9973,29991,90601,274746,835844,2549874,

%T 7797469,23894630,73358721,225589420,694745922,2142444490,6614766985,

%U 20445300258,63256499281,195890524486,607136782567,1883199766658,5845450449249,18156369461770,56429925440218

%N The number of n-digit numbers in A270048.

%C Conjecture: lim_{n -> infinity} a(n)/a(n-1) = sqrt(10).

%C (Similar to A265108, where we count the n-digit numbers of A264847, pluritriangular numbers.)

%C It is not possible to count some hundred-digit numbers without a "climbing algorithm" (see also Program and Links).

%H Francesco Di Matteo, <a href="/A270270/b270270.txt">Table of n, a(n) for n = 1..300</a>

%H Francesco Di Matteo, <a href="/A270270/a270270.pdf">Calculating the A270270 terms</a>

%e a(1) = 4 because in A270048 there are 4 numbers with 1 digit (0, 1, 3, 6).

%e a(2) = 6 because in A270048 there are 8 numbers with 2 digits (10, 20, 32, 46, 62, 80).

%o (Python)

%o # init values

%o seq = [4] # the output list

%o somme = [4] # the n-value list after the adding of the last seq term

%o last = [10] # last a(n) term, or the first k-digit number (10 with k=2)

%o # CLIMBING loop, put a bigger value if you want

%o for n in range (1,30):

%o k = (len(somme)+1) # the digits number

%o limit = 10**k # the newest value to achieve

%o base = (somme[-1]+1)*k # this is the (n+1)*k value

%o hypo = seq[-1]*3 # to obtain rapidly the limite value

%o rid = 10**(len(str(hypo))-1) # the reduction factor

%o # Adjustment LOOP #

%o s, p, m = 0, 0, 0

%o while s < 1:

%o diff_1 = (base + (base + (k*(hypo-1))))*float(hypo)/2

%o tot = last[-1] + diff_1

%o if tot < limit:

%o p = 1

%o if m == 1 and rid > 1:

%o m = 0; rid = rid/10

%o hypo = hypo + rid

%o else:

%o diff_2 = (base + (base + (k*(hypo-2))))*float(hypo-1)/2

%o tot = last[-1] + diff_2

%o if tot > limit:

%o m = 1

%o if p == 1 and rid > 1:

%o p = 0; rid = rid/10

%o hypo = hypo - rid

%o else:

%o s = 1 # escape value

%o # lists updating

%o seq.append(hypo)

%o somme.append(somme[-1]+ hypo)

%o last.append(last[-1]+ diff_1)

%o # if you want to prove the conjecture values, uncomment next line

%o #print(seq[-1], float(seq[-1])/seq[-2])

%o print(seq)

%Y Cf. A264847, A265108, A270048.

%K nonn,base

%O 1,1

%A _Francesco Di Matteo_, Mar 14 2016