A193585 Number of cycles under iteration of sum of squares of digits in base b.
0, 1, 0, 1, 1, 2, 3, 2, 1, 2, 4, 3, 2, 7, 1, 2, 1, 3, 1, 6, 2, 8, 4, 6, 1, 5, 4, 6, 2, 8, 6, 5, 3, 5, 4, 5, 3, 6, 1, 7, 6, 6, 2, 5, 4, 11, 4, 4, 4, 6, 3, 11, 4, 9, 4, 8, 4, 6, 6, 5, 4, 9, 6, 5, 2, 6, 3, 7, 7, 8, 5, 14, 5, 8, 3, 6, 3, 4, 5, 10, 5, 10, 6, 8, 5
Offset: 2
A194025 Number of fixed points under iteration of sum of cubes of digits in base b.
1, 2, 9, 3, 4, 7, 6, 8, 5, 8, 5, 5, 3, 3, 24, 3, 2, 9, 2, 3, 16, 5, 2, 20, 2, 2, 7, 9, 3, 14, 2, 6, 8, 4, 10, 12, 2, 8, 8, 7, 2, 12, 4, 5, 17, 5, 4, 27, 6, 5, 10, 4, 2, 11, 9, 5, 9, 6, 3, 25, 5, 6, 24, 5, 4, 17, 5, 5, 9, 10, 1, 15, 4, 3, 13, 3, 5, 19, 4, 13, 7
Offset: 2
Comments
If b >= 2 and n >= 2*b^3, then S(n,3,b) < n. For each positive integer n, there is a positive integer m such that S^m(n,3,b) < 2*b^3. (Grundman/Teeple, 2001, Lemma 8 and Corollary 9.)
From Christian N. K. Anderson, May 23 2013: (Start)
1 is considered a fixed point in all bases, 0 is not.
In order for a number with d digits in base n to be a fixed point, it must satisfy the condition d*(n-1)^3 < n^d, which can only occur when d < 4 for n > 2. Because all binary numbers are "happy" (become 1 under iteration), there are no fixed points with more than 4 digits in any base. It can further be demonstrated that all 4-digit solutions begin with 1 in base n.
Unlike the number of fixed points under iteration of sum of squares of digits (A193583), this sequence contains many even numbers, and its histogram converges to a smooth distribution (approximately gamma(2.64,2.8); see "histogram" in links). (End)
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) = 5.
Links
- Christian N. K. Anderson, Table of n, a(n) for n = 2..1000
- Christian N. K. Anderson, Histogram of a(n)
- H. G. Grundman and E. A. Teeple, Generalized Happy Numbers, Fibonacci Quarterly 39 (2001), nr. 5, p. 462-466.
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 F,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: F:={}: 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 F:={op(F),op(C)}: fi: A:=A minus {op(B)}; od: return(nops(F)); end: # Martin Renner, Aug 24 2011
-
R
#See A226026 for an optimized version inbase=function(n, b) { x=c(); while(n>=b) { x=c(n%%b, x); n=floor(n/b) }; c(n, x) }; yn=rep(NA, 30) for(b in 2:30) yn[b]=sum(sapply(1:(2*b^3), function(x) sum(inbase(x, b)^3))==1:(2*b^3)); yn # Christian N. K. Anderson, Jun 08 2013
-
Sage
def A194025(n): # inefficient but straightforward return len([i for i in (1..2*n**3) if i==sum(d**3 for d in i.digits(base=n))]) # D. S. McNeil, Aug 23 2011
A193586 Number of attractors under iteration of sum of squares of digits in base n.
1, 5, 1, 6, 9, 13, 10, 8, 9, 9, 20, 13, 12, 35, 7, 15, 7, 21, 27, 37, 24, 36, 32, 26, 10, 36, 27, 28, 10, 56, 22, 26, 23, 63, 39, 27, 19, 67, 9, 36, 40, 54, 54, 48, 18, 73, 52, 75, 18, 117, 52, 74, 22, 65, 48, 53, 45, 44, 43, 18, 30, 67, 39, 49, 87, 111, 15
Offset: 2
Comments
If b>=2 and a>=b^2 then S(a,2,b)
Examples
In the decimal system all integers go to (1) or (4, 16, 37, 58, 89, 145, 42, 20) under the iteration of sum of squares of digits, hence there is one fixed point and one 8-cycle. Therefore a(10) = 1 + 8 = 9.
Links
- Martin Renner, Table of n, a(n) for n = 2..300
- H. G. Grundman, E. A. Teeple, Generalized Happy Numbers, Fibonacci Quarterly 39 (2001), nr. 5, p. 462-466.
Programs
-
Maple
S:=proc(n,p,b) local Q,k,N,z; Q:=[convert(n,base,b)]; 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: NumberOfAttractors:=proc(b) local A,i,Q; A:=[]: for i from 1 to b^2 do Q:=S(i,2,b); A:=[op(A),Q[nops(Q)]]; od: return(nops({op(A)})); end: seq(NumberOfAttractors(b),b=2..50);
A209242 The largest fixed value (neither happy nor sad) in base n.
8, 1, 18, 1, 45, 52, 50, 1, 72, 125, 160, 1, 128, 1, 261, 260, 200, 1, 425, 405, 490, 1, 338, 1, 657, 628, 450, 848, 936, 845, 1000, 832, 648, 1, 1233, 1377, 800, 1, 1450, 1445, 1813, 1341, 1058, 1856, 2125, 1844, 1250, 1525, 1352, 2205, 2560, 1, 2873, 1, 3200
Offset: 3
Comments
A number is a fixed value if it is the sum of its own squared digits. Such values >1 are the only numbers that are neither happy (A007770) nor unhappy (A031177) in that base.
The number of fixed values in base B (A193583) is equal to one less than the number of divisors of (1+B^2) (Beardon, 1998, Theorem 3.1).
No fixed point has more than 2 digits in base B, and the two-digit number a+bB must satisfy the condition that (2a-1)^2+(2b-B)^2=1+B^2 (Beardon, 1998, Theorem 2.5). Since there are a finite number of ways to express 1+B^2 as the sum of two squares (A002654), this limits the search space.
Because fixed points have a maximum value of B^2-1 in base B, there are a large number of solutions near perfect squares, x^2. Surprisingly, there are also a large number of points near "half-squares", (x+.5)^2. See "Ulam spiral" in the links.
Examples
a(7)=45 because in base 7, 45 is 63 and 6^2+3^2=45. The other fixed values in base 7 are 32, 25, 10 and (as always) 1.
Links
- Christian N. K. Anderson, All fixed values in base n for n=3..10000
- Christian N. K. Anderson, Ulam spiral of maximum fixed values in base n for=3..1000
- Alan F. Beardon, Sums of Squares of Digits, The Mathematical Gazette, 82(1998), 379-388.
Programs
-
Python
from sympy.ntheory.digits import digits def ssd(n, b): return sum(d**2 for d in digits(n, b)[1:]) def a(n): m = n**2 - 1 while m != ssd(m, n): m -= 1 return m print([a(n) for n in range(3, 58)]) # Michael S. Branicky, Aug 01 2021
-
R
#ya=number of fixed points, yb=values of those fixed points library(gmp); ya=rep(0,200); yb=vector("list",200) for(B in 3:200) { w=1+as.bigz(B)^2 ya[B]=prod(table(as.numeric(factorize(w)))+1)-1 x=1; y=0; fixpt=c() if(ya[B]>1) { while(2*x^2
=0 & av=0 & bv
Extensions
Program improved and sequence extended by Christian N. K. Anderson, Apr 25 2013.
A377086 Number of fixed points under iteration of the map sending a positive integer to the product of its leading base-n digit and the sum of the squares of its base-n digits.
1, 2, 2, 1, 1, 4, 3, 4, 2, 3, 1, 3, 5, 2, 4, 4, 2, 4, 1, 3, 3, 3, 1, 5, 2, 3, 5, 4, 4, 9, 2, 1, 1, 4, 2, 6, 4, 1, 2, 5, 3, 6, 3, 1, 2, 3, 1, 7, 2, 1, 3, 3, 1, 5, 4, 6, 5, 4, 2, 8, 3, 2, 7, 3, 1, 4, 4, 2, 3, 6, 3, 9, 2, 3, 4, 9, 3, 7, 3, 2, 6, 5, 1, 7, 3, 3, 3
Offset: 2
Comments
If b>=2 and a>=b^3 then E(a,2,b)
Unlike the related sequence A193583, which contains only odd numbers, this sequence contains even numbers and odd numbers.
Examples
In the decimal system all integers go to (1), (298), (46, 208, 136), (26, 80, 512, 150), or (33, 54, 205, 58, 445, 228, 144) under iteration of the map A376270, hence there are two fixed points and three cycles. Therefore a(10) = 2.
Links
- Nathan Fox, Table of n, a(n) for n = 2..100
- N. Bradley Fox et al., Elated Numbers, arXiv:2409.09863 [math.NT], 2024.
A226026 Maximum fixed points under iteration of sum of cubes of digits in base n.
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
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.
Links
- Christian N. K. Anderson, Table of n, a(n) for n = 2..1000
- Christian N. K. Anderson, Table of base, maximum fixed point, number of fixed points, and all fixed points for base 2 to 1000.
Crossrefs
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") }
A336744 Integers b where the number of cycles under iteration of sum of squares of digits in base b is exactly three.
14, 66, 94, 300, 384, 436, 496, 750, 1406, 1794, 2336, 2624, 28034
Offset: 1
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^2,b}: N to N, with S_{x^2,b}(m) := x_0^2+ ... + x_d^2.
This is the 'sum of the squares of the digits' dynamical system alluded to in the name of the sequence.
It is known that the orbit set {m,S_{x^2,b}(m), S_{x^2,b}(S_{x^2,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^2,i) the set of bases b such that the set of cycles associated to S_{x^2,b} consists of exactly i elements. In this notation, the sequence is the set of known elements of L(x^2,3).
A 1978 conjecture of Hasse and Prichett describes the set L(x^2,2). New elements have been added to this set in the paper Integer Dynamics, by D. Lorenzini, M. Melistas, A. Suresh, M. Suwama, and H. Wang. It is natural to wonder whether the set L(x^2,3) is infinite. It is a folklore conjecture that L(x^2,1) = {2,4}.
Examples
For instance, in base 14, the three cycles are (1), (37,85), and (25,122,164,221,123,185,178,244,46). To verify that (37,85) is a cycle in base 14, note that 37=9+2*14, and that 9^2+2^2=85. Similarly, 85=1+6*14, and 1^2+6^2=37.
Links
- H. Hasse and G. Prichett, A conjecture on digital cycles, J. reine angew. Math. 298 (1978), 8--15. Also on GDZ.
- D. Lorenzini, M. Melistas, A. Suresh, M. Suwama, and H. Wang, Integer Dynamics, preprint.
Crossrefs
Formula
A336762 Integers b where the number of cycles under iteration of sum of squares of digits in base b is exactly two.
6, 10, 16, 20, 26, 40, 8626, 481360
Offset: 1
Comments
Let b > 1 be an integer, and write the base b expansion of any nonnegative integer n as n = 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^2,b}: N to N, with S_{x^2,b}(n) := x_0^2+ ... + x_d^2.
It is known that the orbit set {n, S_{x^2,b}(n), S_{x^2,b}(S_{x^2,b}(n)), ...} is finite for all n > 0. Each orbit contains a finite cycle, and for a given b, the union of such cycles over all orbit sets is finite. Let us denote by L(x^2,i) the set of bases b such that the set of cycles associated to S_{x^2,b} consists of exactly i elements. In this notation, the sequence is the set of known elements of L(x^2,2).
A 1978 conjecture of Hasse and Prichett describes the set L(x^2,2). New elements have been added to this set in the paper Integer Dynamics, by D. Lorenzini, M. Melistas, A. Suresh, M. Suwama, and H. Wang. The sequence contains all b <= 10^6 that are in L(x^2,2).
Examples
For instance, b = 10 is in this sequence since in the decimal system, there are exactly two cycles (1) and (4, 16, 37, 58, 89, 145, 42, 20).
Links
- H. Hasse and G. Prichett, A conjecture on digital cycles, J. reine angew. Math. 298 (1978), 8--15. Also on GDZ.
- D. Lorenzini, M. Melistas, A. Suresh, M. Suwama, and H. Wang, Integer Dynamics, preprint.
Comments
Examples
Links
Crossrefs