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

A194281 Number of cycles under iteration of sum of cubes of digits in base b.

Original entry on oeis.org

0, 1, 0, 1, 1, 8, 1, 4, 4, 6, 2, 12, 3, 7, 8, 7, 3, 16, 3, 6, 7, 7, 4, 14, 1, 8, 11, 7, 2, 20, 7, 5, 16, 9, 7, 18, 4, 7, 10, 6, 4, 24, 5, 5, 13, 6, 7, 25, 2, 10, 20, 6, 5, 23, 7, 7, 17, 9, 7, 29, 3, 10, 14, 14, 6, 21, 7, 10, 17, 18, 9, 30, 8, 10, 24, 12, 4, 28, 4, 19, 12, 11, 6, 36
Offset: 2

Views

Author

Martin Renner, Aug 22 2011

Keywords

Comments

If b>=2 and n >= 2*b^3, then S(n,3,b)

Examples

			In the decimal system all integers go to (1); (153); (370); (371); (407) or (55, 250,133); (136, 244); (160, 217, 352); (919, 1459) under the iteration of sum of cubes of digits, hence there are five fixed points, two 2-cycles and two 3-cycles. Therefore a(10) = 2 + 2 = 4.
		

Crossrefs

Programs

  • Maple
    S:=proc(n,p,b) local Q,k,N,z; Q:=[n]; for k from 1 do N:=Q[k]; z:=convert(sum(N['i']^p,'i'=1..nops(N)),base,b); if not member(z,Q) then Q:=[op(Q),z]; else Q:=[op(Q),z]; break; fi; od; return Q; end:
    a:=proc(b) local Z,i,A,Q,B,C; A:=[]: for i from 1 to 2*b^3 do Q:=S(convert(i,base,b),3,b); A:={op(A),Q[nops(Q)]}; od: Z:={}: for i from 1 while nops(A)>0 do B:=S(A[1],3,b); C:=[seq(B[i],i=1..nops(B)-1)]: if nops(C)<>1 then Z:={op(Z),C}: fi: A:=A minus {op(B)}; od: return(nops(Z)); end:
    # Martin Renner, Aug 24 2011
  • Sage
    def A194281(n):
        cycle_mins = set()
        seen = {}
        for i in (1..2*n**3):
            if i not in seen:
                path = []
                while not i in path and not i in seen:
                    path.append(i)
                    i = sum(d**3 for d in i.digits(base=n))
                if i not in seen:
                    m = min(path[path.index(i):])
                    if sf(m) != m: cycle_mins.add(m)
                else: m = seen[i]
                for p in path: seen[p] = m
        return len(cycle_mins) # D. S. McNeil, Aug 24 2011

A226026 Maximum fixed points under iteration of sum of cubes of digits in base n.

Original entry on oeis.org

1, 17, 62, 118, 251, 250, 433, 1052, 407, 1280, 2002, 1968, 793, 3052, 5614, 1456, 5337, 5939, 2413, 5615, 20217, 11648, 11080, 31024, 5425, 1737, 28027, 26846, 17451, 33535, 10261, 64019, 23552, 44937, 30086, 84870, 17353, 55243, 48824, 108936, 58618, 87977
Offset: 2

Keywords

Comments

1 is considered a fixed point in all bases, 0 is not.
a(n)=1 iff A194025(n)=1.
In order for a number with d digits in base n to be a fixed point, it must satisfy the condition d*(n-1)^32. Because all binary numbers are "happy" (become 1 under iteration), there are no fixed points with more than 4 digits in any base.
Furthermore, 4-digit solutions of the form x0mm or xmmm (where m is n-1) represent extreme values of sum of cubed digits, and so 4-digit numbers can only be solutions if xn^3+n^2-1<=2n^3+x^3. For x=2 this reduces to n<=3, so any 4-digit solution must begin with 1 in bases above 3.

Examples

			In base 5, the numbers 1, 28 and 118 are written as 1, 103, and 433. The sum of the cubes of their digits are 1, 1+0^3+3^3=28, and 4^3+3^3+3^3=118. There are no other solutions, so a(5)=118.
		

Crossrefs

Number of fixed points in base n: A194025.
All fixed points in base 10: A046197.

Programs

  • R
    inbase=function(n,b) { x=c(); while(n>=b) { x=c(n%%b,x); n=floor(n/b) }; c(n,x) }
    yfp=vector("list",100)
    for(b in 2:100) { fp=c()
        for(w in 0:1) for(x in 1:b-1) for(y in 1:b-1) if((u1=w^3+x^3+y^3)<=(u2=w*b^3+x*b^2+y*b) & u1+b^3>u2+b-1)
            if(length((z=which((1:b-1)*((1:b-1)^2-1)==u2-u1)-1))) fp=c(fp,u2+z)
        yfp[[b]]=fp[-1]
        cat("Base",b,":",fp,"\n")
    }

A336783 Integers b where the number of cycles under iteration of sum of cubes of digits in base b is exactly four.

Original entry on oeis.org

5, 90, 188
Offset: 1

Author

Haiyang Wang, Aug 04 2020

Keywords

Comments

Let b > 1 be an integer, and write the base b expansion of any nonnegative integer m as m = x_0 + x_1 b + ... +x_d b^d with x_d > 0 and 0 <= x_i < b for i=0,...,d.
Consider the map S_{x^3,b}: N to N, with S_{x^3,b}(m) := x_0^3+ ... + x_d^3.
It is known that the orbit set {m,S_{x^3,b}(m), S_{x^3,b}(S_{x^3,b}(m)), ...} is finite for all m>0. Each orbit contains a finite cycle, and for a given base b, the union of such cycles over all orbit sets is finite. Let us denote by L(x^3,i) the set of bases b such that the set of cycles associated to S_{x^3,b} consists of exactly i elements. In this notation, the sequence is the set of known elements of L(x^3,4).
Meanwhile, the known terms of the sequence L(x^3,1) is {2}, L(x^3,2) is empty, and L(x^3,3) is {3, 26}. It's undetermined whether the complete sequences are finite, if so, whether the above give all terms.

Examples

			For instance, when b=5 the associated four cycles are (1),(28),(118) and (9,65,35).
		

Crossrefs

Cf. A336744 and A336762 (sum of squares of digits).

Formula

Integers b where A194025(b) + A194281(b) = 4.

A375036 Perimeter of n when it is considered as a "histonumber" (see Comments for definition).

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 6, 6, 8, 10, 12, 14, 16, 18, 20, 22, 8, 8, 8, 10, 12, 14, 16, 18, 20, 22, 10, 10, 10, 10, 12, 14, 16, 18, 20, 22, 12, 12, 12, 12, 12, 14, 16, 18, 20, 22, 14, 14, 14, 14, 14, 14, 16, 18, 20, 22, 16, 16, 16, 16, 16, 16, 16, 18
Offset: 0

Author

Eric Angelini, Jul 28 2024

Keywords

Comments

A histonumber is a geometric figure that appears when we transform each digit "d" of n into a column of unit squares of height "d". The number zero becomes a horizontal segment of unit length.
All histonumbers are even.

Examples

			Histonumbers "1234", "2024" and "1000"
.
            +---+                    +---+
            |   |                    |   |
        +---+   +                    +   +
        |   |   |                    |   |
    +---+   +   +        +---+   +---+   +
    |   |   |   |        |   |   |   |   |
+---+   +   +   +        +   +   +   +   +        +---+
| 1   2 | 3 | 4 |        | 2 | 0 | 2 | 4 |        | 1 | 0   0   0
+---+---+---+---+        +---+---+---+---+        +---+---+---+---+
.
The “1234” histonumber is a figure with a perimeter P of 16 units and a surface S of 10 square units (the surface of a histonumber is always the sum of its digits).
The “2024” histonumber is a figure with a perimeter P of 20 units and a surface S of 8 square units.
The “1000” histonumber is a figure with a perimeter P of 10 units and a surface S of 1 square unit.
By definition, a histonumber can always be drawn in one go on a sheet of paper, without ever lifting the pencil. This seems obvious for the 1234 histonumber above but is less so for 2024 and 1000. However, this is also the case here because the pencil will pass twice below the zeros. This justifies the value P = 20 of the perimeter of 2024 and the value P = 10 of the perimeter of 1000.
		

Crossrefs

Cf. A001477, A007953, A194025 (Histogram link in the Links section).

Programs

  • Maple
    a:= n-> (l-> (h-> 2*h+l[1]+l[-1]+add(abs(l[i]-l[i-1])
               , i=2..h))(nops(l)))(convert(n, base, 10)):
    seq(a(n), n=0..67);  # Alois P. Heinz, Jul 29 2024
  • Python
    def a(n):
        d = [0] + list(map(int, str(n))) + [0]
        return 2*(len(d)-2) + sum(abs(d[i+1]-d[i]) for i in range(len(d)-1))
    print([a(n) for n in range(68)]) # Michael S. Branicky, Jul 28 2024
Showing 1-4 of 4 results.