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.

A217705 Smallest number greater than 1 that is happy under bases 2 through n.

This page as a plain text file.
%I A217705 #20 Mar 23 2013 16:35:43
%S A217705 2,3,3,23,79,2207,58775,569669,11814485,210511543,73748383237
%N A217705 Smallest number greater than 1 that is happy under bases 2 through n.
%C A217705 A happy number is a number that after iteration of sum of squares of digits eventually reaches 1 (A007770). The happy property is base-dependent. This sequence lists the smallest number that is happy in bases 2, 3, ..., n.
%C A217705 All numbers are happy in binary and base 4.
%e A217705 a(8) = 58775 because:
%e A217705 Base 2: 1110010110010111 - 1010 - 10 - 1,
%e A217705 Base 3: 2222121212 - 1011 - 10 - 1,
%e A217705 Base 4: 321121113 - 132 - 32 - 31 - 22 - 20 - 10 - 1,
%e A217705 Base 5: 3340100 - 120 - 10 - 1,
%e A217705 Base 6: 1132035 - 121 - 10 - 1,
%e A217705 Base 7: 333233 - 100 - 1,
%e A217705 Base 8: 162627 - 202 - 10 - 1,
%e A217705 Base 9 fails since the end is the 58 - 108 - 72 cycle and fails to reach 1.
%o A217705 (PARI) ssd(n,b)=my(s);while(n,s+=(n%b)^2;n\=b);s
%o A217705 happy(k,b)=my(t=ssd(k,b));k=ssd(t,b);while(t!=k&&k>1,t=ssd(t,b);k=ssd(ssd(k,b),b));k==1
%o A217705 h3(k)=while(k>8, k=ssd(k,3));k==1 || k==3
%o A217705 a(n)=if(n<4,return(n));my(k=2);while(k++, if(!h3(k),next); for(b=5,n, if(!happy(k,b), next(2)));return(k)) \\ _Charles R Greathouse IV_, Mar 22 2013
%Y A217705 Cf. A007770, A001273, A068571, A161871, A161873, A055629, A161872, A094406.
%K A217705 base,hard,nonn
%O A217705 2,1
%A A217705 _Sergio Pimentel_, Mar 20 2013
%E A217705 a(9)-a(12) from _Giovanni Resta_, Mar 21 2013