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.

Previous Showing 41-50 of 54 results. Next

A306309 The "zeroless Pascal triangle" read by rows.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, 1, 5, 1, 1, 5, 1, 1, 6, 6, 2, 6, 6, 1, 1, 7, 12, 8, 8, 12, 7, 1, 1, 8, 19, 2, 16, 2, 19, 8, 1, 1, 9, 27, 21, 18, 18, 21, 27, 9, 1, 1, 1, 36, 48, 39, 36, 39, 48, 36, 1, 1, 1, 2, 37, 84, 87, 75, 75, 87, 84, 37, 2, 1
Offset: 0

Views

Author

Rémy Sigrist, Feb 06 2019

Keywords

Comments

Left and right edges are all 1's, interior entries are obtained by removing zeros from the sum of the two numbers above them.
For any k >= 0 and n >= 0, let d_k(n) = T(n+k, k).
For any k >= 0, d_k is eventually periodic: by induction:
- for k = 0: for any n >= 0, d_0(n) = 1, hence d_0 is 1-periodic,
- suppose that the property is true for some k >= 0,
- d_k is eventually p_k-periodic, and so d_k is bounded, say by m_k,
- d_{k+1}(n+1) - d_{k+1}(n) = d_k(n+1) <= m_k,
- so the first difference of d_{k+1} is bounded by m_k,
- A004719 has arbitrary large gaps,
and we can choose a range of m_k+1 terms that do not belong to A004719,
say x_k..x_k+m_k (with x_k > 1),
- d_{k+1}(0) = 1 < x_k,
and if d_{k+1}(n) < x_k, then d_{k+1)(n+1) < x_k,
so d_{k+1} is bounded by x_k,
- let D_{k+1}(n) = d_{k+1}(n*p_k},
- D_{k+1} is bounded,
so D_{k+1}(n + q_k) = D_{k+1}(n) for some n >= 0 and q_k > 0,
- we can assume that n*p_k is beyond the transient part of d_k,
- d_{k+1}(n*p_k + q_k*p_k + 1) = d_{k+1}(n*p_k+q_k*p_k) + d_k(n*p_k+q_k*p_k + 1)
= d_{k+1}(n*p_k) + d_k(n*p_k + 1)
= d_{k+1}(n*p_k + 1),
- we can generalize: for any m >= n*p_k, d_{k+1}(m + q_k*p_k) = d_{k+1)(m),
- and d_{k+1} is (at least q_k*p_k-)periodic, QED.

Examples

			Triangle begins:
                    1
                  1   1
                1   2   1
              1   3   3   1
            1   4   6   4   1
          1   5   1   1   5   1
        1   6   6   2   6   6   1
      1   7  12   8   8  12   7   1
    1   8  19   2  16   2  19   8   1
  1   9  27  21  18  18  21  27   9   1
...
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(n, 0) = T(n, n) = 1 for n >= 0.
T(n, k) = A004719(T(n-1, k-1) + T(n-1, k)) for n >= 0 and k = 1..n-1.
T(n, 1) = A177274(n-1) for any n > 0.

A345681 a(0) = 0; for n >= 1, a(n) = A004185(a(n-1)+n).

Original entry on oeis.org

0, 1, 3, 6, 1, 6, 12, 19, 27, 36, 46, 57, 69, 28, 24, 39, 55, 27, 45, 46, 66, 78, 1, 24, 48, 37, 36, 36, 46, 57, 78, 19, 15, 48, 28, 36, 27, 46, 48, 78, 118, 159, 12, 55, 99, 144, 19, 66, 114, 136, 168, 129, 118, 117, 117, 127, 138, 159, 127, 168
Offset: 0

Views

Author

Ctibor O. Zizka, Jun 22 2021

Keywords

Examples

			a(4) = A004185(6+4) = 1; a(13) = A004185(69+13) = 28.
		

Crossrefs

Programs

  • Mathematica
    a[0] := 0;
    a[n_] := FromDigits[Sort[DeleteCases[IntegerDigits[a[n - 1] + n], 0]]];
    Table[a[n], {n, 0, 59}] (* Robert P. P. McKone, Aug 16 2021 *)
  • PARI
    f(n) = fromdigits(vecsort(digits(n))); \\ A004185
    a(n) = if (n==0, 0, f(a(n-1)+n)); \\ Michel Marcus, Jun 26 2021
    
  • PARI
    f(n) = fromdigits(vecsort(digits(n))); \\ A004185
    lista(nn) = {my(v=vector(nn)); v[1] = 1; for (n=2, nn, v[n] = f(v[n-1]+n);); concat(0, v);} \\ Michel Marcus, Jun 26 2021
  • Python
    def A004185(n): return int("".join(sorted(str(n))).strip('0'))
    def aupton(nn):
        alst = [0]
        for n in range(1, nn+1): alst.append(A004185(alst[-1]+n))
        return alst
    print(aupton(100)) # Michael S. Branicky, Jun 22 2021
    

Formula

a(9*k+0 or 8) == 0 (mod 9);
a(9*k+1 or 4 or 7) == 1 (mod 9);
a(9*k+2 or 6) == 3 (mod 9);
a(9*k+3 or 5) == 6 (mod 9).

A348706 Delete all 0's from ternary expansion of n.

Original entry on oeis.org

1, 2, 1, 4, 5, 2, 7, 8, 1, 4, 5, 4, 13, 14, 5, 16, 17, 2, 7, 8, 7, 22, 23, 8, 25, 26, 1, 4, 5, 4, 13, 14, 5, 16, 17, 4, 13, 14, 13, 40, 41, 14, 43, 44, 5, 16, 17, 16, 49, 50, 17, 52, 53, 2, 7, 8, 7, 22, 23, 8, 25, 26, 7, 22, 23, 22, 67, 68, 23, 70, 71, 8, 25
Offset: 1

Views

Author

Rémy Sigrist, Oct 30 2021

Keywords

Examples

			The first terms, in decimal and in base 3, are:
  n   a(n)  ter(n)  ter(a(n))
  --  ----  ------  ---------
   1     1       1          1
   2     2       2          2
   3     1      10          1
   4     4      11         11
   5     5      12         12
   6     2      20          2
   7     7      21         21
   8     8      22         22
   9     1     100          1
  10     4     101         11
  11     5     102         12
  12     4     110         11
  13    13     111        111
  14    14     112        112
  15     5     120         12
		

Crossrefs

Cf. A004719 (decimal analog), A032924 (fixed points), A038573 (binary analog).

Programs

  • Mathematica
    a[n_] := FromDigits[DeleteCases[IntegerDigits[n, 3], 0], 3]; Array[a, 100] (* Amiram Eldar, Oct 31 2021 *)
  • PARI
    a(n, base=3) = fromdigits(select(sign, digits(n, base)), base)
    
  • Python
    from gmpy2 import digits
    def A348706(n): return int(digits(n,3).replace('0',''),3) # Chai Wah Wu, Nov 02 2021

Formula

a(n) <= n with equality iff n belongs to A032924.

A371911 Zeroless analog of tribonacci numbers.

Original entry on oeis.org

1, 1, 1, 3, 5, 9, 17, 31, 57, 15, 13, 85, 113, 211, 49, 373, 633, 155, 1161, 1949, 3265, 6375, 11589, 21229, 39193, 7211, 67633, 11437, 86281, 165351, 26369, 2781, 19451, 4861, 2793, 2715, 1369, 6877, 1961, 127, 8965, 1153, 1245, 11363, 13761, 26369, 51493, 91623, 169485, 31261
Offset: 0

Views

Author

Bryle Morga, Apr 11 2024

Keywords

Comments

At n = 208666297 this sequence enters a cycle that has a period of 300056874 and begins: 2847, 26331, 5851, ... (only the first 3 terms of the cycle are needed to reproduce the entire cycle).
This can be compared with the sequence A243063, which enters a cycle that has a (relatively) small period of 912.

Examples

			a(9) = Zr(a(8) + a(7) + a(6)) = Zr(17 + 31 + 57) = Zr(105) = 15.
		

Crossrefs

Programs

  • Mathematica
    a[0]=a[1]=a[2]=1; a[n_]:=FromDigits[DeleteCases[IntegerDigits[a[n-1]+a[n-2]+a[n-3]],0]]; Array[a,50,0] (* Stefano Spezia, Apr 12 2024 *)
  • Python
    def a(n):
        a, b, c = 1, 1, 1
        for _ in range(n):
            a, b, c = b, c, int(str(a+b+c).replace('0', ''))
        return a
    
  • Python
    # faster for initial segment of sequence
    from itertools import islice
    def agen(): # generator of terms
        a, b, c = 1, 1, 1
        while True: yield a; a, b, c = b, c, int(str(a+b+c).replace("0", ""))
    print(list(islice(agen(), 50))) # Michael S. Branicky, Apr 13 2024

Formula

a(n) = Zr(a(n-1) + a(n-2) + a(n-3)), where the function Zr(k) removes all zero digits from k.

A374265 Minimized zeroless factorials.

Original entry on oeis.org

1, 1, 2, 6, 24, 12, 72, 54, 432, 3888, 3888, 42768, 47916, 62298, 872172, 13968, 221688, 57996, 143928, 134712, 269154, 563994, 1247868, 286344, 877356, 171864, 513324, 1252728, 3414474, 914616, 41868, 119178, 454716, 127188, 527832, 15642, 91332, 192924, 125892, 29718
Offset: 0

Views

Author

Bryle Morga, Jul 02 2024

Keywords

Comments

a(n) is the smallest f(n) such that f(0) = 1 and for i > 0, f(i) = OpNoz_i(i*f(i-1)),where OpNoz_i is a function that either removes zeros or keeps the value unchanged (the choice is made for each value of i).
Removing zeros at every i gives an upper bound a(n) <= A243657(n); is this a strict inequality for n >= 12?
Is this sequence bounded?

Examples

			a(12) = 47916 via the path: 1, 1, 2, 6, 24, 12, 72, 504, 4032, 36288, 362880, 3991680, 47916.
		

Crossrefs

Programs

  • Python
    def a(n):
       reach = {1}
       for i in range(1, n+1):
          newreach = set()
          for m in reach:
             newreach.update([m*i, int(str(m*i).replace('0', ''))])
          reach = newreach
       return min(reach)

A374266 Smallest number reachable by a Fibonacci-like iteration where one has the option to either omit or keep zero digits.

Original entry on oeis.org

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 61, 438, 499, 937, 1436, 2373, 389, 2762, 1657, 1368, 325, 1693, 218, 1911, 2129, 44, 1516, 129, 394, 37, 53, 9, 62, 35, 133, 24, 121, 181, 95, 69, 11, 53, 19, 9, 19, 19, 2, 12, 5, 8, 4, 3, 7, 1, 8, 9, 8, 8, 7, 6, 4
Offset: 1

Views

Author

Bryle Morga, Jul 02 2024

Keywords

Comments

a(n) is the smallest f(n) such that f(1)=f(2)=1 and f(i) = OpNoz_i(f(i-1)+f(i-2)) for 2
Choosing to always remove zero digits at each step gives A243063. This strategy of always choosing to remove zeros is optimal for n < 23. For n >= 23, a(n) < A243063(n), i.e., the optimal path contains a step that keeps zeros.
Removal of zeros preserves the digital root giving the lower bound a(n) >= A030132(n). In fact, for n >= 53, a(n) = A030132(n). It follows that this sequence is eventually periodic with a period of 24.

Examples

			a(23) = 1657 via the path: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 1946, 8711, 1657.
		

Programs

  • Python
    def a(n):
        reach = {(1, 1)}
        for _ in range(n-1):
            newreach = set()
            for a, b in reach:
                newreach.update([(b, a+b), (b, int(str(a+b).replace('0', '')))])
            reach = newreach
        return min(reach, key = lambda k:k[0])[0]

Formula

a(n) <= A243063(n); Strict inequality for n >= 23.
a(n) = A030132(n) and a(n) = a(n+24) for n >= 53.

A374924 Zero-avoiding Fibonacci sequence: a(n) is the largest zeroless number that can be written as a(i) + a(j) where 1 ≤ i < j < n with a(1) = a(2) = 1.

Original entry on oeis.org

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 521, 898, 1419, 2317, 3736, 5155, 8891, 12627, 21518, 34145, 55663, 77181, 132844, 166989, 299833, 466822, 766655, 1233477, 1366321, 2599798, 3966119, 6565917, 9165715, 15731632, 24897347, 31463264, 47194896, 62926528, 94389792, 141584688, 188779584
Offset: 1

Author

Bryle Morga, Jul 24 2024

Keywords

Comments

Matches the Fibonacci sequence for the first 14 terms. This breaks after the 15th term because the 15th term of the Fibonacci sequence contains a 0.
Empirically, the ratio between consecutive term approaches 1. Is this sequence eventually constant?

Examples

			a(15) = 521 because:
a(13) + a(14) = 233 + 377 = 610. (contains a 0.)
a(12) + a(14) = 144 + 377 = 521.
		

Crossrefs

Programs

  • Python
    from itertools import islice
    def z(n): return int(str(n).replace("0", ""))
    def agen(): # generator of terms
        yield 1
        alst = [1, 1]
        an = 1
        while True:
            yield an
            an = max(max(z(ai+an) for ai in alst[:-1]), an)
            alst.append(an)
    print(list(islice(agen(), 45))) # Michael S. Branicky, Jul 24 2024

Formula

a(n+1) = max{a(n), max{A004719(a(i)+a(n)) for 1 <= i < n}}. - Michael S. Branicky, Jul 24 2024

A379927 Replacing each term of this sequence S with its digitsum produces a new sequence S' such that S and S' share the same succession of nonzero digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 18, 28, 17, 11, 26, 37, 16, 29, 20, 15, 12, 25, 46, 24, 101, 27, 110, 55, 14, 39, 200, 23, 13, 33, 299, 22, 38, 389, 34, 47, 32, 41, 59, 21, 36, 398, 479, 30, 49, 102, 111, 488, 45, 54, 497, 569, 120, 35, 201, 44, 63, 210, 31
Offset: 1

Author

Rémy Sigrist, Jan 06 2025

Keywords

Comments

The sequence starts with a(1) = 1 and is always extended with the smallest integer not yet present that doesn't lead to a contradiction.
This sequence is a variant of A302656 ignoring zeros; this feature prevents the huge jumps seen in A302656.

Examples

			The first terms are:
    1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 18, 28, 17, 11, 26, 37, 16, 29, 20
The corresponding digitsums are:
    1, 2, 3, 4, 5, 6, 7, 8, 9, 1,  10, 9,  10, 8,  2,  8,  10, 7,  11, 2
Keeping only the nonzero digits we obtain:
    12345678911918281711263716292
and 123456789119182817112.
		

Crossrefs

Programs

  • PARI
    \\ See Links section.

A380375 Delete all 0's from n, then replace each remaining digit k of n by A000005(k).

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 4, 3, 1, 11, 12, 12, 13, 12, 14, 12, 14, 13, 2, 21, 22, 22, 23, 22, 24, 22, 24, 23, 2, 21, 22, 22, 23, 22, 24, 22, 24, 23, 3, 31, 32, 32, 33, 32, 34, 32, 34, 33, 2, 21, 22, 22, 23, 22, 24, 22, 24, 23, 4, 41, 42, 42, 43, 42, 44, 42, 44, 43, 2, 21, 22, 22, 23, 22, 24, 22, 24, 23
Offset: 1

Author

Ctibor O. Zizka, Jan 23 2025

Keywords

Comments

Numbers including only the digits 1,2,3,4.

Examples

			n = 10: delete 0, replace digit 1 by A000005(1), thus a(10) = 1.
n = 24: replace digit 2 by A000005(2), replace digit 3 by A000005(3), thus a(22) = 22.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := FromDigits[DivisorSigma[0, DeleteCases[IntegerDigits[n], 0]]]; Array[a, 100] (* Amiram Eldar, Jan 23 2025 *)
  • Python
    def A380375(n):
        d,y = [1,2,2,3,2,4,2,4,3],""
        for i in str(n).replace("0",""):
            y += str(d[int(i)-1])
        return int(y) # John Tyler Rascoe, Feb 27 2025

Formula

a(10^n) = 1.

A385116 Take the natural numbers, erase all occurrences of the digit "0," and shift all remaining digits leftward without changing the position of commas.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 11, 21, 31, 41, 51, 61, 71, 81, 92, 21, 22, 23, 24, 25, 26, 27, 28, 29, 33, 13, 23, 33, 43, 53, 63, 73, 83, 94, 41, 42, 43, 44, 45, 46, 47, 48, 49, 55, 15, 25, 35, 45, 55, 65, 75, 85, 96, 61, 62, 63, 64, 65, 66, 67, 68, 69, 77
Offset: 1

Author

Dominic McCarty, Jun 18 2025

Keywords

Comments

a(1) = 1; digit stream is the same as that of A004719 and digit lengths A055642(a(n)) = A055642(n).

Examples

			Starting with:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, ...
Erase all zeros:
1, 2, 3, 4, 5, 6, 7, 8, 9, 1_, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2_, 21, ...
Shift all remaining digits to the left:
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 11, 21, 31, 41, 51, 61, 71, 81, 92, 21, 22, ...
		

Crossrefs

Programs

  • Python
    from itertools import count
    s = "".join(map(str,range(1,72))).replace("0","")
    a, i, = [], 0
    for k in count(1):
        if (j:=i+len(str(k))) > len(s): break
        a.append(int(s[i:j]))
        i = j
    print(a)
Previous Showing 41-50 of 54 results. Next