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.

User: Francesco Di Matteo

Francesco Di Matteo's wiki page.

Francesco Di Matteo has authored 14 sequences. Here are the ten most recent ones:

A377012 Numbers k whose digits can be split into substrings so that the sum of these substrings raised to consecutive powers (1, 2, 3, ...) is the number k itself.

Original entry on oeis.org

89, 135, 175, 518, 598, 1306, 1370, 1371, 1676, 2045, 2427, 3055, 5755, 5918, 9899, 11053, 24429, 88297, 135010, 234322, 255050, 255051, 360030, 360031, 494703, 512780, 517380, 568217, 767368, 779243, 785920, 785921, 788834, 819116, 931316, 986562, 998999, 1000100
Offset: 1

Author

Francesco Di Matteo, Oct 28 2024

Keywords

Comments

At least two substrings are required and each substring must have at least one digit.
A subsequence is A032799 (except for 1-digit numbers).
Unlike A032799, which is finite, this sequence is infinite because; e.g., the pattern 89, 9899, 998999, ... can always be split into two equal-length substrings that generate a term as (10^i - 2)^1 + (10^i - 1)^2 = 10^i*(10^i - 2) + (10^i - 1) for all i > 0.
Leading zeros in strings are allowed here. The first such term generated by the author's program is 1010053 = 1^1 + (01005)^2 + 3^3. - Michael S. Branicky, Nov 30 2024
Another pattern is deduced from a(38) = 1000100 = 100^1 + 0^2 + 100^3 with formula (10^i)^1 + 0^2 + ... + 0^n + ([0...0]10^i)^(n+1) = (10^i)^(n+1) + 10^i with i > 1 and n > 1. - Francesco Di Matteo, Jan 15 2025

Examples

			175 = 1^1 + 7^2 + 5^3 is a term.
5755 = 5^1 + 75^2 + 5^3 is a term.
88297 = 88^1 + 297^2 is a term.
234322 = 23^1 + 4^2 + 3^3 + 22^4 is a term.
		

Crossrefs

Programs

  • Python
    import itertools
    analys = range(1, 7) # increase this if you want
    for limite in analys:
        numbers = range(pow(10,limite-1),pow(10,limite))
        r = range(1, limite+1)
        disp_temp = []
        for s in r:
            disp = list(itertools.product(r, repeat=s+1))
            disp_temp.extend(disp)
        disp_ok = [d for d in disp_temp if sum(d)==limite]
        for numero in numbers:
            str_numero = str(numero)
            for combo in disp_ok:
                k = limite
                totale = 0
                for c in range(len(combo), 0, -1):
                    partenza = k-combo[c-1]
                    porzione = str_numero[partenza:k]
                    if c == 1:
                        totale = totale + int(porzione)
                    else:
                        totale = totale + pow(int(porzione),c)
                    k = k - combo[c-1]
                if totale == numero:
                    print(numero)

A270270 The number of n-digit numbers in A270048.

Original entry on oeis.org

4, 6, 17, 45, 131, 381, 1123, 3334, 9973, 29991, 90601, 274746, 835844, 2549874, 7797469, 23894630, 73358721, 225589420, 694745922, 2142444490, 6614766985, 20445300258, 63256499281, 195890524486, 607136782567, 1883199766658, 5845450449249, 18156369461770, 56429925440218
Offset: 1

Author

Francesco Di Matteo, Mar 14 2016

Keywords

Comments

Conjecture: lim_{n -> infinity} a(n)/a(n-1) = sqrt(10).
(Similar to A265108, where we count the n-digit numbers of A264847, pluritriangular numbers.)
It is not possible to count some hundred-digit numbers without a "climbing algorithm" (see also Program and Links).

Examples

			a(1) = 4 because in A270048 there are 4 numbers with 1 digit (0, 1, 3, 6).
a(2) = 6 because in A270048 there are 8 numbers with 2 digits (10, 20, 32, 46, 62, 80).
		

Crossrefs

Programs

  • Python
    # init values
    seq = [4]   # the output list
    somme = [4] # the n-value list after the adding of the last seq term
    last = [10] # last a(n) term, or the first k-digit number (10 with k=2)
    # CLIMBING loop, put a bigger value if you want
    for n in range (1,30):
      k = (len(somme)+1)     # the digits number
      limit = 10**k          # the newest value to achieve
      base = (somme[-1]+1)*k # this is the (n+1)*k value
      hypo = seq[-1]*3       # to obtain rapidly the limite value
      rid = 10**(len(str(hypo))-1) # the reduction factor
      # Adjustment LOOP #
      s, p, m = 0, 0, 0
      while s < 1:
        diff_1 = (base + (base + (k*(hypo-1))))*float(hypo)/2
        tot = last[-1] + diff_1
        if tot < limit:
          p = 1
          if m == 1 and rid > 1:
            m = 0; rid = rid/10
          hypo = hypo + rid
        else:
          diff_2 = (base + (base + (k*(hypo-2))))*float(hypo-1)/2
          tot = last[-1] + diff_2
          if tot > limit:
            m = 1
            if p == 1 and rid > 1:
              p = 0; rid = rid/10
            hypo = hypo - rid
          else:
            s = 1    # escape value
      # lists updating
      seq.append(hypo)
      somme.append(somme[-1]+ hypo)
      last.append(last[-1]+ diff_1)
    # if you want to prove the conjecture values, uncomment next line
    #print(seq[-1], float(seq[-1])/seq[-2])
    print(seq)

A269631 a(1) = 0; a(n+1) is the smallest integer not yet used that contains the number of decimal digits of a(n) as a substring.

Original entry on oeis.org

0, 1, 10, 2, 11, 12, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 42, 52, 62, 72, 82, 92, 102, 3, 13, 112, 30, 120, 31, 121, 33, 122, 34, 123, 35, 124, 36, 125, 37, 126, 38, 127, 39, 128, 43, 129, 53, 132, 63, 142, 73, 152, 83, 162, 93, 172, 103, 113, 130, 131, 133, 134, 135
Offset: 1

Author

Francesco Di Matteo, Mar 01 2016

Keywords

Comments

Conjecture: a(n) is a permutation of the nonnegative integers.
The following table shows:
C = number of terms calculated
F = number of terms less than C
+------------+----------+-----------+
| C | F | % |
+------------+----------+------------
| 10 | 2 | 20.0 |
| 100 | 39 | 39.0 |
| 1000 | 532 | 53.2 |
| 10000 | 6379 | 63.79 |
| 100000 | 71609 | 71.609 |
| 1000000 | 765630 | 76.563 |
| 10000000 | 7907944 | 79.07944 |
| 100000000 | 81251152 | 81.251152 |
.
and the growth of percentage seems to support the conjecture.

Examples

			a(2) = 1 because a(1) = 0 and 0 has 1 decimal digit;
a(3) = 10 because a(2) = 1, so 1 has 1 digit, and 10 is the first integer not yet used that contains "1";
a(4) = 2 because a(3) = 10 and 10 has 2 digits;
a(5) = 11 because a(4) = 2, so 2 has 1 digit, and 11 is the first integer not yet used that contains "1"; ...
		

Programs

  • Mathematica
    a = {0, 1}; Do[AppendTo[a, SelectFirst[Range[10^3], And[! MemberQ[a, #], MemberQ[IntegerDigits@ #, IntegerLength@ a[[n - 1]]]] &]], {n, 3, 64}]; a (* Michael De Vlieger, Apr 01 2016 *)
  • PARI
    findnew(nbd, vsa) = {k=0; while (vecsearch(vsa, k) || !vecsearch(vecsort(digits(k)), nbd), k++); k;}
    listd(nn) = {va = vector(nn); print1(va[1], ", "); vsa = vecsort(va,,8); for (n=2, nn, nbd = #Str(va[n-1]); na = findnew(nbd, vsa); print1(na, ", "); va[n] = na; vsa = vecsort(va,,8););} \\ Michel Marcus, Mar 08 2016
  • Python
    # This routine is a little bit more complex compared to the same with
    # the a(n) terms 'storage' (now we memorize only the highest number
    # for every k-digits) but is very much faster.
    print("0", end=',')
    lista = [-1,0,0,0,0,0,0,0,0,0]
    a = 1
    for g in range (1,100):
        b = len(str(a))
        val = lista[b] + 1
        flag = 0
        while flag == 0:
            sval = str(val)
            while str(b) not in sval:
                val += 1
                sval = str(val)
            k = len(sval)
            comp = k
            for s in range(k):
                if lista[int(sval[s])] < val:
                    comp -= 1
            if comp == 0:
                flag = 1
            else:
                val +=1
        print(val, end=',')
        lista[b] = val
        a = val
    # Francesco Di Matteo, Mar 02 2016
    

A270048 a(1) = 0; a(n+1) = a(n) + n * the number of digits of a(n).

Original entry on oeis.org

0, 1, 3, 6, 10, 20, 32, 46, 62, 80, 100, 133, 169, 208, 250, 295, 343, 394, 448, 505, 565, 628, 694, 763, 835, 910, 988, 1069, 1181, 1297, 1417, 1541, 1669, 1801, 1937, 2077, 2221, 2369, 2521, 2677, 2837, 3001, 3169, 3341, 3517, 3697, 3881, 4069, 4261, 4457, 4657, 4861, 5069, 5281, 5497, 5717, 5941
Offset: 1

Author

Francesco Di Matteo, Mar 09 2016

Keywords

Comments

In this sequence each a(n) term is the sum of k-terms, where k is the number of digits of a(n-1).
This is easy to verify by observing the following table:
+----+---------+---------+---------+--+-----+
| n | A000217 | A056000 | A101859 |..| a(n)|
+----+---------+---------+---------+--+-----+
| 1 | 0 | . | . | .| 0 |
| 2 | 1 | . | . | .| 1 |
| 3 | 3 | . | . | .| 3 |
| 4 | 6 | . | . | .| 6 |
| 5 | 10 | 0 | . | .| 10 |
| 6 | 15 | 5 | . | .| 20 |
| 7 | 21 | 11 | . | .| 32 |
| 8 | 28 | 18 | . | .| 46 |
| 9 | 36 | 26 | . | .| 62 |
| 10 | 45 | 35 | . | .| 80 |
| 11 | 55 | 45 | 0 | .| 100 |
| 12 | 66 | 56 | 11 | .| 133 |
| 13 | 78 | 68 | 23 | .| 169 |
| 14 | 91 | 81 | 36 | .| 208 |
| 15 | 105 | 95 | 50 | .| 250 |
| 16 | 120 | 110 | 65 | .| 295 |
| 17 | 136 | 126 | 81 | .| 343 |
.
As we can see each of those terms is a term of a different subsequence, that is generated with the same construction rule, that is: a(n) = n + a(n-1) + Z.
In fact:
A000217 --> a(n) = n + a(n-1) + 0;
A056000 --> a(n) = n + a(n-1) + 4;
A101859 --> a(n) = n + a(n-1) + 10.
And so on, where the Z value is the n value of this sequence when the number of digits of a(n) is greater than that of a(n-1), or Z = Sum_{j=1..i} k(j) where k(j) is A270270(j).

Examples

			a(4) = 3 + 3*1 = 6;
a(5) = 6 + 4*1 = 10;
a(6) = 10 + 5*2 = 20.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 0; a[n_] := a[n] = # + (n - 1) If[# == 0, 1, IntegerLength@ #] &@ a[n - 1]; Table[a@ n, {n, 57}] (* Michael De Vlieger, Mar 09 2016 *)
  • PARI
    a(n) = if (n==1, 0, prec = a(n-1); prec + (n-1)*#Str(prec)); \\ Michel Marcus, Apr 03 2016
  • Python
    b = 0
    print(b, end=',')
    for g in range(1, 100):
       b += g*len(str(b))
       print(b, end=',')
    

A269306 a(n+1) is the smallest integer such that the difference between its digital sum and the digital sum of a(n) is n.

Original entry on oeis.org

0, 1, 3, 6, 19, 69, 399, 1999, 9999, 99999, 1999999, 39999999, 699999999, 19999999999, 699999999999, 39999999999999, 1999999999999999, 99999999999999999, 9999999999999999999, 1999999999999999999999
Offset: 1

Author

Francesco Di Matteo, Feb 23 2016

Keywords

Comments

The digital sums are the triangular numbers A000217. A similar idea is in A268605 (thanks to Michel Marcus for this comment).

Examples

			a(8) = 1999 and 1 + 9 + 9 + 9 = 28; so a(9) = 9999 because 9 + 9 + 9 + 9 = 36 and 36 - 28 = 8.
		

Crossrefs

Programs

  • PARI
    findnext(x, k) = {sx = sumdigits(x); y = 1; while (sumdigits(y) - sx != k, y++); y; }
    lista(nn) = {print1(x = 0, ", "); for (k=1, nn, y = findnext(x, k); print1(y, ", "); x = y; ); }
  • Python
    s = 0
    for i in range(0, 100):
      alfa = ""
      k = i + s
      s = k
      while k > 9:
        alfa = alfa + "9"
        k = k - 9
      alfa = str(k) + alfa
      print(alfa)
    

A266281 a(1)=1; a(n) is the first integer > a(n-1) with which, in the a(n-1)/a(n) decimal expansion, n is present.

Original entry on oeis.org

1, 4, 11, 13, 14, 17, 19, 22, 23, 29, 34, 47, 58, 61, 65, 87, 89, 93, 94, 97, 102, 103, 105, 109, 113, 115, 116, 118, 121, 130, 131, 136, 139, 141, 149, 152, 157, 159, 161, 166, 167, 169, 174, 177, 179, 181, 184, 188, 191, 193, 194, 197, 199, 203, 218, 223, 224
Offset: 1

Author

Francesco Di Matteo, Dec 26 2015

Keywords

Comments

Two other sequences are possible without the a(n)>a(n-1) limitation, one with a(n) terms already used in the sequences (where the n growth does not allow data looping), another only with a(n) terms not yet used.

Examples

			a(8) = 22 because a(7) = 19 and "8" does not appear in the digital expansion of 19/20 = 0.95 nor of 19/21 = 0.904761904761..., but it does appear in 19/22 = 0.86363...;
a(9) = 23 because 22/23 = 0.9565217391304..., where "9" does appear;
a(10) = 29 because "10" does not appear in the digital expansion of 23/k for k=24..28, but it does appear in 23/29 = 0.7931034...
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{a = {1}, k}, Do[k = a[[m - 1]] + 1; While[SequenceCount[Flatten@ First@ RealDigits[a[[m - 1]]/k], IntegerDigits@ m] < 1, k++]; AppendTo[a, k], {m, 2, n}]; a]; f@ 57 (* Version 10.1, or *)
    f[n_] := Block[{a = {1}, k}, Do[k = a[[m - 1]] + 1; While[StringCount[
    ToString[FromDigits@ Flatten@ First@ RealDigits[a[[m - 1]]/k]], ToString@ m] < 1, k++]; AppendTo[a, k], {m, 2, n}]; a]; f@ 57 (* Michael De Vlieger, Dec 30 2015, Version 5.1 *)

A268605 a(1) = 0; a(n+1) is the smallest integer in which the difference between its digits sum and the a(n) digits sum is equal to the n-th prime.

Original entry on oeis.org

0, 2, 5, 19, 89, 1999, 59999, 4999999, 599999999, 199999999999, 399999999999999, 799999999999999999, 8999999999999999999999, 499999999999999999999999999, 29999999999999999999999999999999, 4999999999999999999999999999999999999
Offset: 1

Author

Francesco Di Matteo, Feb 17 2016

Keywords

Comments

First 8 terms are primes (and are also in A061248). Next terms are not always primes.

Examples

			a(4) = 19 and 1 + 9 = 10; so a(5) = 89 because 8 + 9 = 17 and 17 - 10 = 7, that is the 4th prime.
		

Crossrefs

Programs

  • PARI
    findnext(x, k) = {sx = sumdigits(x); pk = prime(k); y = 1; while (sumdigits(y) - sx != pk, y++); y;}
    lista(nn) = {print1(x = 0, ", "); for (k=1, nn, y = findnext(x, k); print1(y, ", "); x = y;);} \\ Michel Marcus, Feb 19 2016
  • Python
    sumprime = 0
    isPrime=lambda x: all(x % i != 0 for i in range(int(x**0.5)+1)[2:])
    print(0)
    for i in range(2,100):
      if isPrime(i):
        alfa = ""
        k = i + sumprime
        sumprime = k
        while k > 9:
          alfa = alfa + "9"
          k = k - 9
        alfa = str(k)+alfa
        print(alfa)
    

Formula

a(n) = A051885( A007504(n-1) ). - R. J. Mathar, Jun 19 2021

Extensions

NAME adapted to offset by R. J. Mathar, Jun 19 2021

A264847 Pluritriangular numbers: a(0) = 0; a(n+1) = a(n) + the number of digits in terms a(0)..a(n).

Original entry on oeis.org

0, 1, 3, 6, 10, 16, 24, 34, 46, 60, 76, 94, 114, 137, 163, 192, 224, 259, 297, 338, 382, 429, 479, 532, 588, 647, 709, 774, 842, 913, 987, 1064, 1145, 1230, 1319, 1412, 1509, 1610, 1715, 1824, 1937, 2054, 2175, 2300, 2429, 2562, 2699, 2840, 2985, 3134, 3287, 3444, 3605, 3770, 3939
Offset: 0

Author

Francesco Di Matteo, Nov 26 2015

Keywords

Comments

Due to its generation rule, a(n+1) is the sum of floor(log_10(a(n)))+1 terms of A000217 (triangular numbers), as the name suggests.
This is easy to verify by observing the following table:
+----+-----+----+----+---+-----+
| n | Tn | Tn'| Tn"|...| a(n)|
+----+-----+----+----+---+-----+
| 1 | 1 | | | | 1 |
| 2 | 3 | | | | 3 |
| 3 | 6 | | | | 6 |
| 4 | 10 | | | | 10 |
| 5 | 15 | 1 | | | 16 |
| 6 | 21 | 3 | | | 24 |
| 7 | 28 | 6 | | | 34 |
| 8 | 36 | 10 | | | 46 |
| 9 | 45 | 15 | | | 60 |
| 10 | 55 | 21 | | | 76 |
| 11 | 66 | 28 | | | 94 |
| 12 | 78 | 36 | | | 114 |
| 13 | 91 | 45 | 1 | | 137 |
| 14 | 105 | 55 | 3 | | 163 |
| 15 | 120 | 66 | 6 | | 192 |
.
It is evident that each new Tn sequence starts after each a(k) terms of A265108, corresponding to the n (number of digits) change, as also pointed out in A265108 (see also Formula).

Examples

			a(1) = 1 = 0 + 1 because a(0) = 0 and 0 has 1 digit.
...
a(6) = 24 = 16 + 8 because a(5) = 16 and 0, 1, 3, 6, 10, 16 have 8 digits.
a(7) = 34 = 24 + 10 because a(6) = 24 and 0, 1, 3, 6, 10, 16, 24 have 10 digits.
		

Crossrefs

Programs

  • Maple
    a[0]:= 0: d[0]:= 1;
    for n from 1 to 300 do
      a[n]:= a[n-1] + d[n-1];
      d[n]:= d[n-1] + ilog10(a[n])+1;
    od:
    seq(a[i],i=0..300); # Robert Israel, Dec 14 2015
  • Mathematica
    a = {0}; Do[AppendTo[a, a[[n - 1]] + Length@ Flatten@ Map[IntegerDigits, a]], {n, 2, 68}]; a (* Michael De Vlieger, Nov 27 2015 *)
  • PARI
    lista(nn) = {v = vector(nn); for (i=2, nn, v[i] = v[i-1] + sum(k=1, i-1, #Str(v[k]));); v;} \\ Michel Marcus, Dec 05 2015
  • Python
    a, b = 0, 0
    print(a, end=',')
    for k in range(1, 101):
       b += len(str(a))
       a += b
       print(a, end=',')
    

Formula

a(n) = T(n) + T(n-k(1)) + T(n-(k(1)+ k(2))) + T(n-(k(1)+ k(2) + k(3))) + ... + T(n - Sum_{j=1..i} k(j)) with (n - Sum_{j=1..i} k(j)) > 0, where T are the triangular numbers and where k(j) is A265108(j).
E.g., a(25) = T(25) + T(25 - 4) + T(25 - 4 - 8) = 325 + 231 + 91 = 647.
G.f.: (1-x)^(-3) * Sum_{k>=1} x^(b(k)+1) where b(k) is the first m such that a(m) has k decimal digits (including b(1)=0). - Robert Israel, Dec 14 2015
a(n+1) = 2*a(n) - a(n-1) + floor(log_10(a(n))) + 1. - Danny Rorabaugh, Jan 20 2016

A265108 The number of n-digit numbers in A264847 (pluritriangular numbers).

Original entry on oeis.org

0, 4, 8, 19, 50, 142, 408, 1186, 3498, 10401, 31139, 93728, 283377, 859939, 2617798, 7990517, 24447214, 74950315, 230198869, 708160711, 2181656006, 6729833482, 20784165689, 64257670873, 198857204708, 615951476925
Offset: 0

Author

Francesco Di Matteo, Dec 01 2015

Keywords

Comments

In order to find a closed formula for A264847, this sequence could be useful to point out the terms in which the increment changes. For example, the increment is (a(i) + 3) from the 13th to the 31st, (a(i) + 4) from the 32nd to the 81st, etc.
Conjecture: lim_{n -> infinity} a(n)/a(n-1) = sqrt(10).

Examples

			a(1) = 4 because in A264847 there are 4 numbers with 1 digit (0, 1, 3, 6).
a(2) = 8 because in A264847 there are 8 numbers with 2 digits (10, 16, 24, 34, 46, 60, 76, 94).
		

Crossrefs

Cf. A264847.

Programs

  • Mathematica
    a = {0}; Do[AppendTo[a, a[[n - 1]] + Length@ Flatten@ Map[IntegerDigits, a]], {n, 2, 2000}]; Prepend[Most@ Map[Last, Tally[{1}~Join~IntegerLength@ Rest@ a]], 0] (* Michael De Vlieger, Dec 02 2015 *)
  • Python
    a, b, d = 0, 0, 0
    for g in range(1,18):
        h = 10**g
        while a < h:
            b = b + g
            a = a + b
            d = d + 1
        print(d, end=', ')
        d = 0

A259942 Numbers that are larger than or equal to the sum of the cubes of their prime factors (with multiplicity).

Original entry on oeis.org

1, 64, 96, 108, 128, 144, 162, 192, 216, 240, 243, 256, 270, 288, 300, 320, 324, 360, 384, 400, 405, 432, 448, 450, 480, 486, 500, 504, 512, 540, 560, 567, 576, 600, 625, 630, 640, 648, 672, 675, 700, 720, 729, 750, 756, 768, 784, 800, 810, 840, 864, 875, 882, 896, 900, 945, 960, 972, 980, 1000
Offset: 1

Author

Francesco Di Matteo, Nov 08 2015

Keywords

Comments

This sequence is analogous to A166319 but with cubes instead of squares.

Examples

			64 = 2*2*2*2*2*2 >= 6 * 2^3, so 64 is in the sequence.
96 = 3*2*2*2*2*2 >= 3^3 + 5 * 2^3, so 96 is in the sequence.
256 = 4*4*4*4 >= 4*4^3, so 256 is in the sequence.
		

Crossrefs

Programs

  • Maple
    isA259942 := proc(n)
        local ifa;
        ifa := ifactors(n)[2] ;
        return (n >= add( op(2,p)*op(1,p)^3,p=ifa)) ;
    end proc:
    for n from 0 to 1000 do
        if isA259942(n) then
            printf("%d,",n);
        end if;
    end do: # R. J. Mathar, Nov 27 2015
  • Mathematica
    scpfQ[n_]:=n>=Total[Flatten[Table[#[[1]],{#[[2]]}]&/@ FactorInteger[ n]]^3]; Select[Range[1000],scpfQ] (* Harvey P. Dale, Dec 25 2015 *)
  • PARI
    isok(n) = {my(f = factor(n)); n >= sum(k=1, #f~, f[k,2]*f[k,1]^3);} \\ Michel Marcus, Nov 28 2015
  • Python
    from sympy import factorint
    for j in range(1, 1001):
        k =  factorint(j)
        it = list(k.keys())
        va = list(k.values())
        alfa = 0
        for l in range(0,len(k)):
            alfa = alfa + va[l]*(it[l]**3)
        if alfa <=j:
            print(j)