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.

Showing 1-10 of 11 results. Next

A243658 a(0)=0; thereafter a(n) = noz(n+a(n-1)), where noz(n) = A004719(n).

Original entry on oeis.org

0, 1, 3, 6, 1, 6, 12, 19, 27, 36, 46, 57, 69, 82, 96, 111, 127, 144, 162, 181, 21, 42, 64, 87, 111, 136, 162, 189, 217, 246, 276, 37, 69, 12, 46, 81, 117, 154, 192, 231, 271, 312, 354, 397, 441, 486, 532, 579, 627, 676, 726, 777, 829, 882, 936, 991, 147, 24, 82, 141, 21, 82, 144, 27, 91, 156, 222, 289
Offset: 0

Views

Author

N. J. A. Sloane, Jun 11 2014

Keywords

Comments

Zeroless analog of triangular numbers.

Crossrefs

Row n = 3 of A373169.

Programs

  • Maple
    noz:=proc(n) local a,t1,i,j; a:=0; t1:=convert(n,base,10); for i from 1 to nops(t1) do j:=t1[nops(t1)+1-i]; if j <> 0 then a := 10*a+j; fi; od: a; end;
    t1:=[0]; for n from 1 to 50 do t1:=[op(t1),noz(n+t1[n])]; od: t1;
  • Mathematica
    noz[n_] := FromDigits[DeleteCases[IntegerDigits[n], 0]];
    Block[{n = 0}, NestList[noz[++n+#] &, 0, 100]] (* Paolo Xausa, Apr 17 2024 *)
  • Python
    from itertools import count, islice
    def noz(n): return int(str(n).replace("0", ""))
    def agen(): # generator of terms
        yield (an:=0)
        yield from (an:=noz(n+an) for n in count(1))
    print(list(islice(agen(), 68))) # Michael S. Branicky, Jul 02 2024

A243657 Zeroless factorials: a(0)=1; thereafter a(n) = noz(n*a(n-1)), where noz(n) = A004719(n) omits the zeros from n.

Original entry on oeis.org

1, 1, 2, 6, 24, 12, 72, 54, 432, 3888, 3888, 42768, 513216, 667188, 934632, 141948, 2271168, 3869856, 6965748, 132349212, 264698424, 555866694, 1222967268, 28128247164, 67577931936, 16894482984, 439256557584, 1185992754768, 332779713354, 965611687266, 289683561798, 89819415738
Offset: 0

Views

Author

N. J. A. Sloane, Jun 11 2014

Keywords

Comments

Zeroless analog of factorial numbers.
A very crude calculation suggests a(n) may grow like n^10. I don't really believe that, but certainly a(n) grows very slowly in comparison with n!. - N. J. A. Sloane, Sep 03 2014

Crossrefs

Programs

  • Maple
    noz:=proc(n) local a,t1,i,j; a:=0; t1:=convert(n,base,10); for i from 1 to nops(t1) do j:=t1[nops(t1)+1-i]; if j <> 0 then a := 10*a+j; fi; od: a; end;
    t1:=[1]; for n from 1 to 50 do t1:=[op(t1),noz(n*t1[n])]; od: t1;
  • Mathematica
    nxt[{n_,a_}]:={n+1,FromDigits[DeleteCases[IntegerDigits[a(n+1)],0]]}; NestList[nxt,{0,1},40][[;;,2]] (* Harvey P. Dale, Feb 13 2024 *)
  • Python
    from itertools import count, islice
    def noz(n): return int(str(n).replace("0", ""))
    def agen(): # generator of terms
        yield (an:=1)
        yield from (an:=noz(n*an) for n in count(1))
    print(list(islice(agen(), 32))) # Michael S. Branicky, Jul 02 2024

A243063 Numbers generated by a Fibonacci-like sequence in which zeros are suppressed.

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, 3151, 5913, 964, 6877, 7841, 14718, 22559, 37277, 59836, 97113, 156949, 25462, 182411, 27873, 21284, 49157, 7441, 56598, 6439, 6337, 12776, 19113, 31889, 512, 3241
Offset: 1

Views

Author

Anthony Sand, Jun 09 2014

Keywords

Comments

Let x(1) = 1, x(2) = 1, then begin the sequence x(i) = no-zero(x(i-2) + x(i-1)), where the function no-zero(n) removes all zero digits from n.
The sequence behaves like a standard Fibonacci sequence until step 15, where x = no-zero(233 + 377) = no-zero(610) = 61. At step 16, x = 377 + 61 = 438. The sequence then proceeds until step 927, where x = no-zero(224 + 377) = no-zero(601) = 61. Therefore at step 928, x = 377 + 61 = 438 and the sequence repeats.

Examples

			x(3) = x(1) + x(2) = 1 + 1 = 2.
x(4) = x(2) + x(3) = 1 + 2 = 3.
x(15) = no-zero(x(13) + x(14)) = no-zero(233 + 377) = no-zero(610) = 61.
x(16) = 377 + 61 = 438.
		

Crossrefs

Programs

  • Maple
    noz:=proc(n) local a,t1,i,j; a:=0; t1:=convert(n,base,10); for i from 1 to nops(t1) do j:=t1[nops(t1)+1-i]; if j <> 0 then a := 10*a+j; fi; od: a; end; # A004719
    t1:=[1,1]; for n from 3 to 100 do t1:=[op(t1),noz(t1[n-1]+t1[n-2])]; od: t1; # N. J. A. Sloane, Jun 11 2014
  • Mathematica
    Nest[Append[#, FromDigits@ DeleteCases[IntegerDigits[Total@ #[[-2 ;; -1]] ], ?(# == 0 &)]] &, {1, 1}, 45] (* _Michael De Vlieger, Jun 27 2020 *)
    nxt[{a_,b_}]:={b,FromDigits[DeleteCases[IntegerDigits[a+b],0]]}; NestList[nxt,{1,1},50][[All,1]] (* Harvey P. Dale, Sep 12 2022 *)

Formula

x(i) = no-zero(x(i-2) + x(i-1)). For example, no-zero(233 + 377) = no-zero(610) = 61.

A306569 a(n) is the largest value obtained by iterating x -> noz(x * n) starting from 1 (where noz(k) = A004719(k) omits the zeros from k) if any, otherwise a(n) = -1.

Original entry on oeis.org

1, 765257552, 4858337151, 62987487698944, 14281197489647865625, 16756687971893376, 956884714362661, 292452281337511936, 11897243269649199, 1, 824281567746336491, 13552472793415699584, 841944776182612378933, 9434962871842528764976
Offset: 1

Views

Author

Rémy Sigrist, Feb 24 2019

Keywords

Comments

Is every term positive?

Examples

			a(2) = max(A242350) = 765257552.
		

Crossrefs

See A306567 for the additive variant.

Programs

  • PARI
    See Links section.

Formula

a(10^k) = 1 for any k >= 0.
a(10*n) = a(n) for any n > 0.

A243846 Numbers for which the nozero power-sequence of n falls into a loop.

Original entry on oeis.org

1, 366784, 14877, 531136, 29287878125, 13631616, 18916327, 1245376, 118971, 1, 24871, 1942272, 377414623, 361123756, 221285675921484375, 453559756, 16185473, 4136832, 113758939, 366784, 164961711, 3179798512, 131147731, 1841716224, 283439365914625, 118754727776
Offset: 1

Views

Author

Anthony Sand, Jun 12 2014

Keywords

Comments

Numbers returned by the following procedure: For n = 1, 2, 3, ..., let x(n; 1) = 1. Begin the recursive sequence x(n; i) = nozero(x(n; i-1) * n), where the function nozero(x) removes all zeros from x (see A004719). When x(n; i) = x(n; j
a(10*n) = a(n). - Pontus von Brömssen, May 19 2019

Examples

			a(2) = 366784 because x(2; 491) = nozero(183392 * 2) = 366784. Subsequently x(2; 527) = nozero(1533392 * 2) = nozero(3066784) = 366784, and this happens for the first time. Therefore x(2; 527) = x(2; 491) and the procedure returns x(2; 527) = 366784.
a(3) = 14877 because x(3; 28) = nozero(469359 * 3) = nozero(1408077) = 14877. Subsequently, x(3; 108) = nozero(4959 * 3) = 14877, and this happens for the first time. Therefore x(3; 28) = x(3; 108) and the procedure returns x(3;108) = 14877.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{h = <||>, t = n}, While[! KeyExistsQ[h,t], h[t]=0; t = FromDigits@ Select[ IntegerDigits[n t], # > 0 &]]; t]; Array[a, 20] (* Giovanni Resta, May 20 2019 *)

Formula

Recurrence: x(n; i) = nozero(x(n; i-1) * n), x(n; 1) = 1, i >= 2, with n >= 1. For example, for x(2;10) = 512 and nozero(512 * 2) = nozero(1024) = 124. Therefore x(2;11) = 124.
If the sequence {x(n; i)}_{i >= 1} becomes periodic at some entry x(n; j), that is if there exists a period length L(n) such that x(n; i + L(n)) = x(n; i) for i >= j then a(n) = x(n; j). If there is no such period length then one puts a(n) = 0.

Extensions

Edited: Comment, formula and example reformulated. - Wolfdieter Lang, Jul 13 2014
a(5), a(6), a(8), a(9) corrected by Pontus von Brömssen, May 19 2019
a(10)-a(26) from Giovanni Resta, May 20 2019

A335502 Triangle read by rows, 0 <= k < n, n >= 1: T(n,k) is the eventual period of the sequence x(j) (or 0 if x(j) never enters a cycle) defined as follows: x(0) = 1 and for j > 1 x(j) is obtained from 2*x(j-1) by deleting all occurrences of the digit k in base n.

Original entry on oeis.org

0, 1, 1, 4, 1, 1, 2, 1, 1, 0, 4, 1, 1, 3, 1, 12, 2, 1, 6, 1, 4, 78, 1, 1, 6, 1, 3, 6, 3, 1, 1, 0, 1, 0, 0, 0, 6, 1, 1, 18, 1, 4, 36, 4, 1, 36, 4, 1, 4, 1, 8, 4, 72, 1, 540, 100, 1, 1, 16, 1, 4, 17, 0, 1, 8, 4, 90, 2, 1, 12, 1, 4, 14, 6, 1, 4, 4, 240
Offset: 1

Author

Pontus von Brömssen, Jun 13 2020

Keywords

Comments

T(1,0) = 0 is defined in order to make the triangle of numbers regular.
One way of getting T(n,k) = 0 is to have x(j) = x(i)*n^e for some j > i and e > 0. For k < n <= 48, this is the only way to get T(n,k) = 0 (but see A335506 for another situation where the x-sequence is not periodic).
T(n,k) = 1 whenever k is a power of 2 and k > 1.
It seems that k = 0 and k = n-1 often lead to particularly long cycles.

Examples

			Triangle begins:
   n\k  0   1   2   3   4   5   6   7   8   9  10  11
  ---------------------------------------------------
   1:   0
   2:   1   1
   3:   4   1   1
   4:   2   1   1   0
   5:   4   1   1   3   1
   6:  12   2   1   6   1   4
   7:  78   1   1   6   1   3   6
   8:   3   1   1   0   1   0   0   0
   9:   6   1   1  18   1   4  36   4   1
  10:  36   4   1   4   1   8   4  72   1 540
  11: 100   1   1  16   1   4  17   0   1   8   4
  12:  90   2   1  12   1   4  14   6   1   4   4 240
For n = 10 and k = 5, the x-sequence starts 1, 2, 4, 8, 16, 32, 64, 128, 26, 2, and then repeats with a period of 8, so T(10,5) = 8.
T(10,0) = 36, because A242350 eventually enters a cycle of length 36.
For n=11 and k=7, the x-sequence starts (in base 11) 1, 2, 4, 8, 15, 2A, 59, 10. Disregarding trailing zeros, the sequence then repeats with period 7 and x(i+7*j) = x(i)*11^j for positive i and j. The x-sequence itself is therefore not eventually periodic, so T(11,7)=0.
		

Crossrefs

Programs

  • Python
    from sympy.ntheory.factor_ import digits
    from functools import reduce
    def drop(x,n,k):
      # Drop all digits k from x in base n.
      return reduce(lambda x,j:n*x+j if j!=k else x,digits(x, n)[1:],0)
    def cycle_length(n,k,m):
      # Brent's algorithm for finding cycle length.
      # Note: The function may hang if the sequence never enters a cycle.
      if (m,n,k)==(5,10,7):
        return 0 # A little cheating; see A335506.
      p=1
      length=0
      tortoise=hare=1
      nz=0
      while True:
        hare=drop(m*hare,n,k)
        while hare and hare%n==0:
          hare//=n
          nz+=1 # Keep track of the number of trailing zeros.
        length+=1
        if tortoise==hare:
          break
        if p==length:
          tortoise=hare
          nz=0
          p*=2
          length=0
      return length if not nz else 0
    def A335502(n,k):
      return cycle_length(n,k,2) if n>1 else 0

A243845 Numbers generated by recursive procedure a(n) = nozero(a(n-1) * 3), in which the function nozero(x) removes all zeros from x, starting with a(1) = 1.

Original entry on oeis.org

1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 5949, 17847, 53541, 16623, 49869, 14967, 4491, 13473, 4419, 13257, 39771, 119313, 357939, 173817, 521451, 1564353, 469359, 14877, 44631, 133893, 41679, 12537, 37611, 112833, 338499, 115497, 346491, 139473, 418419
Offset: 1

Author

Anthony Sand, Jun 12 2014

Keywords

Comments

Numbers in the following sequence: Let a(1) = 1, then begin the recursive sequence a(n) = nozero(a(n-1) * 3), where the function nozero(x) removes all zeros from x.
The sequence returns standard powers of 3 until step 11, where a(11) = nozero(19683 * 3) = nozero(59049) = 5949.
At step 28, a(28) = nozero(469359 * 3) = nozero(1408077) = 14877. At step 108, a(108) = nozero(4959 * 3) = 14877. Therefore a(28) = a(108) and the sequence repeats. Because this is the first instance where a member of this sequence is repeated one has a(n + L) = a(n) for n >= 28 with the primitive (least) period length L = 108 - 28 = 80.

Examples

			a(2) = nozero(3*a(1)) = nozero(3) = 3.
		

Crossrefs

Programs

  • Mathematica
    NestList[FromDigits@ DeleteCases[IntegerDigits[3 #], ?(# == 0 &)] &, 1, 38] (* _Michael De Vlieger, Jun 27 2020 *)
  • Sage
    L=[1]
    for i in [1..108]:
        T=(3*L[i-1]).digits(base=10)
        TT=filter(lambda a: a != 0, T)
        L.append(sum(TTi*10^i for i, TTi in enumerate(TT)))
    L # - Tom Edgar, Jun 17 2014

Formula

a(n) = A004719(a(n-1) * 3) for n>1, a(1) = 1.

Extensions

Edited: Name, comments and formula reformulated. - Wolfdieter Lang, Jul 13 2014

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

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.
		

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

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.
		

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

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.
Showing 1-10 of 11 results. Next