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-6 of 6 results.

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

A335505 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 5*x(j-1) by deleting all occurrences of the digit k in base n.

Original entry on oeis.org

0, 1, 1, 6, 1, 1, 4, 1, 1, 2, 1, 1, 0, 0, 0, 6, 60, 6, 30, 2, 1, 48, 2, 3, 12, 0, 1, 6, 156, 14, 22, 2, 18, 1, 34, 78, 12, 36, 3, 48, 0, 1, 138, 198, 10, 684, 1, 1, 2, 20, 1, 2, 0, 22, 1872, 495, 2, 50, 315, 0, 1, 405, 245, 2780, 0, 1440
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.
T(n,k) = 1 whenever k is a power of 5 and k > 1.

Examples

			Triangle begins:
   n\k   0    1    2    3    4    5    6    7    8    9
  -----------------------------------------------------
   1:    0
   2:    1    1
   3:    6    1    1
   4:    4    1    1    2
   5:    1    1    0    0    0
   6:    6   60    6   30    2    1
   7:   48    2    3   12    0    1    6
   8:  156   14   22    2   18    1   34   78
   9:   12   36    3   48    0    1  138  198   10
  10:  684    1    1    2   20    1    2    0   22 1872
T(10,7) = 0 because A335506 never enters a cycle.
		

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 A335505(n,k):
      return cycle_length(n,k,5) if n>1 else 0

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

A335503 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 3*x(j-1) by deleting all occurrences of the digit k in base n.

Original entry on oeis.org

0, 1, 1, 1, 1, 0, 12, 1, 2, 1, 28, 1, 0, 1, 2, 64, 1, 2, 1, 2, 4, 60, 4, 2, 1, 4, 0, 2, 54, 1, 2, 1, 62, 16, 2, 48, 2, 1, 0, 1, 0, 0, 0, 0, 0, 80, 40, 4, 1, 20, 2000, 60, 72, 4, 1, 40, 20, 5, 1, 85, 240, 5, 5, 20, 1, 320, 1260, 128, 2, 1, 272, 4, 2, 48, 68, 1, 20, 1440
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.
T(n,k) = 1 whenever k is a power of 3 and k>1.

Examples

			Triangle begins:
   n\k   0    1    2    3    4    5    6    7    8    9   10   11
  ---------------------------------------------------------------
   1:    0
   2:    1    1
   3:    1    1    0
   4:   12    1    2    1
   5:   28    1    0    1    2
   6:   64    1    2    1    2    4
   7:   60    4    2    1    4    0    2
   8:   54    1    2    1   62   16    2   48
   9:    2    1    0    1    0    0    0    0    0
  10:   80   40    4    1   20 2000   60   72    4    1
  11:   40   20    5    1   85  240    5    5   20    1  320
  12: 1260  128    2    1  272    4    2   48   68    1   20 1440
T(10,0) = 80, because A243845 eventually enters a cycle of length 80.
		

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 A335503(n,k):
      return cycle_length(n,k,3) if n>1 else 0

A335504 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 4*x(j-1) by deleting all occurrences of the digit k in base n.

Original entry on oeis.org

0, 1, 1, 2, 1, 1, 1, 1, 0, 0, 2, 24, 2, 2, 1, 16, 18, 1, 6, 1, 42, 33, 1, 1, 15, 1, 24, 3, 3, 1, 1, 0, 1, 0, 0, 0, 3, 1, 195, 27, 1, 465, 147, 2, 6, 1002, 18, 4, 42, 1, 66, 2, 10, 10, 738, 1660, 25, 5, 180, 1, 2, 15, 35, 150, 4, 1490
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.
T(n,k) = 1 whenever k is a power of 4 and k>1.

Examples

			Triangle begins:
   n\k   0    1    2    3    4    5    6    7    8    9
  -----------------------------------------------------
   1:    0
   2:    1    1
   3:    2    1    1
   4:    1    1    0    0
   5:    2   24    2    2    1
   6:   16   18    1    6    1   42
   7:   33    1    1   15    1   24    3
   8:    3    1    1    0    1    0    0    0
   9:    3    1  195   27    1  465  147    2    6
  10: 1002   18    4   42    1   66    2   10   10  738
		

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 A335504(n,k):
      return cycle_length(n,k,4) if n>1 else 0

A306567 a(n) is the largest value obtained by iterating x -> noz(x + n) starting from 0 (where noz(k) = A004719(k) omits the zeros from k).

Original entry on oeis.org

9, 99, 27, 99, 96, 99, 63, 99, 81, 91, 99, 195, 94, 295, 93, 291, 113, 189, 171, 992, 159, 187, 187, 483, 988, 475, 153, 281, 181, 273, 279, 577, 297, 997, 567, 369, 333, 363, 351, 994, 219, 465, 357, 663, 459, 461, 423, 192, 441, 965, 399, 999, 437, 126, 551
Offset: 1

Author

Rémy Sigrist, Feb 24 2019

Keywords

Comments

For any n > 0, a(n) is well defined:
- the set of zeroless numbers (A052382) contains arbitrarily large gaps,
- for example, for any k > 0, the interval I_k = [10^k..(10^(k+1)-1)/9-1] if free of zeroless numbers,
- let i be such that #I_i > n,
- let b_n be defined by b_n(0) = 0, and for any j > 0, b_n(j) = noz(b_n(j-1) + n),
- as b_n starts below 10^i and cannot cross the gap constituted by I_i,
- b_n is bounded (and eventually periodic), QED.

Examples

			For n = 1:
- noz(0 + 1) = 1,
- noz(1 + 1) = 2,
- noz(2 + 1) = 3,
  ...
- noz(7 + 1) = 8,
- noz(8 + 1) = 9,
- noz(9 + 1) = noz(10) = 1,
- hence a(1) = 9.
		

Crossrefs

See A306569 for the multiplicative variant.

Programs

  • PARI
    \\ See Links section.

Formula

Empirically, for any k >= 0:
- a( 10^k) = 9 * 10^k + (10^k-1)/9,
- a(2 * 10^k) = 99 * 10^k + 2 * (10^k-1)/9,
- a(3 * 10^k) = 27 * 10^k + 3 * (10^k-1)/9,
- a(4 * 10^k) = 99 * 10^k + 4 * (10^k-1)/9,
- a(5 * 10^k) = 96 * 10^k + 5 * (10^k-1)/9,
- a(6 * 10^k) = 99 * 10^k + 6 * (10^k-1)/9,
- a(7 * 10^k) = 63 * 10^k + 7 * (10^k-1)/9,
- a(8 * 10^k) = 99 * 10^k + 8 * (10^k-1)/9,
- a(9 * 10^k) = 81 * 10^k + 9 * (10^k-1)/9.
Showing 1-6 of 6 results.