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.

A118881 Square of sum of decimal digits of n.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 36, 49, 64, 81, 100, 121, 144
Offset: 0

Views

Author

Giovanni Teofilatto, May 25 2006

Keywords

Comments

a(k) = k iff k = 0, 1, 81; also, the only solution to the double equation a(k) = m and a(m) = k with k < m is (169, 256) (proof in Diophante link, 2ème jonglerie). - Bernard Schott, Mar 08 2021
If the map i->a(i) is iterated starting at i = n, the trajectory will eventually reach one ot the three cycles (1) (if n == +-1 mod 9), (169,256) (if n == 2,4,5,7 mod 9), or (81) (if n == 0 mod 3). - N. J. A. Sloane, Mar 17 2025

Examples

			From _R. J. Mathar_, Jul 08 2012: (Start)
Trajectories of the map x->a(x), A177148:
1 ->1 ->1 ->1 ->1 ->1 ->1 ->1 ->1 ->...
2 ->4 ->16 ->49 ->169 ->256 ->169 ->256 ->169 ->...
3 ->9 ->81 ->81 ->81 ->81 ->81 ->81 ->81 ->...
4 ->16 ->49 ->169 ->256 ->169 ->256 ->169 ->256 ->...
5 ->25 ->49 ->169 ->256 ->169 ->256 ->169 ->256 ->...
6 ->36 ->81 ->81 ->81 ->81 ->81 ->81 ->81 ->...
7 ->49 ->169 ->256 ->169 ->256 ->169 ->256 ->169 ->...
8 ->64 ->100 ->1 ->1 ->1 ->1 ->1 ->1 ->... (End)
		

Crossrefs

Cf. A007953.

Programs

  • Maple
    read("transforms") :
    A118881 := proc(n)
            digsum(n)^2 ;
    end proc: # R. J. Mathar, Jul 08 2012
  • Mathematica
    Table[Total[IntegerDigits[n]]^2,{n,0,70}] (* Harvey P. Dale, Jul 31 2012 *)
  • PARI
    a(n) = sumdigits(n)^2; \\ Michel Marcus, Mar 08 2021
    
  • Python
    def a(n): return sum(map(int, str(n)))**2
    print([a(n) for n in range(67)]) # Michael S. Branicky, Nov 19 2021

Formula

a(n) = A007953(n)^2. [R. J. Mathar, Apr 22 2010]

A182128 Number of iterations of the map n -> (sum of the decimal digits of n)^3 before reaching the last number of the cycle.

Original entry on oeis.org

0, 0, 2, 3, 3, 2, 3, 3, 1, 2, 1, 2, 3, 3, 2, 3, 3, 1, 2, 2, 2, 3, 3, 2, 3, 3, 1, 2, 2, 2, 3, 3, 2, 3, 3, 1, 2, 2, 2, 2, 3, 2, 3, 3, 1, 2, 2, 2, 2, 3, 2, 3, 3, 1, 2, 2, 2, 2, 3, 2, 3, 3, 1, 2, 2, 2, 2, 3, 2, 2, 3, 1, 2, 2, 2, 2, 3, 2, 2, 3, 1, 2, 2, 2, 2, 3, 2
Offset: 0

Views

Author

Michel Lagneau, Apr 13 2012

Keywords

Comments

a(n) is the number of times that the cube of the sum of the digits must be calculated before reaching the last number of the cycle.

Examples

			0 is in the sequence twice because 0 -> 0 and 1 -> 1;
a(3) = 3:
    3 ->       3^3 = 27;
   27 ->   (2+7)^3 = 729;
  729 -> (7+2+9)^3 = 18^3 = 5832 is the end of the map because 5832 -> (5+8+3+2)^3 = 18^3 is already in the trajectory. Hence we obtain the map: 3 -> 27 -> 729 -> 5832 with 3 iterations.
		

Crossrefs

Programs

  • Maple
    A182128 := proc(n)
            local traj ,c;
            traj := n ;
            c := [n] ;
            while true do
                    traj := A118880(traj) ;
                    if member(traj,c) then
                            return nops(c)-1 ;
                    end if;
                    c := [op(c),traj] ;
            end do:
    end proc:
    seq(A182128(n),n=0..80) ; # R. J. Mathar, Jul 08 2012

A178481 Number of steps of the map x -> A055566(x), starting at n, before reaching the end of the cycle.

Original entry on oeis.org

0, 0, 5, 3, 4, 4, 2, 3, 2, 2, 1, 3, 2, 4, 2, 1, 2, 1, 2, 2, 5, 3, 3, 1, 1, 3, 1, 1, 0, 1, 3, 1, 2, 1, 1, 0, 0, 1, 3, 1, 3, 2, 2, 2, 1, 1, 0, 3, 2, 3, 4, 2, 4, 2, 1, 2, 3, 1, 5, 4, 2, 4, 1, 2, 2, 3, 1, 4, 4, 1, 4, 1, 2, 2, 3, 2, 3, 4, 2, 4, 2
Offset: 0

Views

Author

Michel Lagneau, May 28 2010

Keywords

Comments

a(n) is the number of times taking the 5th powers of the sums of digits before reaching a sum seen before (reaching the last number of the cycle).
Example:
6 -> 6^5 = 7776 -> (7+7+7+6)^5 = 27^5.
27^5 = 14348907 -> (1+4+3+4+8+9+0+7)^5 = 36^5.
36^5 = 60466176, last number of the cycle because (6+0+4+6+6+1+7+6)^5 = 36^5 = 60466176 belongs to the list.
Generalization for the k-th powers and conjecture: For each k >= 1, iteration of taking the k-th powers of digit sums reaches a cycle.
Example with k = 17; start with 3.
3^17 = 129140163, sum = 27,
27^17 = 2153693963075557766310747, sum = 117,
117^17 = 144264558065210807467328187211661877, sum = 153,
153^17 = 13796036156758195415808856807283698713, sum = 189,
189^17 = 501014933601411817143935347829544613629, sum = 153 is already in the set.
[It remains unclear whether the author wanted to define iterations of (sumofdigits of n)^5, compatible with A177148 and A182128, or sumofdigits(n^5) here. I've taken the latter to be more compliant with the first terms of the original submission. - R. J. Mathar, Jul 08 2012]

Examples

			a(0) = 0 and a(1) = 0 because 0 -> 0 and 1 -> 1.
a(15) = 1 because 15^5 = 759375 -> (7+5+9+3+7+5) = 36,
36 ^5 = 60466176 -> (6+0+4+6+6+1+7+6) = 36.
		

Crossrefs

Programs

  • Maple
    A178481 := proc(n)
            local traj ,c;
            traj := n ;
            c := [n] ;
            while true do
                    traj := A055566(traj) ;
                    if member(traj,c) then
                            return nops(c)-1 ;
                    end if;
                    c := [op(c),traj] ;
            end do:
    end proc:
    seq(A178481(n),n=0..80) ; # R. J. Mathar, Jul 08 2012

A182129 Number of iterations of the orbit n -> (sum of the decimal digits of n)^n starting with n, needed to stabilize.

Original entry on oeis.org

0, 5, 3, 3, 5, 3, 3, 5, 5, 1, 6, 6, 2, 6, 9, 5, 2, 6, 2, 7, 5, 5, 6, 6, 6, 3, 5, 2, 9, 7, 6, 13, 12, 9, 5, 9, 2, 10, 9, 7, 15, 9, 7, 4, 7, 2, 6, 3, 7, 12, 6, 9, 9, 5, 2, 10, 12, 10, 14, 7, 8, 8, 11, 2, 13, 10, 5, 9, 8, 15, 9, 6, 2, 17, 13, 8, 9, 5, 15, 12
Offset: 1

Views

Author

Michel Lagneau, Apr 13 2012

Keywords

Comments

a(n) is the number of times you form the n-power of the sum of the digits before reaching the last number of the cycle.
Generalization and conjecture: Let k be a positive integer. The number of iterations of the orbit k -> (sum of the decimal digits of k)^n is finite for any exponent n and any starting value k.
Example with n = 17; start with k = 3.
3^17 = 129140163, sum of the decimal digits = 27,
27^17 = 2153693963075557766310747, sum of the decimal digits = 117,
117^17 = 144264558065210807467328187211661877, sum of the decimal digits = 153,
153^17 = 13796036156758195415808856807283698713, sum of the decimal digits = 189,
189^17 = 501014933601411817143935347829544613629, sum of the decimal digits = 153 is already in the trajectory.

Examples

			0 is in the sequence 1^1 -> 1;
For the power 2, a(2) = 5:
    2 ->       2^2 =   4;
    4 ->       4^2 =  16;
   16 ->   (1+6)^2 =  49;
   49 ->   (4+9)^2 = 169;
  169 -> (1+6+9)^2 = 256 is the end of the cycle because 256 -> (2+5+6)^2 = 169 is already in the trajectory. Hence we obtain the map: 2 -> 4 -> 16 -> 49 -> 169 -> 256 with 5 iterations.
		

Crossrefs

Programs

  • Maple
    with(numtheory) : T :=array(1..500) :W:=array(1..500):for n from 1 to 80 do : k:=0:nn:=n:for it from 1 to 50 do:T :=convert(nn,base,10) :l:=nops(T):s1:=sum(T[i],i=1..l):s:=s1^n:k:=k+1:W[k]:=s:nn:=s:od: z:= [seq(W[i],i=1..k)]:V:=convert(z,set):n1:=nops(V): printf(`%d, `,n1):od:
Showing 1-4 of 4 results.