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
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.
Comments